specdojo 0.9.0 → 0.9.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.
- package/.github/agents/specdojo-orchestrator.md +7 -0
- package/CHANGELOG.md +36 -0
- package/README.md +4 -4
- package/dist/commands/agent.js +15 -24
- package/dist/commands/init.js +8 -5
- package/dist/commands/orchestrator.js +11 -88
- package/dist/dashboard/shared.js +2 -2
- package/dist/dashboard/timeline.js +2 -2
- package/dist/deliverable/trash.js +2 -1
- package/dist/devcontainer/command.js +1 -1
- package/dist/devcontainer/scaffold.js +6 -5
- package/dist/exec/agent-config.js +4 -0
- package/dist/exec/commands.js +54 -4
- package/dist/exec/executor-outcome-checks.js +104 -0
- package/dist/exec/migrate-records.js +3 -1
- package/dist/exec/opencode-permissions.js +117 -0
- package/dist/exec/parent-validation.js +66 -15
- package/dist/exec/pipeline-state.js +16 -0
- package/dist/exec/register-foreign-wait.js +1 -3
- package/dist/exec/register.js +4 -0
- package/dist/exec/repo-trace.js +2 -1
- package/dist/exec/run/agent-pipeline.js +44 -3
- package/dist/exec/run/agent.js +1 -1
- package/dist/exec/run/change-scope.js +2 -2
- package/dist/exec/run/in-place.js +1 -1
- package/dist/exec/run/register-command.js +9 -0
- package/dist/exec/run/register-core.js +2 -1
- package/dist/exec/run/register-resume.js +19 -2
- package/dist/exec/run/register-worktree.js +2 -1
- package/dist/exec/run/resume-notes.js +50 -0
- package/dist/exec/run/shared.js +5 -0
- package/dist/exec/shared.js +1 -1
- package/dist/exec/task-repos.js +25 -4
- package/dist/exec/validation-process-group.js +98 -0
- package/dist/exec/worktree-command.js +3 -1
- package/dist/grade/command-inspect.js +3 -1
- package/dist/grade/command-run.js +1 -0
- package/dist/grade/command-shared.js +10 -0
- package/dist/grade/run.js +58 -6
- package/dist/grade/targets.js +106 -0
- package/dist/register/create-commands.js +30 -3
- package/dist/register/events.js +1 -1
- package/dist/register/item.js +1 -0
- package/dist/register/maintenance-commands.js +3 -1
- package/dist/register/renumber.js +15 -4
- package/dist/register/section.js +114 -0
- package/dist/register/update.js +18 -0
- package/dist/shared/antigravity-block.js +24 -0
- package/dist/shared/plan-conventions.js +11 -0
- package/dist/shared/provider-scaffold.js +4 -0
- package/dist/shared/specdojo-config.js +5 -4
- package/dist/shared/text.js +8 -0
- package/dist/shared/where-alias.js +2 -2
- package/docs/ja/specdojo/guides/exec-config-guide.md +15 -12
- package/docs/ja/specdojo/guides/exec-operation-guide.md +21 -7
- package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +6 -4
- package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +1 -1
- package/docs/ja/specdojo/guides/register-operation-guide.md +1 -1
- package/docs/ja/specdojo/guides/timeline-design-guide.md +1 -1
- package/docs/ja/specdojo/references/command-reference.md +76 -51
- package/docs/ja/specdojo/references/specdojo-config-reference.md +11 -9
- package/docs/ja/specdojo/rulebooks/dec-rulebook.md +10 -42
- package/docs/ja/specdojo/rulebooks/ntp-rulebook.md +10 -50
- package/docs/ja/specdojo/samples/dec-sample.md +3 -30
- package/docs/ja/specdojo/samples/dss-sample.md +12 -12
- package/docs/ja/specdojo/samples/ntp-sample.md +3 -30
- package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +18 -0
- package/docs/specdojo/schemas/v1/register-events.schema.yaml +1 -0
- package/package.json +1 -1
- package/templates/antigravity/orchestrator.md +7 -0
- package/templates/claude/agents/specdojo-orchestrator.md +7 -0
- package/templates/codex/agents/specdojo-orchestrator.toml +7 -0
- package/templates/codex/orchestrator.md +7 -0
- package/templates/opencode/agents/specdojo-orchestrator.md +7 -0
|
@@ -155,6 +155,8 @@ npx specdojo kata eject --id <id> # 上書きしたいものだけ複
|
|
|
155
155
|
|
|
156
156
|
利用者が規範を変えたいと言った場合にだけ `eject` を提案する。eject したファイルは利用リポジトリの git 管理下に入り、以後そちらが優先される。`exec-template` と `schema` は CLI の版と対応するため eject できない。
|
|
157
157
|
|
|
158
|
+
型を整える schedule では、review の段とは別に、型そのもの(rulebook と sample の組)を grade して確かめる。
|
|
159
|
+
|
|
158
160
|
## タスク実行
|
|
159
161
|
|
|
160
162
|
```bash
|
|
@@ -170,15 +172,20 @@ npx specdojo exec validate --project <project-id>
|
|
|
170
172
|
|
|
171
173
|
失敗して `waiting` になった場合は、個票の `block_reason` と result の申し送りを読み、原因を特定してから再開する。reporter 段だけの再開は `--resume` で行う。
|
|
172
174
|
|
|
175
|
+
人の確定のタスクも claim と complete で記録し、確定したら成果物の `status` を ready に上げる。直すために確定を開き直すときは、`exec reopen` してから直す。
|
|
176
|
+
|
|
173
177
|
## 実行の運び方
|
|
174
178
|
|
|
175
179
|
- `exec run --register` は `--worktree` で流す。同時に流すのは 2〜3 件までとする。親の検証は 1 件ずつ順に流れ、並行が多いと負荷で統合テストが時間切れになる。
|
|
176
180
|
- 時間のかかる run は background で流し、終わりの通知を待つ。途中経過を何度も見に行かない。
|
|
181
|
+
- 裏で完了を待つときは、ログの文字列ではなく、終了コードや lock のファイルで判定する。ログを grep で読む場合はバイナリとして扱われないようにする。
|
|
177
182
|
- grade・`exec run`・build を順に流すときは、待ち合わせのシェルスクリプトを書かず `specdojo exec queue add <queue-id> --step "..."` で予約し、`specdojo exec queue run <queue-id>` を background で流す。進み具合は `exec queue status <queue-id>` か `exec status` の `queues:` で確かめる。止まった予約は原因を直してから同じ `exec queue run` で再開する。
|
|
178
183
|
- プロセスを探す・止めるときに `pkill -f`・`pgrep -f` を使わない。探す文字列を含む自分のシェルにも一致し、自分を止める。
|
|
179
184
|
- 統合の後に `src` が dist より新しくなると、次の run は始まる前に止まる。dist を作り直してから流す。
|
|
180
185
|
- 記帳は `register ... --commit` で行う。登録簿の lifecycle のロックを取るため、実行中の run と取り合わない。
|
|
181
186
|
- 個票の本文を書き換えて普通に commit するのは、統合中の run がないときだけにする(`.git/index.lock` を確かめる)。commit に失敗したら、index に載ったファイルを残さない。残ると次の run の checkpoint が止まる。
|
|
187
|
+
- 実行中の run が残した状態のファイルを、自分の commit に混ぜない。
|
|
188
|
+
- strategy の YAML を道具で書き直したときは、`task_suffix` などの文字列が数値に変わっていないかを schema の検査で確かめる。
|
|
182
189
|
- 保護された設定(agent の定義・名簿・`exec-defaults.yaml`・`package.json` など)は、executor が書き換えると統合の前に止まる。register の完了条件では「案を個票の対応結果に書き、pipeline では報告の `handoff` にも書く」と指示する。「案を result に書く」は executor が result を直接書ける実行形式に限る。反映は利用者の承認のもと feature ブランチで行う。
|
|
183
190
|
- プロジェクトの文書にオーケストレーター向けの運用メモがあれば、作業を始める前に読む。
|
|
184
191
|
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,42 @@ SpecDojo の利用者に影響する変更を記録します。
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.2] - 2026-11-21
|
|
8
|
+
|
|
9
|
+
同梱パッケージ(`@specdojo/docs-lint` 0.5.0、`@specdojo/docs-site` 0.6.0)は変わらないため、公開しません。
|
|
10
|
+
|
|
11
|
+
### 利用者から見て動きが変わる点
|
|
12
|
+
|
|
13
|
+
- Antigravity CLI(`agy`)を起動しなくなりました。consumer plan では、他社の agent や application の中から agy を起動することを Antigravity の FAQ(<https://antigravity.google/docs/faq>)が対象外とし、Additional Terms の Section 6(<https://antigravity.google/terms>)が契約違反としており、アカウントの停止につながるおそれがあるためです。exec・grade・trial、`agent launch`、`orchestrator launch` は、provider が `antigravity` の指定を agy の起動前にエラーで止めます。自動選択と代わりの agent の選択では、agy の member を候補から外します。`init`・`config scaffold`・`devcontainer scaffold` でも antigravity を選べません。agy の対応は 0.10.0 で外します(PJR-NJE4)。
|
|
14
|
+
- 0.9.1 までの `init` で antigravity を選んでいた場合、0.9.2 に上げると agy の member を使う `exec run` などがエラーで止まります。`.specdojo/agent-members.yaml` で agy の member に `disabled: true` を付けるか消し、`.specdojo/exec-defaults.yaml` の `routing` で agy の member を指している箇所を、ほかの provider の member に替えてください。`package.json` の `orch:argon`・`orch:flash` などのスクリプトも使えないため消してください(PJR-NJE4)。
|
|
15
|
+
- 使われていない・移行用の 9 コマンド(`timeline where`・`timeline build`、`exec note`・`exec link`・`exec estimate`・`exec migrate-records`、`grade migrate`、`register migrate`、`config migrate-members`)を非推奨にしました。help と実行時に、代わりの操作と、0.10.0 で消すことを表示します。各コマンドの `where` の別名の警告も、消す版(0.10.0)を示すようにしました(PJR-BSCK)。
|
|
16
|
+
- 実践の型の決定記録(dec)と移行テスト計画(ntp)を非推奨にしました。決定は登録簿の decision に、移行テストの計画は `mtp-rulebook` に記録してください(PJR-HVQZ)。
|
|
17
|
+
|
|
18
|
+
### 追加
|
|
19
|
+
|
|
20
|
+
- `grade run --target kata` に `--kata <name>`(繰り返し指定できる)を足しました。型の名前を並べると、その型の rulebook と sample を 1 回で順に評価し、終わったときに型ごとの結果を一覧にします。`--kata` のときは、rate limit が起きても残りの型を続けます(PJR-SW7T)。
|
|
21
|
+
- `exec run --register <ID> --resume --resume-from executor` に `--resume-note <text>`(繰り返し指定できる)を足しました。再開の前に、run の plan へ再開の指示の節を足し、指示と日時を `pipeline-state.json` の `resume_notes` に残します(PJR-5F1Y)。
|
|
22
|
+
- `register update` に `--section <章の名前>` と `--section-file <path>` を足しました。個票の 1 つの章の本文を、ファイルの中身で差し替えます。`--dry-run` でも、個票に無い章・読めないファイル・見出しを含むファイルはエラーになります(PJR-7KXW)。
|
|
23
|
+
- オーケストレーターの本体に、型を整えるときの grade、人の確定の記録、裏での完了の待ち方、実行中の run の状態のファイルを commit に混ぜないこと、YAML の文字列の型の確かめ方を足しました。`init` が配る provider ごとのテンプレートにも反映されます(PJR-70SS)。
|
|
24
|
+
|
|
25
|
+
### 不具合修正
|
|
26
|
+
|
|
27
|
+
- executor が編集を拒まれたまま、またはプロダクトリポジトリを変えないまま「完了」と報告すると、runner が成功として review へ進めていた問題を修正しました。edit の executor の出力にツールの権限による拒否がある場合と、プロダクトを対象にする項目でプロダクトの worktree に変更が無い場合は、項目を `waiting` にして `block_reason` に理由を残します。「プロダクトの変更なし」は runner の要約と `exec status` に警告として出ます(PJR-QQRH)。
|
|
28
|
+
- 親の検証が時間切れになったとき、vitest などの子孫のプロセスまで止め、出力の pipe を持つプロセスが残っても、runner が止まらずに次の検証へ進むようにしました(PJR-V277)。
|
|
29
|
+
|
|
30
|
+
## [0.9.1] - 2026-11-20
|
|
31
|
+
|
|
32
|
+
同梱パッケージ(`@specdojo/docs-lint` 0.5.0、`@specdojo/docs-site` 0.6.0)は変わらないため、公開しません。
|
|
33
|
+
|
|
34
|
+
### 利用者から見て動きが変わる点
|
|
35
|
+
|
|
36
|
+
- `repos` を宣言した project で opencode の agent を exec から起動するとき、`exec-defaults.yaml` の opencode の `command_template` に `--agent <name>` が必要になりました。許可を渡す agent を決めるためで、無い場合は起動の前に止まります。`specdojo init` が作る雛形には入っています(PJR-08EK)。
|
|
37
|
+
|
|
38
|
+
### 不具合修正
|
|
39
|
+
|
|
40
|
+
- `repos` を宣言した project で、exec の opencode の executor がプロダクトリポジトリの worktree を編集できなかった問題を修正しました。runner は起動時の `OPENCODE_CONFIG_CONTENT` で、その run のプロダクトの worktree だけに `external_directory` と `edit` の許可を渡します。agent の定義や `opencode.json` を書き換える必要はありません。`orchestrator launch` の `edit` の許可も、起動場所からの相対パスにそろえました(PJR-08EK)。
|
|
41
|
+
- CodeQL が指摘した 5 か所を直しました。`deliverable trash` は、記号を含む `local_id` でも別の成果物の `path:` を書き換えません。exec の変更範囲の推定は、長い個票の本文でも遅くなりません。プロダクトリポジトリの統合の記録と dashboard の表は、`\` で終わるセルでも列がずれません(PJR-A77M)。
|
|
42
|
+
|
|
7
43
|
## [0.9.0] - 2026-11-20
|
|
8
44
|
|
|
9
45
|
同梱パッケージは `@specdojo/docs-lint` 0.5.0 と `@specdojo/docs-site` 0.6.0 を同時に公開します。動作に必要な Node.js は 22.17 以上です。
|
package/README.md
CHANGED
|
@@ -105,19 +105,19 @@ npm run orch:opus
|
|
|
105
105
|
| `claude` | `.claude/agents/specdojo-orchestrator.md` | `npm run orch:opus` ほか |
|
|
106
106
|
| `opencode` | `.opencode/agents/specdojo-orchestrator.md` | `npm run orch:opencode` |
|
|
107
107
|
| `codex` | `.specdojo/codex/orchestrator.md` | `npm run orch:sol` ほか |
|
|
108
|
-
| `antigravity` |
|
|
108
|
+
| `antigravity` | 0.9.2 から使えない(下記) | - |
|
|
109
109
|
|
|
110
110
|
各設定を個別に管理したい場合は、後述の「設定を個別に行う場合」にある `config init` と `config scaffold` を使います。
|
|
111
111
|
|
|
112
|
-
Antigravity CLI
|
|
112
|
+
0.9.2 から、SpecDojo は Antigravity CLI(`agy`)を起動しません。consumer plan では、他社の agent や application の中から agy を起動することを [Antigravity の FAQ](https://antigravity.google/docs/faq) が対象外とし、[Additional Terms](https://antigravity.google/terms) の Section 6 が契約違反としているためです。exec・grade などの agent 実行、`agent launch`・`orchestrator launch` は provider が `antigravity` の指定を agy の起動前にエラーで止め、`init`・`config scaffold`・`devcontainer scaffold` でも `antigravity` は選べません。0.9.1 の `init` で antigravity を選んだ場合は、`.specdojo/agent-members.yaml` で agy の member に `disabled: true` を付けるか削除し、ほかの provider を使ってください。
|
|
113
|
+
|
|
114
|
+
次の Antigravity CLI のグローバル設定は 0.9.2 から使えません(`config scaffold --provider antigravity` はエラーになります)。0.9.1 までは、Antigravity CLI を無人実行する場合に利用者のグローバル設定へ permission rule を追加していました。この設定はすべてのリポジトリに効くため、必ず先に差分を確認してから適用していました。
|
|
113
115
|
|
|
114
116
|
```sh
|
|
115
117
|
npx specdojo config scaffold --provider antigravity --global --dry-run
|
|
116
118
|
npx specdojo config scaffold --provider antigravity --global
|
|
117
119
|
```
|
|
118
120
|
|
|
119
|
-
実適用では既存設定を残し、変更前のファイルをバックアップします。追加する allow は `git status` / `diff` / `log` / `show` の読み取り操作だけです。
|
|
120
|
-
|
|
121
121
|
#### Dev Container を使う場合(任意)
|
|
122
122
|
|
|
123
123
|
利用環境として Dev Container を使う場合は、オーケストレーターの配置に加えて次のコマンドを実行すると、指定した provider の CLI が組み込まれた `.devcontainer/` を生成できます。
|
package/dist/commands/agent.js
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { productRootsFromEnvironment } from "../exec/task-repos.js";
|
|
3
|
-
import { runOrchestratorLaunch } from "./orchestrator.js";
|
|
1
|
+
import { assertProviderLaunchAllowed } from "../shared/antigravity-block.js";
|
|
4
2
|
import { AGENT_RUN_RATE_LIMIT_EXIT_CODE, runAgentPlan, writeAgentOutput, } from "../exec/agent-plan.js";
|
|
5
3
|
export { AGENT_RUN_RATE_LIMIT_EXIT_CODE, resolveAgentMember, resolveAgentCommand, readAgentPlan, writeAgentOutput, runAgentPlan, } from "../exec/agent-plan.js";
|
|
4
|
+
/**
|
|
5
|
+
* `agent launch` only ever wrapped agy, and 0.9.1 `init` wrote command templates that call it.
|
|
6
|
+
* Since 0.9.2 it fails before spawning anything so those existing configurations stop here.
|
|
7
|
+
*/
|
|
8
|
+
export function runAgentLaunch(options) {
|
|
9
|
+
assertProviderLaunchAllowed(options.provider, "agent launch");
|
|
10
|
+
throw new Error(`agent launch supports no provider other than antigravity, which is no longer launched: ${options.provider}`);
|
|
11
|
+
}
|
|
6
12
|
export function registerAgentCommands(program) {
|
|
7
13
|
const agent = program
|
|
8
14
|
.command("agent", { hidden: true })
|
|
9
15
|
.description("Run a plan with a specific agent");
|
|
10
16
|
agent
|
|
11
17
|
.command("launch", { hidden: true })
|
|
12
|
-
.description("
|
|
13
|
-
.requiredOption("--provider <name>", "Provider CLI (antigravity)")
|
|
14
|
-
.
|
|
15
|
-
.argument("[providerArgs...]", "
|
|
16
|
-
.action(
|
|
18
|
+
.description("Former agy launcher; refuses to launch Antigravity since 0.9.2")
|
|
19
|
+
.requiredOption("--provider <name>", "Provider CLI (antigravity is no longer launched)")
|
|
20
|
+
.option("--role <role>", "Pipeline role (edit|review|report); ignored")
|
|
21
|
+
.argument("[providerArgs...]", "Provider arguments after --")
|
|
22
|
+
.action((_providerArgs, options) => {
|
|
17
23
|
try {
|
|
18
|
-
|
|
19
|
-
throw new Error("agent launch requires antigravity and a pipeline role (edit|review|report)");
|
|
20
|
-
}
|
|
21
|
-
const cwd = process.cwd();
|
|
22
|
-
const args = antigravitySessionArguments({
|
|
23
|
-
role: antigravityRole(options.role),
|
|
24
|
-
cwd,
|
|
25
|
-
repoRoots: productRootsFromEnvironment(process.env).map((repo) => repo.path),
|
|
26
|
-
providerArgs,
|
|
27
|
-
});
|
|
28
|
-
process.exitCode = await runOrchestratorLaunch({
|
|
29
|
-
command: "agy",
|
|
30
|
-
args,
|
|
31
|
-
cwd,
|
|
32
|
-
env: { ...process.env },
|
|
33
|
-
});
|
|
24
|
+
runAgentLaunch(options);
|
|
34
25
|
}
|
|
35
26
|
catch (error) {
|
|
36
27
|
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
package/dist/commands/init.js
CHANGED
|
@@ -13,7 +13,9 @@ import { generateDerivedViewFiles } from "../register/register.js";
|
|
|
13
13
|
import { defaultWorktreeBase, projectGitignoreLayout, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
14
14
|
import { ensureGitignore, formatGitignoreReport, gitignorePatternsForLayouts, } from "../shared/specdojo-gitignore.js";
|
|
15
15
|
import { specdojoPackageRootDir } from "../shared/package-paths.js";
|
|
16
|
-
|
|
16
|
+
import { AntigravityBlockedError, isBlockedProvider } from "../shared/antigravity-block.js";
|
|
17
|
+
// antigravity is intentionally absent: agy is never launched since 0.9.2 (PJR-NJE4).
|
|
18
|
+
const PROVIDERS = ["claude", "codex", "opencode", "copilot"];
|
|
17
19
|
const PARENT_VALIDATION_SCRIPTS = {
|
|
18
20
|
"lint-ts": "lint:ts",
|
|
19
21
|
"lint-fm": "lint:fm",
|
|
@@ -56,6 +58,9 @@ function parseProviders(value) {
|
|
|
56
58
|
.map((item) => item.trim())
|
|
57
59
|
.filter(Boolean)),
|
|
58
60
|
];
|
|
61
|
+
if (providers.some((provider) => isBlockedProvider(provider))) {
|
|
62
|
+
throw new AntigravityBlockedError("init cannot select provider antigravity");
|
|
63
|
+
}
|
|
59
64
|
const unknown = providers.filter((provider) => !PROVIDERS.includes(provider));
|
|
60
65
|
if (unknown.length > 0) {
|
|
61
66
|
throw new Error(`Unknown provider: ${unknown.join(", ")}. Available: ${PROVIDERS.join(", ")}`);
|
|
@@ -352,7 +357,7 @@ function writeExecConfiguration(repoRoot, packageRoot, providers, dryRun) {
|
|
|
352
357
|
const members = memberTemplate.members.filter((member) => member.provider && selected.has(member.provider));
|
|
353
358
|
const aliases = selectAliases(memberTemplate.aliases ?? [], new Set(members.map((member) => member.nickname)));
|
|
354
359
|
// normal の段(medium・easy と全 reporter)と expert の段(hard)を provider ごとに選ぶ。
|
|
355
|
-
// expert の段がない provider(opencode
|
|
360
|
+
// expert の段がない provider(opencode など)は hard も normal の段を使う。
|
|
356
361
|
const pairs = providers.map((provider) => {
|
|
357
362
|
const executor = members.find((member) => member.provider === provider &&
|
|
358
363
|
member.stage_role === "executor" &&
|
|
@@ -575,9 +580,7 @@ export async function runInit(options, deps) {
|
|
|
575
580
|
? "orch:opus"
|
|
576
581
|
: firstProvider === "codex"
|
|
577
582
|
? "orch:sol"
|
|
578
|
-
: firstProvider
|
|
579
|
-
? "orch:flash"
|
|
580
|
-
: `orch:${firstProvider}`;
|
|
583
|
+
: `orch:${firstProvider}`;
|
|
581
584
|
process.stdout.write("Next steps:\n" +
|
|
582
585
|
(firstProvider
|
|
583
586
|
? ` 1. Run npm run ${script} and create the first register item.\n`
|
|
@@ -2,7 +2,8 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
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
|
-
import {
|
|
5
|
+
import { assertProviderLaunchAllowed } from "../shared/antigravity-block.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,95 +28,18 @@ function resolveOrchestratorProjectId(config, projectOption, env) {
|
|
|
30
28
|
return projectId;
|
|
31
29
|
}
|
|
32
30
|
function opencodeAgentName(args) {
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
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) {
|
|
38
|
+
assertProviderLaunchAllowed(options.provider, "orchestrator launch");
|
|
110
39
|
const env = { ...(options.env ?? process.env) };
|
|
111
40
|
const args = [...options.providerArgs];
|
|
112
|
-
if (options.provider === "
|
|
113
|
-
|
|
114
|
-
role: "orchestrator",
|
|
115
|
-
cwd: options.cwd,
|
|
116
|
-
repoRoots: options.repoRoots,
|
|
117
|
-
providerArgs: args,
|
|
118
|
-
}));
|
|
119
|
-
}
|
|
120
|
-
else if (options.provider === "opencode" && options.repoRoots.length > 0) {
|
|
121
|
-
env.OPENCODE_CONFIG_CONTENT = inlineOpenCodeConfig(env.OPENCODE_CONFIG_CONTENT, opencodeAgentName(args), options.repoRoots);
|
|
41
|
+
if (options.provider === "opencode" && options.repoRoots.length > 0) {
|
|
42
|
+
env[OPENCODE_CONFIG_CONTENT_ENV] = opencodeExtraRootConfig(env[OPENCODE_CONFIG_CONTENT_ENV], opencodeAgentName(args), options.repoRoots, options.cwd);
|
|
122
43
|
}
|
|
123
44
|
else {
|
|
124
45
|
args.push(...agentExtraRootArguments(options.provider, options.repoRoots));
|
|
@@ -131,6 +52,8 @@ export function buildOrchestratorLaunch(options) {
|
|
|
131
52
|
};
|
|
132
53
|
}
|
|
133
54
|
export function resolveOrchestratorLaunch(options) {
|
|
55
|
+
// Refuse before reading any configuration so a blocked provider never reaches spawn.
|
|
56
|
+
assertProviderLaunchAllowed(options.provider, "orchestrator launch");
|
|
134
57
|
const env = options.env ?? process.env;
|
|
135
58
|
const rootDir = specdojoRootDir();
|
|
136
59
|
const configuredRoot = env[ORCHESTRATOR_CONFIG_ROOT_ENV]?.trim();
|
|
@@ -214,7 +137,7 @@ export function registerOrchestratorCommands(program) {
|
|
|
214
137
|
orchestrator
|
|
215
138
|
.command("launch")
|
|
216
139
|
.description("Launch a provider CLI and allow only repositories declared by the project")
|
|
217
|
-
.requiredOption("--provider <name>", "Provider CLI (
|
|
140
|
+
.requiredOption("--provider <name>", "Provider CLI (claude|codex|copilot|opencode; antigravity is refused)")
|
|
218
141
|
.option("--project <projectId>", "Project id in specdojo.config.json")
|
|
219
142
|
.argument("[providerArgs...]", "Provider arguments; put them after --")
|
|
220
143
|
.action(async (providerArgs, opts) => {
|
package/dist/dashboard/shared.js
CHANGED
|
@@ -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
|
|
13
|
+
return escapeMarkdownTableCell(truncated);
|
|
14
14
|
}
|
|
@@ -72,12 +72,12 @@ export function registerTimelineCommands(program) {
|
|
|
72
72
|
registerDeprecatedWhereAlias(tml, printTimelinePaths);
|
|
73
73
|
const bcmd = tml
|
|
74
74
|
.command("build")
|
|
75
|
-
.description("Deprecated:
|
|
75
|
+
.description("Deprecated: use dashboard build; move domains and dependencies to register epics (will be removed in 0.10.0)");
|
|
76
76
|
addProjectOption(bcmd);
|
|
77
77
|
bcmd.option("--dry-run", "Print generated content to stdout without writing", false);
|
|
78
78
|
bcmd.action((opts) => {
|
|
79
79
|
try {
|
|
80
|
-
warnDeprecated("timeline build", "Use dashboard build; move domains and dependencies to register epics.");
|
|
80
|
+
warnDeprecated("timeline build", "Use dashboard build; move domains and dependencies to register epics. This command will be removed in 0.10.0.");
|
|
81
81
|
const { timelinePath, ...paths } = resolveTimelinePaths(opts);
|
|
82
82
|
const result = buildTimeline({ timelinePath, ...paths });
|
|
83
83
|
for (const warning of result.warnings)
|
|
@@ -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++) {
|
|
@@ -7,7 +7,7 @@ export function registerDevcontainerCommands(program) {
|
|
|
7
7
|
dc.command("scaffold")
|
|
8
8
|
.description("Scaffold .devcontainer/ configuration for the repository")
|
|
9
9
|
.option("--preset <name>", "Apply a bundled preset (minimal|recommended|full)")
|
|
10
|
-
.option("--provider <names>", "Comma-separated list of agent providers to install (e.g. claude,codex,opencode
|
|
10
|
+
.option("--provider <names>", "Comma-separated list of agent providers to install (e.g. claude,codex,opencode)", "")
|
|
11
11
|
.option("--editor <names>", "Comma-separated list of editors to install and configure (emacs,vim)", "")
|
|
12
12
|
.option("--ollama", "Add Ollama connection settings", false)
|
|
13
13
|
.option("--cron", "Add cron support", false)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
+
import { assertProviderLaunchAllowed } from "../shared/antigravity-block.js";
|
|
4
5
|
export const DEVCONTAINER_PRESETS = ["minimal", "recommended", "full"];
|
|
5
6
|
const RECOMMENDED_VSCODE_EXTENSIONS = [
|
|
6
7
|
"mhutchie.git-graph",
|
|
@@ -153,6 +154,10 @@ export function generateSshConfigSample(ports) {
|
|
|
153
154
|
}
|
|
154
155
|
export async function runDevcontainerScaffold(opts) {
|
|
155
156
|
const { packageRoot, repoRoot, workspaceName: workspaceNameOverride, preset, providers, editors, ollama, cron, tmux, force, dryRun, } = opts;
|
|
157
|
+
// agy is never launched since 0.9.2, so refuse before writing any install step or volume for it.
|
|
158
|
+
for (const provider of providers) {
|
|
159
|
+
assertProviderLaunchAllowed(provider, "devcontainer scaffold cannot add provider antigravity");
|
|
160
|
+
}
|
|
156
161
|
if (preset !== undefined && !DEVCONTAINER_PRESETS.includes(preset)) {
|
|
157
162
|
throw new Error(`Unknown Dev Container preset: ${preset}. Available: ${DEVCONTAINER_PRESETS.join(", ")}`);
|
|
158
163
|
}
|
|
@@ -331,7 +336,7 @@ fi`);
|
|
|
331
336
|
devcontainer.containerEnv["LOCAL_OPENAI_BASE_URL"] = "http://host.docker.internal:11434/v1";
|
|
332
337
|
}
|
|
333
338
|
// providers の処理
|
|
334
|
-
const knownProviders = new Set(["claude", "codex", "opencode"
|
|
339
|
+
const knownProviders = new Set(["claude", "codex", "opencode"]);
|
|
335
340
|
for (const provider of providers) {
|
|
336
341
|
if (!knownProviders.has(provider)) {
|
|
337
342
|
process.stdout.write(`Warning: unknown provider "${provider}"\n`);
|
|
@@ -357,10 +362,6 @@ fi`);
|
|
|
357
362
|
// 本リポジトリで設定を確かめている opencode の npm パッケージ(opencode-ai)を使う。
|
|
358
363
|
extraScripts.push("sudo npm install -g opencode-ai@latest");
|
|
359
364
|
}
|
|
360
|
-
else if (provider === "antigravity") {
|
|
361
|
-
devcontainer.mounts.push(`source=${volumeName("antigravity")},target=/home/node/.config/antigravity,type=volume`);
|
|
362
|
-
extraScripts.push('if ! curl -fsSL https://antigravity.google/cli/install.sh | bash; then\n echo "Warning: Antigravity CLI installer failed."\nfi');
|
|
363
|
-
}
|
|
364
365
|
}
|
|
365
366
|
if (extraScripts.length > 0) {
|
|
366
367
|
postCreateScript = postCreateScript.replace("npm install", extraScripts.join("\n\n") + "\n\nnpm install");
|
|
@@ -7,6 +7,7 @@ import { resolveParentValidationConcurrency, resolveParentValidationAssignments,
|
|
|
7
7
|
import { resolveCommitHookSkips } from "./commit-hook-skips.js";
|
|
8
8
|
import { configureIndexLockWait, DEFAULT_INDEX_LOCK_WAIT_MS } from "../shared/git.js";
|
|
9
9
|
import { resolvePostIntegrationEntries } from "./post-integration.js";
|
|
10
|
+
import { assertProviderLaunchAllowed } from "../shared/antigravity-block.js";
|
|
10
11
|
const PLACEHOLDER_PATTERN = /\{([a-z][a-z0-9_]*)\}/g;
|
|
11
12
|
const BUILTIN_VARIABLE_NAMES = new Set(["nickname", "mode", "proficiency"]);
|
|
12
13
|
// Mirror of the nickname pattern in docs/specdojo/schemas/v1/agent-members.schema.yaml.
|
|
@@ -67,6 +68,9 @@ function buildCommandVariables(provider, member, params) {
|
|
|
67
68
|
// not runnable by exec run). Throws when a template exists but cannot be fully expanded,
|
|
68
69
|
// so a broken definition surfaces as an error instead of launching a malformed command.
|
|
69
70
|
export function resolveMemberCommand(config, member) {
|
|
71
|
+
// Every launch path (named, automatic, fallback) expands the command here, so refusing an
|
|
72
|
+
// Antigravity member before building any command keeps agy from ever being spawned.
|
|
73
|
+
assertProviderLaunchAllowed(member.provider, `Cannot launch member ${member.nickname}`);
|
|
70
74
|
// Require provider opt-in even for an explicit member command: otherwise a frontier
|
|
71
75
|
// member could silently inherit ordinary defaults or bypass the missing-tier error.
|
|
72
76
|
if (member.proficiency === "frontier" &&
|
package/dist/exec/commands.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { registerDeprecatedWhereAlias } from "../shared/where-alias.js";
|
|
2
|
+
import { warnDeprecated } from "../shared/deprecation.js";
|
|
2
3
|
import { Option } from "commander";
|
|
3
4
|
import { existsSync } from "node:fs";
|
|
4
5
|
import { join, resolve as pathResolve } from "node:path";
|
|
5
6
|
import { validateCatalogLocalIds, validateRulebookKata } from "../catalog/build.js";
|
|
7
|
+
import { resolveRegisterPaths } from "../register/core.js";
|
|
8
|
+
import { loadRegisterItemDocs } from "../register/item.js";
|
|
6
9
|
import { commonViewpointsPath, scaffoldViewpoints } from "../review/plan.js";
|
|
7
10
|
import { runProviderScaffold, specdojoPackageRootDir } from "../shared/provider-scaffold.js";
|
|
8
|
-
import { assertValidActor, getProjectViewpointsPath, getProjectRoutinesPath, loadConfig, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
11
|
+
import { assertValidActor, getProjectRegisterPath, getProjectViewpointsPath, getProjectRoutinesPath, loadConfig, specdojoRootDir, } from "../shared/specdojo-config.js";
|
|
9
12
|
import { formatLocalConfigLines } from "../shared/local-config.js";
|
|
10
13
|
import { DEFAULT_EVENT_MESSAGES, KNOWN_OWNER_LABELS, KNOWN_OWNER_LABELS_TEXT, addCommonAddOptions, addForceOption, addLockOptions, addOwnerOptions, addProjectOptions, addTakeOverOption, ensureActorCanClaimNext, findRosterMember, loadRosterForOpts, loadValidatedExecState, parseApproach, parseTaskMode, printCommandError, resolveClaimOwner, resolveForceOverride, resolveProjectContext, resolveProjectId, resolveSchedulerStrategy, runLockedEventCommand, runReleaseAllBlocked, runSimpleEventCommand, scaffoldClaimResult, } from "./core.js";
|
|
11
14
|
import { acquireSchedulerLock, canBlockTask, canCancelTask, canClaimTask, canCompleteTask, canReleaseTask, canReopenTask, canUnblockTask, claimOwnerOf, computeReadyIds, readAllEventFiles, releaseSchedulerLock, schedulerLockPath, writeEventFile, } from "./events.js";
|
|
15
|
+
import { noProductChangeWarnings } from "./executor-outcome-checks.js";
|
|
12
16
|
import { registerExecHandoffCommands } from "./handoff.js";
|
|
13
17
|
import { registerRecordMigrationCommand } from "./migrate-records.js";
|
|
14
18
|
import { archivePlan, buildInPlaceStem, generateDeliverablePlan, generateSinglePlan, resolveDeliverableTarget, stemFromPlanPath, } from "./plans.js";
|
|
@@ -101,8 +105,25 @@ export function registerExecCommands(program) {
|
|
|
101
105
|
"link",
|
|
102
106
|
"estimate",
|
|
103
107
|
];
|
|
108
|
+
const deprecatedEventCommands = {
|
|
109
|
+
note: {
|
|
110
|
+
description: "Deprecated: record notes in tickets or execution results instead (will be removed in 0.10.0)",
|
|
111
|
+
migration: "Record notes in tickets or execution results instead. This command will be removed in 0.10.0.",
|
|
112
|
+
},
|
|
113
|
+
link: {
|
|
114
|
+
description: "Deprecated: declare dependencies in tickets (depends_on) or catalog instead (will be removed in 0.10.0)",
|
|
115
|
+
migration: "Declare dependencies in tickets (depends_on) or catalog instead. This command will be removed in 0.10.0.",
|
|
116
|
+
},
|
|
117
|
+
estimate: {
|
|
118
|
+
description: "Deprecated: manage estimates and difficulty in register tickets instead (will be removed in 0.10.0)",
|
|
119
|
+
migration: "Manage estimates and difficulty in register tickets instead. This command will be removed in 0.10.0.",
|
|
120
|
+
},
|
|
121
|
+
};
|
|
104
122
|
for (const t of types) {
|
|
105
|
-
const
|
|
123
|
+
const deprecation = deprecatedEventCommands[t];
|
|
124
|
+
const cmd = exec
|
|
125
|
+
.command(t)
|
|
126
|
+
.description(deprecation ? deprecation.description : `Write ${t} event JSON into exec/events/ (UTC)`);
|
|
106
127
|
addCommonAddOptions(cmd, {
|
|
107
128
|
requireTask: t !== "release" && t !== "complete",
|
|
108
129
|
msgDefault: DEFAULT_EVENT_MESSAGES[t],
|
|
@@ -130,7 +151,12 @@ export function registerExecCommands(program) {
|
|
|
130
151
|
});
|
|
131
152
|
}
|
|
132
153
|
else {
|
|
133
|
-
cmd.action((opts) =>
|
|
154
|
+
cmd.action((opts) => {
|
|
155
|
+
if (deprecation) {
|
|
156
|
+
warnDeprecated(`exec ${t}`, deprecation.migration);
|
|
157
|
+
}
|
|
158
|
+
runSimpleEventCommand(opts, t);
|
|
159
|
+
});
|
|
134
160
|
}
|
|
135
161
|
}
|
|
136
162
|
const vcmd = exec
|
|
@@ -510,7 +536,7 @@ export function registerExecCommands(program) {
|
|
|
510
536
|
scaffoldCmd.option("--force", "Overwrite existing files", false);
|
|
511
537
|
scaffoldCmd.option("--provider <name>", "Copy the provider's agent/settings templates (templates/<name>) into the repository");
|
|
512
538
|
scaffoldCmd.option("--dry-run", "Show planned files without writing", false);
|
|
513
|
-
scaffoldCmd.option("--global", "Merge provider permissions into user-level settings (currently
|
|
539
|
+
scaffoldCmd.option("--global", "Merge provider permissions into user-level settings (no provider currently supports it)", false);
|
|
514
540
|
scaffoldCmd.action(async (opts) => {
|
|
515
541
|
try {
|
|
516
542
|
if (opts.global && !opts.provider) {
|
|
@@ -588,6 +614,7 @@ export function registerExecCommands(program) {
|
|
|
588
614
|
const byMsg = filterBy ? ` for ${filterBy}` : "";
|
|
589
615
|
process.stdout.write(`No ${filterState} tasks${byMsg}.\n`);
|
|
590
616
|
writeActiveQueueSummary(executionPath);
|
|
617
|
+
writeNoProductChangeWarnings(opts.project, snapshot);
|
|
591
618
|
exitWithCode(true);
|
|
592
619
|
return;
|
|
593
620
|
}
|
|
@@ -612,6 +639,7 @@ export function registerExecCommands(program) {
|
|
|
612
639
|
process.stdout.write(` ${padEndDisplay(r.taskId, taskWidth)} ${padEndDisplay(r.name, nameWidth)} ${padEndDisplay(r.by, byWidth)} ${r.ts}\n`);
|
|
613
640
|
}
|
|
614
641
|
writeActiveQueueSummary(executionPath);
|
|
642
|
+
writeNoProductChangeWarnings(opts.project, snapshot);
|
|
615
643
|
exitWithCode(true);
|
|
616
644
|
}
|
|
617
645
|
catch (error) {
|
|
@@ -620,3 +648,25 @@ export function registerExecCommands(program) {
|
|
|
620
648
|
});
|
|
621
649
|
registerDeprecatedWhereAlias(exec, printExecPaths);
|
|
622
650
|
}
|
|
651
|
+
// PJR-QQRH: keep runs blocked for missing product changes visible in `exec status`, whatever
|
|
652
|
+
// state filter is selected. Register items are read only when the project declares a register.
|
|
653
|
+
function writeNoProductChangeWarnings(project, snapshot) {
|
|
654
|
+
const projectId = resolveProjectId({ project });
|
|
655
|
+
const projectConfig = loadConfig().config?.projects[projectId];
|
|
656
|
+
const registerItems = projectConfig && getProjectRegisterPath(projectConfig)
|
|
657
|
+
? loadRegisterItemDocs(resolveRegisterPaths({ project: projectId }).projectRegisterPath).map((doc) => ({ id: doc.id, status: doc.item.status, blockReason: doc.blockReason }))
|
|
658
|
+
: [];
|
|
659
|
+
const warnings = noProductChangeWarnings({
|
|
660
|
+
registerItems,
|
|
661
|
+
tasks: Object.entries(snapshot.tasks).map(([taskId, current]) => ({
|
|
662
|
+
taskId,
|
|
663
|
+
state: current.state,
|
|
664
|
+
...(current.last_msg ? { lastMsg: current.last_msg } : {}),
|
|
665
|
+
})),
|
|
666
|
+
});
|
|
667
|
+
if (warnings.length === 0)
|
|
668
|
+
return;
|
|
669
|
+
process.stdout.write("\nwarnings (no product changes):\n");
|
|
670
|
+
for (const line of warnings)
|
|
671
|
+
process.stdout.write(` ${line}\n`);
|
|
672
|
+
}
|