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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { normalizeRegisterInput } from "./input.js";
|
|
2
|
+
import { validateSectionFile } from "./section.js";
|
|
2
3
|
import { existsSync, mkdirSync } from "node:fs";
|
|
3
4
|
import { join } from "node:path";
|
|
4
5
|
import { inlineCodeAnglePlaceholders } from "../shared/text.js";
|
|
@@ -287,6 +288,8 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
287
288
|
updateCmd.option("--commit-type <type>", `Update Conventional Commits type (${VALID_COMMIT_TYPES.join(" | ")}; use - to remove)`);
|
|
288
289
|
updateCmd.option("--commit-scope <scope>", "Update Conventional Commits scope; use - to remove");
|
|
289
290
|
updateCmd.option("--topic <topic>", "Update the topic slug in the ticket filename and document ID");
|
|
291
|
+
updateCmd.option("--section <name>", "Name of the ticket section to replace (without heading numbers, e.g., '完了条件')");
|
|
292
|
+
updateCmd.option("--section-file <path>", "Path to a markdown file containing the new section body");
|
|
290
293
|
updateCmd.option("--by <actor>", "Actor recorded in the append-only register event");
|
|
291
294
|
updateCmd.option("--reason <text>", "Reason recorded in the append-only register event");
|
|
292
295
|
updateCmd.option("--dry-run", "Print change without writing", false);
|
|
@@ -320,9 +323,11 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
320
323
|
"commitType",
|
|
321
324
|
"commitScope",
|
|
322
325
|
"topic",
|
|
326
|
+
"section",
|
|
327
|
+
"sectionFile",
|
|
323
328
|
].some((key) => opts[key] !== undefined);
|
|
324
329
|
if (!hasUpdates) {
|
|
325
|
-
throw new Error("At least one field option must be specified (--track, --domain, --title, --description, --priority, --difficulty, --owner, --due, --start-on, --conclusion, --block-reason, --autopilot, --approach, --target, --source, --input, --from, --depends-on, --commit-type, --commit-scope, --topic)");
|
|
330
|
+
throw new Error("At least one field option must be specified (--track, --domain, --title, --description, --priority, --difficulty, --owner, --due, --start-on, --conclusion, --block-reason, --autopilot, --approach, --target, --source, --input, --from, --depends-on, --commit-type, --commit-scope, --topic, --section, --section-file)");
|
|
326
331
|
}
|
|
327
332
|
if (opts.priority !== undefined &&
|
|
328
333
|
!VALID_PRIORITIES.includes(opts.priority)) {
|
|
@@ -349,6 +354,25 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
349
354
|
if (topic !== undefined && !registerTopicPattern.test(topic)) {
|
|
350
355
|
throw new Error(`Invalid topic: "${topic}". Must use lowercase letters, numbers, and single hyphens`);
|
|
351
356
|
}
|
|
357
|
+
if ((opts.section !== undefined) !== (opts.sectionFile !== undefined)) {
|
|
358
|
+
throw new Error("--section and --section-file must be specified together");
|
|
359
|
+
}
|
|
360
|
+
const sectionName = opts.section?.trim();
|
|
361
|
+
if (opts.section !== undefined && sectionName === "") {
|
|
362
|
+
throw new Error("Section name must not be empty");
|
|
363
|
+
}
|
|
364
|
+
const sectionFilePath = opts.sectionFile?.trim();
|
|
365
|
+
if (opts.sectionFile !== undefined && sectionFilePath === "") {
|
|
366
|
+
throw new Error("Section file path must not be empty");
|
|
367
|
+
}
|
|
368
|
+
let sectionUpdate;
|
|
369
|
+
if (sectionName !== undefined && sectionFilePath !== undefined) {
|
|
370
|
+
const sectionContent = validateSectionFile(sectionFilePath);
|
|
371
|
+
sectionUpdate = {
|
|
372
|
+
name: sectionName,
|
|
373
|
+
content: sectionContent,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
352
376
|
const blockReason = opts.blockReason?.trim();
|
|
353
377
|
if (blockReason !== undefined && blockReason === "") {
|
|
354
378
|
throw new Error("Block reason must not be empty; use - to remove it");
|
|
@@ -607,6 +631,7 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
607
631
|
: {}),
|
|
608
632
|
...(opts.title !== undefined ? { title: opts.title } : {}),
|
|
609
633
|
...(opts.description !== undefined ? { description: opts.description } : {}),
|
|
634
|
+
...(sectionUpdate !== undefined ? { section: sectionUpdate } : {}),
|
|
610
635
|
actor: registerEventActor(opts),
|
|
611
636
|
reason: opts.reason?.trim() || "",
|
|
612
637
|
});
|
|
@@ -619,9 +644,10 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
619
644
|
updated,
|
|
620
645
|
...(inputs !== undefined ? { inputs } : {}),
|
|
621
646
|
dryRun: opts.dryRun,
|
|
622
|
-
action: "fields updated",
|
|
647
|
+
action: sectionUpdate ? `section "${sectionUpdate.name}" updated` : "fields updated",
|
|
623
648
|
...(opts.title !== undefined ? { title: opts.title } : {}),
|
|
624
649
|
...(opts.description !== undefined ? { description: opts.description } : {}),
|
|
650
|
+
...(sectionUpdate !== undefined ? { section: sectionUpdate } : {}),
|
|
625
651
|
...(blockReasonUpdates || autopilotUpdates || Object.keys(approachTargetUpdates).length > 0
|
|
626
652
|
? {
|
|
627
653
|
fieldUpdates: {
|
|
@@ -633,7 +659,8 @@ export function registerUpdateCommand(reg, dependencies) {
|
|
|
633
659
|
: {}),
|
|
634
660
|
eventAction: "update",
|
|
635
661
|
eventActor: registerEventActor(opts),
|
|
636
|
-
eventReason: opts.reason?.trim() ||
|
|
662
|
+
eventReason: opts.reason?.trim() ||
|
|
663
|
+
(sectionUpdate ? `section "${sectionUpdate.name}" updated` : "fields updated"),
|
|
637
664
|
});
|
|
638
665
|
return { id: item.id, title: updated.title };
|
|
639
666
|
});
|
package/dist/register/events.js
CHANGED
|
@@ -196,7 +196,7 @@ export function validateRegisterEventShape(value, source) {
|
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
if (typeof change.field !== "string" ||
|
|
199
|
-
![...REGISTER_EVENT_FIELDS, "id"].includes(change.field)) {
|
|
199
|
+
![...REGISTER_EVENT_FIELDS, "id", "section"].includes(change.field)) {
|
|
200
200
|
error(`changes[${index}].field is invalid`);
|
|
201
201
|
}
|
|
202
202
|
if (typeof change.from !== "string")
|
package/dist/register/item.js
CHANGED
|
@@ -331,6 +331,7 @@ export function loadRegisterItemDocs(projectRegisterPath) {
|
|
|
331
331
|
filename: entry.name,
|
|
332
332
|
item: parsed.item,
|
|
333
333
|
hasRegisterFields: parsed.hasRegisterFields,
|
|
334
|
+
blockReason: parsed.blockReason,
|
|
334
335
|
});
|
|
335
336
|
}
|
|
336
337
|
return docs.sort((a, b) => compareRegisterItemIds(a.id, b.id));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { warnDeprecated } from "../shared/deprecation.js";
|
|
1
2
|
import { existsSync, writeFileSync } from "node:fs";
|
|
2
3
|
import { collectRegisterHistoryEvents, formatRegisterHistoryEvents } from "./history.js";
|
|
3
4
|
import { createGitTimestampResolver, planRegisterTimestampMigration, summarizeTimestampMigration, } from "./migrate-timestamps.js";
|
|
@@ -12,11 +13,12 @@ export function registerMaintenanceCommands(reg, dependencies) {
|
|
|
12
13
|
// --- migrate ---
|
|
13
14
|
const migrateCmd = reg
|
|
14
15
|
.command("migrate")
|
|
15
|
-
.description("
|
|
16
|
+
.description("Deprecated: legacy register migration is no longer needed; individual ticket files and external events are standard (will be removed in 0.10.0)");
|
|
16
17
|
addProjectOption(migrateCmd);
|
|
17
18
|
migrateCmd.option("--dry-run", "Validate and print the migration summary without writing", false);
|
|
18
19
|
migrateCmd.action((opts) => {
|
|
19
20
|
try {
|
|
21
|
+
warnDeprecated("register migrate", "Legacy register migration is no longer needed as individual ticket files and external events are standard. This command will be removed in 0.10.0.");
|
|
20
22
|
const paths = resolveRegisterPaths(opts);
|
|
21
23
|
const plan = planRegisterMigration(paths);
|
|
22
24
|
const summary = `items=${plan.sourceCount}, create=${plan.createdCount}, update=${plan.updatedCount}, ` +
|
|
@@ -6,14 +6,13 @@ import { appendRegisterEvent, buildRegisterEvent, registerEventFilePath } from "
|
|
|
6
6
|
import { parseSpecdojoDocument } from "../docs/frontmatter-namespace.js";
|
|
7
7
|
import { applyRegisterItemFields, PJR_ID_RE, readRegisterItemContent, readSpecdojoFields, registerItemFieldsFromItem, REMOVE_REGISTER_ITEM_FIELD, setRegisterItemDescription, setRegisterItemTitle, ticketRefCell, toDisplayItem, } from "./item.js";
|
|
8
8
|
import { specdojoRootDir } from "../shared/specdojo-config.js";
|
|
9
|
+
import { escapeRegExp } from "../shared/text.js";
|
|
9
10
|
import { loadItemForUpdate } from "./update.js";
|
|
11
|
+
import { replaceTicketSection } from "./section.js";
|
|
10
12
|
import { findRegisterItem, loadRegisterItems, writeDerivedViews } from "./views.js";
|
|
11
13
|
// ================================
|
|
12
14
|
// Renumber (duplicate ID recovery)
|
|
13
15
|
// ================================
|
|
14
|
-
function escapeRegExp(text) {
|
|
15
|
-
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16
|
-
}
|
|
17
16
|
// 個票ファイル名 `pjr-XXXX-<topic>.md` から topic を取り出す。
|
|
18
17
|
// ID 接頭辞(`pjr-xxxx-`)と一致しない場合は undefined。
|
|
19
18
|
export function ticketTopicFromFilename(id, filename) {
|
|
@@ -166,6 +165,12 @@ export function retopicPjrItem(opts) {
|
|
|
166
165
|
const ticketWrite = plan.writes.find((write) => write.path === plan.ticketRename.to);
|
|
167
166
|
if (!ticketWrite)
|
|
168
167
|
throw new Error(`Retopiced ticket content not found: ${plan.ticketRename.to}`);
|
|
168
|
+
let sectionChanged = false;
|
|
169
|
+
if (opts.section !== undefined) {
|
|
170
|
+
const sectionResult = replaceTicketSection(ticketWrite.content, opts.section.name, opts.section.content);
|
|
171
|
+
ticketWrite.content = sectionResult.content;
|
|
172
|
+
sectionChanged = sectionResult.changed;
|
|
173
|
+
}
|
|
169
174
|
if (opts.title !== undefined)
|
|
170
175
|
ticketWrite.content = setRegisterItemTitle(ticketWrite.content, opts.title);
|
|
171
176
|
if (opts.description !== undefined) {
|
|
@@ -187,6 +192,12 @@ export function retopicPjrItem(opts) {
|
|
|
187
192
|
return;
|
|
188
193
|
}
|
|
189
194
|
const beforeContent = readFileSync(plan.ticketRename.from, "utf8");
|
|
195
|
+
const extraChanges = [
|
|
196
|
+
{ field: "id", from: plan.fromDocId, to: plan.toDocId },
|
|
197
|
+
...(opts.section !== undefined && sectionChanged
|
|
198
|
+
? [{ field: "section", from: "", to: opts.section.name }]
|
|
199
|
+
: []),
|
|
200
|
+
];
|
|
190
201
|
const event = buildRegisterEvent({
|
|
191
202
|
beforeContent,
|
|
192
203
|
afterContent: ticketWrite.content,
|
|
@@ -195,7 +206,7 @@ export function retopicPjrItem(opts) {
|
|
|
195
206
|
action: "update",
|
|
196
207
|
actor: opts.actor?.trim() || "manual",
|
|
197
208
|
reason: opts.reason?.trim() || `topic changed from ${plan.fromTopic} to ${opts.topic}`,
|
|
198
|
-
extraChanges
|
|
209
|
+
extraChanges,
|
|
199
210
|
});
|
|
200
211
|
if (!event)
|
|
201
212
|
throw new Error(`Failed to build topic update event for ${opts.id}`);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { unified } from "unified";
|
|
3
|
+
import remarkParse from "remark-parse";
|
|
4
|
+
function isHeadingNode(node) {
|
|
5
|
+
return (node.type === "heading" &&
|
|
6
|
+
node.position?.start.offset !== undefined &&
|
|
7
|
+
node.position?.end.offset !== undefined);
|
|
8
|
+
}
|
|
9
|
+
function hasHeadingNode(node) {
|
|
10
|
+
if (node.type === "heading") {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if ("children" in node && Array.isArray(node.children)) {
|
|
14
|
+
return node.children.some(hasHeadingNode);
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
function headingTitle(body, node) {
|
|
19
|
+
return body
|
|
20
|
+
.slice(node.position.start.offset, node.position.end.offset)
|
|
21
|
+
.replace(/^#+\s+/, "")
|
|
22
|
+
.replace(/\s+#+\s*$/, "")
|
|
23
|
+
.trim();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 見出し文字列から先頭の章番号(例: "1. ", "3.1. ", "4 ")を除いた章名を返す。
|
|
27
|
+
*/
|
|
28
|
+
export function stripSectionNumber(headingText) {
|
|
29
|
+
return headingText.replace(/^\d+(?:\.\d+)*\.?\s*/, "").trim();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 差し替え用ファイルを検証し、その本文を返す。
|
|
33
|
+
* ファイルが存在しない・読めない場合や、中身に Markdown 見出しが含まれる場合はエラーを投げる。
|
|
34
|
+
*/
|
|
35
|
+
export function validateSectionFile(filePath) {
|
|
36
|
+
if (!existsSync(filePath)) {
|
|
37
|
+
throw new Error(`Cannot read section file: ${filePath}`);
|
|
38
|
+
}
|
|
39
|
+
let fileContent;
|
|
40
|
+
try {
|
|
41
|
+
fileContent = readFileSync(filePath, "utf8");
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
throw new Error(`Cannot read section file: ${filePath}`, { cause: error });
|
|
45
|
+
}
|
|
46
|
+
const tree = unified().use(remarkParse).parse(fileContent);
|
|
47
|
+
if (hasHeadingNode(tree)) {
|
|
48
|
+
throw new Error(`Section file must not contain markdown headings: ${filePath}`);
|
|
49
|
+
}
|
|
50
|
+
return fileContent;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 個票 Markdown から指定された章の本文を差し替える。
|
|
54
|
+
* 見出し行は残し、次の同じ深さ(または浅い)見出しまでの本文だけを置き換える。
|
|
55
|
+
*/
|
|
56
|
+
export function replaceTicketSection(content, sectionName, newBody) {
|
|
57
|
+
const prefix = content.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/)?.[0] ?? "";
|
|
58
|
+
const body = content.slice(prefix.length);
|
|
59
|
+
const targetName = sectionName.trim();
|
|
60
|
+
if (targetName === "") {
|
|
61
|
+
throw new Error("Section name must not be empty");
|
|
62
|
+
}
|
|
63
|
+
const tree = unified().use(remarkParse).parse(body);
|
|
64
|
+
const nodes = tree.children;
|
|
65
|
+
// まず H2 見出し(個票の章の標準)から探す
|
|
66
|
+
let headingIndex = nodes.findIndex((node) => isHeadingNode(node) &&
|
|
67
|
+
node.depth === 2 &&
|
|
68
|
+
stripSectionNumber(headingTitle(body, node)) === targetName);
|
|
69
|
+
// H2 にない場合は任意の見出しから探す
|
|
70
|
+
if (headingIndex < 0) {
|
|
71
|
+
headingIndex = nodes.findIndex((node) => isHeadingNode(node) && stripSectionNumber(headingTitle(body, node)) === targetName);
|
|
72
|
+
}
|
|
73
|
+
if (headingIndex < 0) {
|
|
74
|
+
throw new Error(`Section "${targetName}" not found in ticket`);
|
|
75
|
+
}
|
|
76
|
+
const targetHeading = nodes[headingIndex];
|
|
77
|
+
const targetDepth = targetHeading.depth;
|
|
78
|
+
// 次の同じ深さ(またはそれより浅い)見出しを探す
|
|
79
|
+
const nextHeadingRelativeIndex = nodes
|
|
80
|
+
.slice(headingIndex + 1)
|
|
81
|
+
.findIndex((node) => isHeadingNode(node) && node.depth <= targetDepth);
|
|
82
|
+
const nextHeading = nextHeadingRelativeIndex >= 0
|
|
83
|
+
? nodes[headingIndex + 1 + nextHeadingRelativeIndex]
|
|
84
|
+
: undefined;
|
|
85
|
+
const bodyStartOffset = targetHeading.position.end.offset;
|
|
86
|
+
const bodyEndOffset = nextHeading ? nextHeading.position.start.offset : body.length;
|
|
87
|
+
const beforeBody = body.slice(bodyStartOffset, bodyEndOffset).trim();
|
|
88
|
+
const trimmedNewBody = newBody.trim();
|
|
89
|
+
const changed = beforeBody !== trimmedNewBody;
|
|
90
|
+
const head = body.slice(0, bodyStartOffset);
|
|
91
|
+
const tail = nextHeading ? body.slice(bodyEndOffset) : "";
|
|
92
|
+
let updatedBody;
|
|
93
|
+
if (trimmedNewBody.length > 0) {
|
|
94
|
+
if (tail.length > 0) {
|
|
95
|
+
updatedBody = `${head.trimEnd()}\n\n${trimmedNewBody}\n\n${tail.trimStart()}`;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
updatedBody = `${head.trimEnd()}\n\n${trimmedNewBody}\n`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (tail.length > 0) {
|
|
103
|
+
updatedBody = `${head.trimEnd()}\n\n${tail.trimStart()}`;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
updatedBody = `${head.trimEnd()}\n`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
content: `${prefix}${updatedBody}`,
|
|
111
|
+
changed,
|
|
112
|
+
beforeBody,
|
|
113
|
+
};
|
|
114
|
+
}
|
package/dist/register/update.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { setRegisterInput } from "./input.js";
|
|
2
|
+
import { replaceTicketSection } from "./section.js";
|
|
2
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
4
|
import { basename, join } from "node:path";
|
|
4
5
|
import { atomicWriteFile, prepareRegisterEventFile } from "./core.js";
|
|
@@ -55,6 +56,10 @@ export function applyItemUpdate(opts) {
|
|
|
55
56
|
...opts.fieldUpdates,
|
|
56
57
|
};
|
|
57
58
|
if (opts.dryRun) {
|
|
59
|
+
if (opts.section !== undefined) {
|
|
60
|
+
// 通常実行と同じく、個票に無い章の名前はエラーにする(書き込みはしない)。
|
|
61
|
+
replaceTicketSection(readFileSync(ticketPath, "utf8"), opts.section.name, opts.section.content);
|
|
62
|
+
}
|
|
58
63
|
const lines = [`Would update ${ticketPath} (${opts.updated.id} ${label}):`];
|
|
59
64
|
if (opts.title !== undefined)
|
|
60
65
|
lines.push(` title: ${opts.title}`);
|
|
@@ -63,12 +68,21 @@ export function applyItemUpdate(opts) {
|
|
|
63
68
|
if (opts.inputs !== undefined) {
|
|
64
69
|
lines.push(` input: ${opts.inputs.length ? JSON.stringify(opts.inputs) : "-"}`);
|
|
65
70
|
}
|
|
71
|
+
if (opts.section !== undefined) {
|
|
72
|
+
lines.push(` section: ${opts.section.name}`);
|
|
73
|
+
}
|
|
66
74
|
lines.push(formatRegisterItemFields(updates));
|
|
67
75
|
process.stdout.write(`${lines.join("\n")}\n`);
|
|
68
76
|
return;
|
|
69
77
|
}
|
|
70
78
|
const beforeContent = readFileSync(ticketPath, "utf8");
|
|
71
79
|
let content = beforeContent;
|
|
80
|
+
let sectionChanged = false;
|
|
81
|
+
if (opts.section !== undefined) {
|
|
82
|
+
const sectionResult = replaceTicketSection(content, opts.section.name, opts.section.content);
|
|
83
|
+
content = sectionResult.content;
|
|
84
|
+
sectionChanged = sectionResult.changed;
|
|
85
|
+
}
|
|
72
86
|
if (opts.title !== undefined)
|
|
73
87
|
content = setRegisterItemTitle(content, opts.title);
|
|
74
88
|
if (opts.description !== undefined) {
|
|
@@ -77,6 +91,9 @@ export function applyItemUpdate(opts) {
|
|
|
77
91
|
if (opts.inputs !== undefined)
|
|
78
92
|
content = setRegisterInput(content, opts.inputs);
|
|
79
93
|
content = applyRegisterItemFields(content, updates);
|
|
94
|
+
const extraChanges = opts.section !== undefined && sectionChanged
|
|
95
|
+
? [{ field: "section", from: "", to: opts.section.name }]
|
|
96
|
+
: undefined;
|
|
80
97
|
const event = buildRegisterEvent({
|
|
81
98
|
beforeContent,
|
|
82
99
|
afterContent: content,
|
|
@@ -85,6 +102,7 @@ export function applyItemUpdate(opts) {
|
|
|
85
102
|
action: opts.eventAction,
|
|
86
103
|
actor: opts.eventActor,
|
|
87
104
|
reason: opts.eventReason,
|
|
105
|
+
...(extraChanges ? { extraChanges } : {}),
|
|
88
106
|
});
|
|
89
107
|
if (!event) {
|
|
90
108
|
process.stdout.write(`Unchanged: ${ticketPath} (${opts.updated.id})\n`);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Since 0.9.2 SpecDojo never launches Antigravity (agy). On consumer plans, the Antigravity FAQ
|
|
2
|
+
// excludes launching agy from third-party agents or applications and the Additional Terms
|
|
3
|
+
// (Section 6) treat it as a breach. The block is unconditional: there is intentionally no
|
|
4
|
+
// setting or environment variable that lifts it (PJR-5V0T, PJR-NJE4).
|
|
5
|
+
export const BLOCKED_ANTIGRAVITY_PROVIDER = "antigravity";
|
|
6
|
+
export const ANTIGRAVITY_BLOCKED_MESSAGE = "SpecDojo 0.9.2 and later do not launch Antigravity (agy). " +
|
|
7
|
+
"On consumer plans, the Antigravity FAQ does not cover launching agy from third-party agents or applications, " +
|
|
8
|
+
"and the Antigravity Additional Terms (Section 6) treat it as a breach of contract. " +
|
|
9
|
+
"See https://antigravity.google/docs/faq and https://antigravity.google/terms. " +
|
|
10
|
+
"Set disabled: true on (or remove) the agy members in .specdojo/agent-members.yaml and use another provider.";
|
|
11
|
+
export class AntigravityBlockedError extends Error {
|
|
12
|
+
constructor(context) {
|
|
13
|
+
super(`${context}: ${ANTIGRAVITY_BLOCKED_MESSAGE}`);
|
|
14
|
+
this.name = "AntigravityBlockedError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function isBlockedProvider(provider) {
|
|
18
|
+
return provider?.trim() === BLOCKED_ANTIGRAVITY_PROVIDER;
|
|
19
|
+
}
|
|
20
|
+
/** Throws before any agent process is spawned when the provider is Antigravity. */
|
|
21
|
+
export function assertProviderLaunchAllowed(provider, context) {
|
|
22
|
+
if (isBlockedProvider(provider))
|
|
23
|
+
throw new AntigravityBlockedError(context);
|
|
24
|
+
}
|
|
@@ -117,6 +117,17 @@ export function withPlanConventionsFiles(paths) {
|
|
|
117
117
|
])),
|
|
118
118
|
];
|
|
119
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Insert a runner-written section before the conventions reference, which must stay the final
|
|
122
|
+
* paragraph for expansion and checkpointing. Plans without a reference get the section appended.
|
|
123
|
+
*/
|
|
124
|
+
export function insertBeforePlanConventions(plan, section) {
|
|
125
|
+
const reference = conventionsReference(plan);
|
|
126
|
+
const offset = reference?.start ?? plan.length;
|
|
127
|
+
const head = plan.slice(0, offset).trimEnd();
|
|
128
|
+
const body = `${section.trim()}\n`;
|
|
129
|
+
return reference ? `${head}\n\n${body}\n${plan.slice(offset)}` : `${head}\n\n${body}`;
|
|
130
|
+
}
|
|
120
131
|
export function rebasePlanConventions(plan, from, to) {
|
|
121
132
|
const [path] = planConventionsFiles(plan, dirname(from));
|
|
122
133
|
const reference = conventionsReference(plan);
|
|
@@ -2,6 +2,7 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { copyFile, mkdir, readdir, readFile, writeFile } from "node:fs/promises";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { assertProviderLaunchAllowed } from "./antigravity-block.js";
|
|
5
6
|
function isRecord(value) {
|
|
6
7
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
8
|
}
|
|
@@ -235,6 +236,9 @@ export async function applyProviderScaffoldPlan(plan, opts) {
|
|
|
235
236
|
* 利用者向け出力だけを担う。
|
|
236
237
|
*/
|
|
237
238
|
export async function runProviderScaffold(provider, opts) {
|
|
239
|
+
// The templates/antigravity/ source stays in the package until PJR-N6FQ, but it is no longer
|
|
240
|
+
// copied: scaffolding agy settings would only prepare a launch SpecDojo refuses.
|
|
241
|
+
assertProviderLaunchAllowed(provider, `Cannot scaffold provider ${provider}`);
|
|
238
242
|
const plan = await buildProviderScaffoldPlan({
|
|
239
243
|
packageRoot: opts.packageRoot,
|
|
240
244
|
repoRoot: opts.repoRoot,
|
|
@@ -843,11 +843,12 @@ export function registerConfigCommands(program) {
|
|
|
843
843
|
});
|
|
844
844
|
cfg
|
|
845
845
|
.command("migrate-members")
|
|
846
|
-
.description("
|
|
846
|
+
.description("Deprecated: configure agent members directly in .specdojo/agent-members.yaml (will be removed in 0.10.0)")
|
|
847
847
|
.option("--project <projectId>", "Migrate only one project (default: all configured projects)")
|
|
848
848
|
.option("--dry-run", "Show planned changes without writing", false)
|
|
849
849
|
.action((opts) => {
|
|
850
850
|
try {
|
|
851
|
+
warnDeprecated("config migrate-members", "Configure agent members directly in .specdojo/agent-members.yaml instead. This command will be removed in 0.10.0.");
|
|
851
852
|
migrateAgentMembers({ projectId: opts.project, dryRun: !!opts.dryRun });
|
|
852
853
|
}
|
|
853
854
|
catch (error) {
|
|
@@ -858,21 +859,21 @@ export function registerConfigCommands(program) {
|
|
|
858
859
|
cfg
|
|
859
860
|
.command("scaffold")
|
|
860
861
|
.description("Scaffold provider settings, a VS Code multi-root workspace, Git hooks, or Slidev")
|
|
861
|
-
.option("--provider <name>", "Provider template to copy (
|
|
862
|
+
.option("--provider <name>", "Provider template to copy (claude|codex|copilot|opencode)")
|
|
862
863
|
.option("--workspace", "Generate VS Code multi-root workspace (<project-id>.code-workspace) from repos config", false)
|
|
863
864
|
.option("--lefthook", "Generate pre-commit hooks for SpecDojo repositories", false)
|
|
864
865
|
.option("--slidev", "Set up Slidev and formatting for kata", false)
|
|
865
866
|
.option("--project <id>", "Target project ID for workspace scaffolding (defaults to current_project)")
|
|
866
867
|
.option("--force", "Overwrite existing files", false)
|
|
867
868
|
.option("--dry-run", "Show planned files without writing", false)
|
|
868
|
-
.option("--global", "Merge provider permissions into user-level settings (currently
|
|
869
|
+
.option("--global", "Merge provider permissions into user-level settings (no provider currently supports it)", false)
|
|
869
870
|
.action(async (opts) => {
|
|
870
871
|
try {
|
|
871
872
|
if (!opts.provider && !opts.workspace && !opts.lefthook && !opts.slidev) {
|
|
872
873
|
throw new Error("Specify --provider <name>, --workspace, --lefthook, or --slidev to scaffold.");
|
|
873
874
|
}
|
|
874
875
|
if (opts.global && !opts.provider) {
|
|
875
|
-
throw new Error("--global requires --provider
|
|
876
|
+
throw new Error("--global requires --provider <name>");
|
|
876
877
|
}
|
|
877
878
|
if (opts.provider) {
|
|
878
879
|
await runProviderScaffold(String(opts.provider), {
|
package/dist/shared/text.js
CHANGED
|
@@ -184,3 +184,11 @@ export const SENSITIVE_TEXT_RULES = [
|
|
|
184
184
|
export function redactSensitiveText(value) {
|
|
185
185
|
return SENSITIVE_TEXT_RULES.reduce((text, { pattern, replacement }) => text.replace(pattern, replacement), value);
|
|
186
186
|
}
|
|
187
|
+
// 正規表現のメタ文字をエスケープし、外から入る値をリテラルとして埋め込めるようにする。
|
|
188
|
+
export function escapeRegExp(value) {
|
|
189
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
190
|
+
}
|
|
191
|
+
// Markdown 表のセルへ入れる文字列をエスケープする。先に `\` を `\\` にしてから `|` を `\|` にする。
|
|
192
|
+
export function escapeMarkdownTableCell(cell) {
|
|
193
|
+
return cell.replace(/\\/g, "\\\\").replace(/\|/g, "\\|");
|
|
194
|
+
}
|
|
@@ -4,10 +4,10 @@ export function registerDeprecatedWhereAlias(parent, printPaths) {
|
|
|
4
4
|
const kind = parent.name();
|
|
5
5
|
parent
|
|
6
6
|
.command("where", { hidden: true })
|
|
7
|
-
.description(`Deprecated: use where ${kind} (
|
|
7
|
+
.description(`Deprecated: use specdojo where ${kind} (will be removed in 0.10.0)`)
|
|
8
8
|
.option("--project <projectId>", "Project id in specdojo.config.json")
|
|
9
9
|
.action((opts) => {
|
|
10
|
-
warnDeprecated(`${kind} where`, `Use specdojo where ${kind}. This alias will be removed
|
|
10
|
+
warnDeprecated(`${kind} where`, `Use specdojo where ${kind}. This alias will be removed in 0.10.0.`);
|
|
11
11
|
printPaths(opts);
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -438,7 +438,7 @@ providers:
|
|
|
438
438
|
expert: { effort: high }
|
|
439
439
|
frontier: { effort: xhigh }
|
|
440
440
|
|
|
441
|
-
antigravity:
|
|
441
|
+
antigravity: # 0.9.2 から使えない(agy を起動しない)
|
|
442
442
|
command_template: 'specdojo agent launch --provider antigravity --role {mode} -- --sandbox --model {model} -p "$(cat)"'
|
|
443
443
|
# model を持たない従来の 1 段の member だけが、次の model を使う
|
|
444
444
|
command_params:
|
|
@@ -612,6 +612,7 @@ executor の出力は、そのまま reporter へ渡さずに run 単位の evid
|
|
|
612
612
|
- result の `changed_files` のパスは evidence の `changes` から、execution の evidence、project register とその派生ビュー、当該 result という runner 管理記録を除いて runner が機械生成します。除外後の変更一覧だけを reporter へ渡し、edit の変更説明は evidence のパスと対にして受け取ります。runner はパスで突き合わせるため、説明の順序は問いません。説明が不足したパスには Git の変更メタデータ(追加・変更・削除・名前の変更、行数)を記録し、変更ファイルが多い場合(50 件超)はディレクトリごとに集約して記録します。evidence にないパスの説明は捨てます。`outcome` と `block_reason` は stage の状態・終了コード・保護機構が保存した理由・executor / 親 runner の検証から機械生成します。reporter の JSON Schema は文章項目と対応づけ用のパスだけを受け付け、いずれかの検証が failed または `not_run` なら、reporter の文章にかかわらず機械判定は blocked です。ただし、executor が `not_run` または `not_applicable` と記録したコマンドを、親 runner が同じリポジトリで同じコマンドとして実行し成功していれば、親 runner の結果を正として executor の報告を無視します。さらに、`npm run <name>` に対応する script がない、`npx <package>` の package が `dependencies` / `devDependencies` にない、検査の対象となる種類の変更ファイルがない、または SpecDojo サブコマンドの設定上の適用条件を満たさないことを runner が機械的に確定できる場合、その `not_run` は block せず、edit result の申し送りへ「適用外の検証(runner の判定)」として追記します。変更ファイル種別で判定する対応は共通規約の検査表を正本とし、`validate:schema:file` は `*.yaml` / `*.yml`、Prettier は `*.md` / `*.ts` / `*.js` / `*.json` / `*.yaml` / `*.yml`、markdownlint は `*.md`、`validate:history-links`(`specdojo-docs-lint history-links` を含む)は履歴蓄積ファイル(`pjr-*.md`(`pjr-index.md` を除く)、または executor 自身が変更した `execution/runs/<origin>/<item>/<run>/` 配下の `plan.md`・`result.md` や旧来の `exec/plans/**/*.md`・`exec/results/**/*.md`)の変更がある場合だけ適用対象とします。変更範囲の判定では、runner が生成・更新する `exec/` 配下(`plans/`・`results/`・`evidence/`・`events/`・`.locks/`)を executor の変更ファイルから除外し、rename は変更前後の両方を見て、プロダクトリポジトリのコマンドはそのリポジトリの変更だけで判定します。`typecheck` など、この対応に含まれない検査の判定は変更しません。SpecDojo の起動形は `specdojo <subcommand>`、`npx specdojo <subcommand>`、ソース/配布済み CLI の直接起動を認識し、`catalog validate`(`npm run validate:catalog` および `tools/catalog-validate-if-configured.mjs` を含む)は対象 project の `catalog_path` で判定します。対象 project は、コマンドの `--project <id>`、run の対象 project(runner が execution path に一致する project を設定から特定したもの)、`current_project` の順に決めます。別の project が `catalog_path` を持っていても、run の対象 project に `catalog_path` がなければ適用外です。対象 project に `catalog_path` があっても、executor の変更(runner が書く `exec/` 配下などの runner 管理記録を除き、rename は変更前後の両方を見ます)が `docs/ja/projects/` 配下に及ばない run では、plan の共通規約の検証表と同じく適用外とし、executor の `not_applicable` も受理します。変更が及ぶ run では従来どおり適用対象です。また、`<repo>:<path>` を引数に含むコマンド、`--prefix <repo>` 付きのコマンド、または `$SPECDOJO_REPO_<NAME>` / `${SPECDOJO_REPO_<NAME>}` を含むコマンドは、対象 project が `repos` で宣言したそのプロダクトリポジトリの `package.json` で script と依存を判定します(`--prefix` はリポジトリ名か設定の `path` と一致するものを対象にします)。設定が読めない、対象 project を特定できない、または適用条件を未定義のサブコマンドは機械的な救済をせず、通常の `not_run` として扱います。executor の failed は親 runner の成功や適用外判定で打ち消しません。`npm run check` のように npm script を `&&` でつないだだけの合成コマンドを executor が `not_run` とした場合は、対象リポジトリの `package.json` の script を展開し、構成する各コマンドが同じリポジトリの親検証か executor 自身の検証で通っていれば満たされたものとして扱います。`npm test` は、`npm run test:unit` と `npm run test:integration` の両方が通っていれば満たされたものとします。構成するコマンドの script の中身と同じコマンドを executor が直接実行して通した場合も満たします(`tsx` の起動の書き方の違いはそろえて比べます)。任意のシェルを含む script は展開しません。理由付きの `not_applicable` は block の理由にせず、runner が edit result の申し送りへ「適用外の検証: `<コマンド>`(<理由>)」として機械的に追記します。ただし、理由がない場合、変更ファイル種別を含む適用条件を満たした `npm run <name>` の script が存在する場合、または同条件を満たした `npx <package>` の package が `dependencies` / `devDependencies` に存在する場合は誤申告として blocked にします。SpecDojo サブコマンドは package の有無だけでは反証せず、既知の適用条件を設定から判定します。適用条件が未定義なら理由付きの agent の申告に従います。`specdojo index build`(`npx specdojo index build`・`node --import tsx src/specdojo.ts index build` などの起動形を含みます)は runner が担う検証です。出力先の `.specdojo/doc-index.json` は agent が書き込めず、index は worktree の準備と統合の前に runner が再生成するため、executor への指示では実行も記録もしないよう伝えます。executor が `not_run` / `not_applicable` と記録しても block の理由にせず、`not_run` の場合は edit result の申し送りへ「runner が担う検証: `<コマンド>`(<理由>)」として追記します。runner の再生成が失敗した場合は worktree の準備で run が止まるか、runner の検証の失敗として block するため、満たしたものとは扱いません。executor の failed は救済せず、ほかの SpecDojo サブコマンドの `not_run` の扱いも変えません。executor の `requires_human` は block の理由にせず、runner が edit result の申し送りへ「人の確認が必要: `<コマンド>`(<要約>)」として機械的に追記します。項目は review へ進み、人が確認してから close します。
|
|
613
613
|
- `completion_status` は作業の完了状態を示す省略可能な欄で、値は `complete` / `incomplete` です。欄のない既存の報告は `complete` として扱います。値が指定されていてこの 2 値に合わない場合は、安全側に倒して `incomplete` として保存します。executor は計画の作業を終えられなかった場合、`incomplete` とし、理由を `final_message`、残作業を `handoff` に書きます。終了コード 0 や親検証の成功では未完了の申告を上書きしません。`exec run --register` は親検証・reporter を起動する前に停止し、項目を `waiting` にして、秘匿処理・文字数制限を適用した `final_message` の要旨を `block_reason` に記録します。worktree 実行では変更と evidence を残し、統合しません。pipeline の executor は `blocked`、evidence の `stage.status` と `exit_code` は実際のプロセス結果のままとします。`--resume --resume-from executor`(または `--resume`)で再開でき、前回の理由と `handoff`、途中の変更を executor に引き継ぎます。完了を申告し直し、必要な検証を通過してから review・統合へ進みます。
|
|
614
614
|
- approach が報告に求める項目は、runner が reporter の起動前に検査します。現在の対象は `condense` の edit が求める `condense_records` で、欠けている、または形式が正しくない場合は reporter の失敗にせず executor の段の失敗とします。evidence を `completion_status: incomplete` とし、理由と再開の操作(schedule は `exec resume --task <id> --resume-from executor`、register は `exec run --register <id> --worktree --resume --resume-from executor`、agent を替える場合は `--executor-by`)を `block_reason` と result に残します。pipeline の executor は `blocked` です。再開は executor の段から始まり、reporter だけを同じ evidence で流し直しません。この検査より前に記録され、reporter の段で止まった run も、reporter の再開時に同じ検査で executor の段へ戻します。
|
|
615
|
+
- edit の executor が `complete` と報告しても、runner は次のどちらかに当たる場合は成功とせず、同じく evidence を `completion_status: incomplete`、pipeline の executor を `blocked` にして、register の項目を `waiting` にします。1 つ目は、プロダクトリポジトリを対象にする項目(plan の `targets`・個票の `target_path` / `targets` に `<repo>:<path>` がある、または approach の無い plan の本文が `<repo>:<path>` を参照する)なのに、そのプロダクトの worktree に未 commit の変更も exec branch の commit も無い場合です。`block_reason` は `no product changes in <repo>` で始まり、runner の要約と `exec status` の末尾の `warnings (no product changes):` に出ます。2 つ目は、executor の出力(報告のタグの中を除く)にツールの権限による拒否(opencode の permission rule の `deny`、Claude Code の `Permission to use ... has been denied` など)がある場合です。シェルの `Permission denied` は対象にしません。プロダクトを対象にしない項目は、プロダクトに変更が無くても従来どおり進みます。
|
|
615
616
|
- `handoff` は executor が申し送る判断の理由、保護された設定の変更案、次のアクションなどの文字列配列です。先頭 100 件、各 4,000 文字までを秘匿処理して evidence に保存し、空文字列や文字列以外の要素は除外します。省略した既存の報告・evidence も有効です。reporter にはこの欄も渡し、edit result の「申し送り」には runner が reporter の補足と合わせて機械的に転記します。同一の文字列は重複させず、reporter が省略しても executor の記録は残します。register の完了条件が result への記録を求める場合、pipeline の executor は個票の対応結果と報告の `handoff` の両方に書きます。close の前には個票の対応結果と result の両方を確認します。
|
|
616
617
|
- reporter の出力は JSON Schema で厳格に検証します。形式不正のときは同じ plan と evidence のまま reporter だけを最大 3 回再実行し、executor は再実行しません。
|
|
617
618
|
- reporter stage の再開では、現在の設定 ID と一致する親検証が保存済み evidence にそろっている場合だけ executor evidence を再利用します。`{ id, repo }` を使う場合は、ID とリポジトリの組が一致することを求めます。再実行時も同じ割り当てで、各リポジトリの worktree を `cwd` にします。保存済みの親検証がすべて成功していれば再実行しません。`failed` / `not_run` があれば、親 runner が現在の worktree で固定許可リストの親検証を再実行し、同じ ID の結果を evidence 上で置換してから reporter へ渡します。過去の親検証ログは置換せず、新しい失敗ログだけを追加します。executor 由来の検証は再実行・置換しません。設定 ID が変わった、または結果が欠けている場合、Schedule 実行は新しい executor run としてやり直し、register 実行は明示的な再実行を促して再開を拒否します。
|
|
@@ -621,15 +622,17 @@ executor の出力は、そのまま reporter へ渡さずに run 単位の evid
|
|
|
621
622
|
|
|
622
623
|
agent が exec 実行時に読み込む provider 固有の設定(agent 定義・permission 設定)は、npm package 内の `templates/<provider>/` を配布原本とし、利用プロジェクトへコピーして使います。worktree 実行はコミット済み内容から worktree を作るため、コピーした設定は必ずコミットします。
|
|
623
624
|
|
|
625
|
+
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 が契約違反としているためです。provider が `antigravity` の member は、名前で指定すると agent の起動前にエラーで止まり、自動選択と代わりの選択では候補から外れます。`agent launch` と `orchestrator launch` の `--provider antigravity`、`init`・`config scaffold`・`devcontainer scaffold` での `antigravity` の指定もエラーになり、止めるのを外す設定はありません。0.9.1 の `init` で antigravity を選んだ場合は、`.specdojo/agent-members.yaml` で agy の member に `disabled: true` を付けるか削除し、ほかの provider を使ってください。以降の agy の設定の説明は 0.9.1 までの記録で、0.9.2 では使えません。
|
|
626
|
+
|
|
624
627
|
配置規則は provider 名から機械的に決まります(`agents/` 配下 → `.<provider>/agents/`、`rules/` 配下 → `.<provider>/rules/`、`opencode.json` → リポジトリ直下の `opencode.json`、それ以外のファイル → `.specdojo/<provider>/`、`README.md` はコピーしません)。provider ごとの配布内容は次のとおりです。
|
|
625
628
|
|
|
626
|
-
| provider | 配布内容
|
|
627
|
-
| ----------- |
|
|
628
|
-
| claude | `agents/*.md`(役割ごとの agent 定義)、`settings.edit.json` / `settings.orchestrator.json` / `settings.review.json` / `settings.report.json`
|
|
629
|
-
| codex | `agents/*.toml`(親 Codex が spawn する subagent 定義)、`rules/*.rules`(command rule)
|
|
630
|
-
| opencode | `agents/*.md`(permission frontmatter 込みの agent 定義)、`opencode.json`(Ollama 接続・モデル設定)
|
|
631
|
-
| copilot | `agent-members-snippet.yaml`(agent 定義)と `exec-defaults-snippet.yaml`(`providers.copilot` の command template・rate limit 検出)の参照スニペット
|
|
632
|
-
| antigravity |
|
|
629
|
+
| provider | 配布内容 | 配置先 |
|
|
630
|
+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
631
|
+
| claude | `agents/*.md`(役割ごとの agent 定義)、`settings.edit.json` / `settings.orchestrator.json` / `settings.review.json` / `settings.report.json` | `.claude/agents/`、`.specdojo/claude/` |
|
|
632
|
+
| codex | `agents/*.toml`(親 Codex が spawn する subagent 定義)、`rules/*.rules`(command rule) | `.codex/agents/`、`.codex/rules/` |
|
|
633
|
+
| opencode | `agents/*.md`(permission frontmatter 込みの agent 定義)、`opencode.json`(Ollama 接続・モデル設定) | `.opencode/agents/`、`opencode.json` |
|
|
634
|
+
| copilot | `agent-members-snippet.yaml`(agent 定義)と `exec-defaults-snippet.yaml`(`providers.copilot` の command template・rate limit 検出)の参照スニペット | `.specdojo/copilot/` |
|
|
635
|
+
| antigravity | 0.9.2 から配置できない。0.9.1 までは役割別 `settings.edit.json` / `settings.review.json` / `settings.report.json` / `settings.orchestrator.json`、orchestrator と設定スニペット。旧 `settings.global.json` は互換用途だけに使用 | `.specdojo/antigravity/` |
|
|
633
636
|
|
|
634
637
|
導入手順と手動設定(`.codex/config.toml` や接続先 URL の調整、Modelfile によるローカル派生タグの作成など)は各 `templates/<provider>/README.md` を参照します。
|
|
635
638
|
|
|
@@ -658,7 +661,7 @@ specdojo config scaffold --provider claude
|
|
|
658
661
|
- 配布原本はインストール済み package のルートから解決します。`templates/<name>/` が存在しない provider を指定した場合は、指定可能な provider 一覧を添えてエラーにします。
|
|
659
662
|
- 配置先に同名ファイルが存在する場合は上書きせず `Skipped (already exists):` を出力します。`--force` 指定時のみ上書きします。ファイルごとに `Written:` / `Skipped:` を 1 行ずつ出力します(既存の scaffold 系コマンドの出力形式に合わせます)。
|
|
660
663
|
- `--dry-run` 指定時は書き込みを行わず、コピー予定のファイル一覧を表示します。
|
|
661
|
-
-
|
|
664
|
+
- 0.9.2 から使えません。0.9.1 までは、`antigravity` で `--global` を明示した場合だけ、`~/.gemini/antigravity-cli/settings.json` の `permissions.allow` / `deny` / `ask` へ不足 rule を追記します。既存キーと配列要素は保持し、書き換え前に timestamp 付きバックアップを作ります。`--global --dry-run` は追加 rule の差分だけを表示し、設定もバックアップも作りません。
|
|
662
665
|
- `--global` をサポートしない provider へ指定した場合はエラーにします。`--force` はグローバル設定の既存値を上書きしません。
|
|
663
666
|
- コピー完了後、次の 2 点を案内メッセージとして出力します。配置ファイルのコミットが必要であること(worktree 実行の前提)、および `.specdojo/exec-defaults.yaml` の `providers.claude.command_template` に `--settings` の指定が必要であること。
|
|
664
667
|
- `settings.*.json` の `Edit(...)` / `Write(...)` パスパターンの調整は利用者に委ねます。scaffold は `.specdojo/specdojo.config.json` のパス設定に基づく書き換えを行いません(テンプレートを事実上の推奨レイアウト前提で配布します)。
|
|
@@ -675,7 +678,7 @@ specdojo config scaffold --provider claude
|
|
|
675
678
|
| codex | `luna-executor`・`luna-review-executor`・`luna-reporter` | `codex-executor`・`codex-review-executor`・`codex-reporter` | 実体の `model`(`gpt-6-luna`、effort は `by_proficiency`) |
|
|
676
679
|
| codex | `sol-executor`・`sol-review-executor`(expert) | `codex-expert-executor`・`codex-expert-review-executor` | 実体の `model`(`gpt-6.1-sol`、effort は `by_proficiency`) |
|
|
677
680
|
| opencode | `gemma-executor`・`gemma-review-executor`・`gemma-reporter`、`qwen-executor`・`qwen-review-executor`・`qwen-reporter` | `opencode-executor`・`opencode-review-executor`・`opencode-reporter` | 実体の `model`(`opencode.json` の provider 名込み、原則 `*-mlx-work-64k`) |
|
|
678
|
-
| antigravity | `flash-executor`・`flash-review-executor`・`flash-reporter`
|
|
681
|
+
| antigravity | 0.9.2 から生成しない。0.9.1 までは `flash-executor`・`flash-review-executor`・`flash-reporter` | `agy-executor`・`agy-review-executor`・`agy-reporter` | 実体の `model`(推論強度を含む ID) |
|
|
679
682
|
| copilot | `copilot-executor`・`copilot-review-executor`・`copilot-reporter` | なし(`--model auto` で model を自動選択するため系統で名付けない) | `command_template` の `--model auto` |
|
|
680
683
|
|
|
681
684
|
claude と codex は normal と expert の 2 段を持ちます(0.4.6 から)。expert の実体には `proficiency: expert` を付けます。init が書く振り分けの表(`routing`)は、hard を expert の別名(`claude-expert-executor`・`codex-expert-executor`)、medium と easy を normal の別名にし、reporter はどの難易度でも normal の別名にします。expert の段がない provider(opencode・antigravity など)は、hard も normal の別名を使います。codex の reasoning effort は `by_proficiency` で normal が `medium`、expert が `high` で、`gpt-6-luna` は Max までしか受け付けないため Ultra を割り当てません。
|
|
@@ -741,7 +744,7 @@ provider によらず、exec の実行構造そのものが次の境界を提供
|
|
|
741
744
|
|
|
742
745
|
**claude** は `provider 設定の配布と scaffold` のとおり、pipeline のロール別 `--settings` でパス単位に制限します。executor・review executor・reporter は `git push` と全 `gh` を deny します。対話型オーケストレーターの npm script は専用の `settings.orchestrator.json` を読み込み、保護設定を含む編集を妨げず、`git push` と `gh` の書き込みだけを deny して読み取りを allow します。`--permission-mode bypassPermissions` は使わず、`.claude/settings.json` の `disableBypassPermissionsMode: "disable"` で起動自体を拒否します。
|
|
743
746
|
|
|
744
|
-
**antigravity** は `config scaffold --provider antigravity --global` で fine-grained permission を追記します。グローバル設定は利用者のすべてのリポジトリに効くため、allow は読み取りの Git コマンド(`git status` / `diff` / `log` / `show`)だけとし、`npm run` など任意のスクリプトを実行できる command は含めません。deny には、`git push`、全 `gh`、Git の変更操作・破壊的 command・秘密情報・固定保護設定へのアクセスを入れます。`--dangerously-skip-permissions` は使いません。CLI の permission に加えて、実行後の provider 非依存ガードでも保護設定の変更を block します。
|
|
747
|
+
**antigravity** は 0.9.2 から使えません(`provider 設定の配布と scaffold` を参照)。0.9.1 までは `config scaffold --provider antigravity --global` で fine-grained permission を追記します。グローバル設定は利用者のすべてのリポジトリに効くため、allow は読み取りの Git コマンド(`git status` / `diff` / `log` / `show`)だけとし、`npm run` など任意のスクリプトを実行できる command は含めません。deny には、`git push`、全 `gh`、Git の変更操作・破壊的 command・秘密情報・固定保護設定へのアクセスを入れます。`--dangerously-skip-permissions` は使いません。CLI の permission に加えて、実行後の provider 非依存ガードでも保護設定の変更を block します。
|
|
745
748
|
|
|
746
749
|
**codex** はパス単位の permission 機構を持たず、sandbox(`read-only` / `workspace-write` / `danger-full-access`)の粒度で制御します。review でも result の記入が必要なため `read-only` にはできず、edit / review とも `workspace-write` を使います。command template には次を明示します。
|
|
747
750
|
|
|
@@ -790,7 +793,7 @@ providers:
|
|
|
790
793
|
--deny-tool 'shell(git push)' --deny-tool 'shell(git reset)'
|
|
791
794
|
```
|
|
792
795
|
|
|
793
|
-
**antigravity**(Antigravity CLI `agy
|
|
796
|
+
**antigravity**(Antigravity CLI `agy`)は 0.9.2 から起動できません(`provider 設定の配布と scaffold` を参照)。以下は 0.9.1 までの設定です。pipeline の役割指示は plan の共通規約を正本とし、権限は `agent launch --role {mode}` が分離します。非対話実行は `-p` ですが、プロンプトを引数に取り stdin を読まないので、runner が stdin へ書く plan を `"$(cat)"` で引数に渡します(command は `shell: true` で実行されます)。
|
|
794
797
|
|
|
795
798
|
```yaml
|
|
796
799
|
providers:
|