specdojo 0.4.6 → 0.4.7
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/CHANGELOG.md +16 -0
- package/dist/catalog/document-target.js +75 -0
- package/dist/commands/agent.js +2 -80
- package/dist/exec/agent-config.js +28 -16
- package/dist/exec/agent-plan.js +108 -0
- package/dist/exec/commands.js +3 -3
- package/dist/exec/grade-checkpoint.js +12 -0
- package/dist/exec/plans-core.js +4 -65
- package/dist/exec/plans-generation.js +22 -5
- package/dist/exec/project.js +4 -1
- package/dist/exec/register.js +66 -5
- package/dist/exec/run/lifecycle-commands.js +2 -0
- package/dist/exec/run/register-resume.js +1 -0
- package/dist/exec/run/register-state.js +4 -1
- package/dist/exec/run/register-worktree.js +5 -1
- package/dist/exec/run/schedule-prepare.js +7 -1
- package/dist/exec/worktree-command.js +8 -1
- package/dist/exec/worktree-ops-merge.js +40 -1
- package/dist/grade/apply.js +7 -5
- package/dist/grade/command-inspect.js +2 -1
- package/dist/grade/command-run.js +39 -0
- package/dist/grade/grade.js +3 -1
- package/dist/grade/markdown.js +4 -4
- package/dist/grade/pipeline-state.js +8 -6
- package/dist/grade/plan.js +8 -6
- package/dist/grade/run.js +307 -0
- package/dist/grade/target-discovery.js +1 -1
- package/dist/grade/targets.js +44 -22
- package/dist/register/approach.js +16 -0
- package/dist/register/core.js +2 -0
- package/dist/register/create-commands.js +49 -1
- package/dist/register/deliverable-target.js +215 -0
- package/dist/register/events.js +4 -0
- package/dist/register/item.js +8 -0
- package/dist/review/grade.js +19 -17
- package/dist/shared/agent-plan.js +1 -0
- package/dist/shared/provider-scaffold.js +5 -3
- package/dist/specdojo.js +5 -1
- package/docs/ja/specdojo/exec-templates/xrp-freeform-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-fully-guided-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-recipe-guided-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-recipe-maintenance-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-retrofit-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-rulebook-maintenance-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-sample-maintenance-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-template-maintenance-template.md +2 -2
- package/docs/ja/specdojo/exec-templates/xrp-template.md +2 -2
- package/docs/ja/specdojo/guides/exec-config-guide.md +44 -12
- package/docs/ja/specdojo/guides/exec-operation-guide.md +4 -0
- package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +3 -1
- package/docs/ja/specdojo/guides/quick-start-guide.md +22 -2
- package/docs/ja/specdojo/guides/remote-host-development-guide.md +15 -1
- package/docs/ja/specdojo/guides/review-guide.md +2 -2
- package/docs/ja/specdojo/guides/ryu-guide.md +12 -0
- package/docs/ja/specdojo/references/command-reference.md +52 -27
- package/docs/ja/specdojo/references/specdojo-config-reference.md +29 -8
- package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +28 -22
- package/docs/specdojo/schemas/v1/grade-pipeline-state.schema.yaml +1 -1
- package/docs/specdojo/schemas/v1/register-events.schema.yaml +2 -0
- package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +33 -1
- package/docs/specdojo/schemas/v1/specdojo-config.schema.yaml +16 -3
- package/package.json +1 -1
- package/templates/devcontainer/devcontainer.json +1 -0
- package/templates/init-agent-members.yaml +46 -3
- package/templates/opencode/README.md +118 -14
- package/templates/opencode/agents/specdojo-orchestrator.md +1 -1
- package/templates/opencode/opencode.json +25 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
2
|
+
import { dirname, isAbsolute, relative, resolve } from "node:path";
|
|
3
|
+
import { collectDocIndexEntries } from "../docs/doc-index.js";
|
|
4
|
+
import { specdojoReferencePath } from "../docs/template-resolution.js";
|
|
5
|
+
import { readSpecdojoNamespace } from "../docs/frontmatter-namespace.js";
|
|
6
|
+
import { resolveDeliverableByDocId } from "../catalog/document-target.js";
|
|
7
|
+
import { KATA_MISSING, resolveKataDocumentPathIfExists } from "../kata/kata.js";
|
|
8
|
+
import { AUTHORING_KINDS } from "../kata/authoring.js";
|
|
9
|
+
import { loadConfig } from "../shared/specdojo-config.js";
|
|
10
|
+
import { parsePracticeId } from "../shared/practice-id.js";
|
|
11
|
+
import { load } from "../shared/yaml.js";
|
|
12
|
+
export const CATALOG_LESS_APPROACHES = [
|
|
13
|
+
"fully-guided",
|
|
14
|
+
"recipe-guided",
|
|
15
|
+
"freeform",
|
|
16
|
+
"retrofit",
|
|
17
|
+
"bootstrap",
|
|
18
|
+
"finalize",
|
|
19
|
+
"bootstrap-finalize",
|
|
20
|
+
];
|
|
21
|
+
function metadata(path) {
|
|
22
|
+
const text = readFileSync(path, "utf8");
|
|
23
|
+
if (/\.mdx?$/.test(path))
|
|
24
|
+
return readSpecdojoNamespace(text);
|
|
25
|
+
const parsed = load(text);
|
|
26
|
+
return (parsed?.specdojo ?? parsed ?? {});
|
|
27
|
+
}
|
|
28
|
+
// Resolve the nearest existing ancestor as well, so symlink parents cannot escape the repository.
|
|
29
|
+
export function validateDeliverablePath(root, value) {
|
|
30
|
+
if (!value.trim() || isAbsolute(value) || /^[a-z]:/i.test(value) || value.includes("\\")) {
|
|
31
|
+
throw new Error(`--target-path must be a repository-relative path: ${value}`);
|
|
32
|
+
}
|
|
33
|
+
const absolute = resolve(root, value);
|
|
34
|
+
const path = relative(root, absolute).replaceAll("\\", "/");
|
|
35
|
+
if (!path || path === ".." || path.startsWith("../")) {
|
|
36
|
+
throw new Error(`--target-path points outside the repository: ${value}`);
|
|
37
|
+
}
|
|
38
|
+
let ancestor = absolute;
|
|
39
|
+
while (!existsSync(ancestor))
|
|
40
|
+
ancestor = dirname(ancestor);
|
|
41
|
+
const physical = relative(realpathSync(root), realpathSync(ancestor));
|
|
42
|
+
if (physical === ".." || physical.startsWith("../") || isAbsolute(physical)) {
|
|
43
|
+
throw new Error(`--target-path points outside the repository through a symlink: ${value}`);
|
|
44
|
+
}
|
|
45
|
+
if (existsSync(absolute) && !statSync(absolute).isFile()) {
|
|
46
|
+
throw new Error(`--target-path must name a file: ${value}`);
|
|
47
|
+
}
|
|
48
|
+
return path;
|
|
49
|
+
}
|
|
50
|
+
export function resolveRegisterDeliverableTarget(opts) {
|
|
51
|
+
if (opts.catalogPath) {
|
|
52
|
+
try {
|
|
53
|
+
const resolved = resolveDeliverableByDocId(opts.catalogPath, opts.projectId, opts.targetId, opts.repoRoot);
|
|
54
|
+
return { info: resolved.info, catalogless: false };
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (!(error instanceof Error) ||
|
|
58
|
+
!error.message.startsWith("catalog deliverable target not found"))
|
|
59
|
+
throw error;
|
|
60
|
+
if (!opts.targetPath || !opts.targetRulebook)
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (!CATALOG_LESS_APPROACHES.includes(opts.approach)) {
|
|
65
|
+
throw new Error(`Approach "${opts.approach}" requires a deliverable target from the project catalog (catalog_path)`);
|
|
66
|
+
}
|
|
67
|
+
const entries = collectDocIndexEntries(resolve(opts.repoRoot, "docs"), opts.repoRoot);
|
|
68
|
+
const indexed = entries[opts.targetId]?.replace(/:\d+$/, "");
|
|
69
|
+
const indexedPath = indexed
|
|
70
|
+
? relative(opts.repoRoot, resolve(opts.repoRoot, indexed))
|
|
71
|
+
: undefined;
|
|
72
|
+
if (!opts.targetPath && !indexedPath) {
|
|
73
|
+
throw new Error(`Target ${opts.targetId} is not indexed; specify --target-path and --target-rulebook (catalog_path is not configured)`);
|
|
74
|
+
}
|
|
75
|
+
const path = validateDeliverablePath(opts.repoRoot, opts.targetPath ?? indexedPath ?? "");
|
|
76
|
+
if (indexedPath && path !== validateDeliverablePath(opts.repoRoot, indexedPath)) {
|
|
77
|
+
throw new Error(`--target-path conflicts with the indexed document ${opts.targetId}: ${indexedPath}`);
|
|
78
|
+
}
|
|
79
|
+
const absolute = resolve(opts.repoRoot, path);
|
|
80
|
+
const existing = existsSync(absolute);
|
|
81
|
+
const fm = existing ? metadata(absolute) : {};
|
|
82
|
+
if (existing && fm.id !== opts.targetId) {
|
|
83
|
+
throw new Error(`--target-path is occupied by another document: ${path} (expected ${opts.targetId})`);
|
|
84
|
+
}
|
|
85
|
+
if (AUTHORING_KINDS.includes(fm.type)) {
|
|
86
|
+
throw new Error(`Target ${opts.targetId} is a kata, not a deliverable`);
|
|
87
|
+
}
|
|
88
|
+
const declaredRulebook = typeof fm.rulebook === "string" ? fm.rulebook : undefined;
|
|
89
|
+
if (opts.targetRulebook && declaredRulebook && opts.targetRulebook !== declaredRulebook) {
|
|
90
|
+
throw new Error(`--target-rulebook conflicts with specdojo.rulebook of ${opts.targetId}: ${declaredRulebook}`);
|
|
91
|
+
}
|
|
92
|
+
const rulebook = opts.targetRulebook ?? declaredRulebook;
|
|
93
|
+
if (!existing && (!opts.targetPath || !opts.targetRulebook)) {
|
|
94
|
+
throw new Error(`New deliverable ${opts.targetId} requires --target-path and --target-rulebook`);
|
|
95
|
+
}
|
|
96
|
+
if (!rulebook)
|
|
97
|
+
throw new Error(`Target ${opts.targetId} requires --target-rulebook or specdojo.rulebook`);
|
|
98
|
+
if ((opts.approach === "finalize" || opts.approach === "bootstrap-finalize") && !existing) {
|
|
99
|
+
throw new Error(`Approach "${opts.approach}" requires an existing deliverable: ${opts.targetId}`);
|
|
100
|
+
}
|
|
101
|
+
const refs = {
|
|
102
|
+
rulebook: KATA_MISSING,
|
|
103
|
+
recipe: KATA_MISSING,
|
|
104
|
+
sample: KATA_MISSING,
|
|
105
|
+
template: KATA_MISSING,
|
|
106
|
+
};
|
|
107
|
+
const kataIds = [];
|
|
108
|
+
const kataTargets = [];
|
|
109
|
+
const findKata = (kind, id) => {
|
|
110
|
+
const entry = entries[id]?.replace(/:\d+$/, "");
|
|
111
|
+
if (entry) {
|
|
112
|
+
const absolutePath = resolve(opts.repoRoot, entry);
|
|
113
|
+
if (kind !== "sample" && metadata(absolutePath).type !== kind)
|
|
114
|
+
throw new Error(`Kata ${id} must have type ${kind}`);
|
|
115
|
+
return specdojoReferencePath(absolutePath, { repositoryRoot: opts.repoRoot });
|
|
116
|
+
}
|
|
117
|
+
for (const extension of kind === "rulebook" || kind === "recipe"
|
|
118
|
+
? ["md"]
|
|
119
|
+
: ["md", "yaml", "yml", "json"]) {
|
|
120
|
+
const found = resolveKataDocumentPathIfExists(kind, id, extension, {
|
|
121
|
+
repositoryRoot: opts.repoRoot,
|
|
122
|
+
});
|
|
123
|
+
if (found &&
|
|
124
|
+
metadata(found).id === id &&
|
|
125
|
+
(kind === "sample" || metadata(found).type === kind))
|
|
126
|
+
return specdojoReferencePath(found, { repositoryRoot: opts.repoRoot });
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
};
|
|
130
|
+
if (opts.approach === "bootstrap") {
|
|
131
|
+
if (!opts.targetPath || !opts.targetRulebook)
|
|
132
|
+
throw new Error("Catalog-less bootstrap requires --target-path and --target-rulebook");
|
|
133
|
+
const authority = loadConfig(opts.repoRoot).config?.kata_authority;
|
|
134
|
+
if (!authority)
|
|
135
|
+
throw new Error("Catalog-less bootstrap requires kata_authority in specdojo.config.json");
|
|
136
|
+
const parsed = parsePracticeId(rulebook);
|
|
137
|
+
if (parsed.authority !== authority || !/^[a-z0-9][a-z0-9-]*-rulebook$/.test(parsed.localId)) {
|
|
138
|
+
throw new Error(`Bootstrap rulebook must use kata_authority ${authority} and end with -rulebook: ${rulebook}`);
|
|
139
|
+
}
|
|
140
|
+
if (findKata("rulebook", rulebook))
|
|
141
|
+
throw new Error(`Bootstrap requires a new rulebook id; ${rulebook} already exists`);
|
|
142
|
+
const stem = parsed.localId.slice(0, -"-rulebook".length);
|
|
143
|
+
for (const kind of AUTHORING_KINDS) {
|
|
144
|
+
const id = `${authority}:${stem}-${kind}`;
|
|
145
|
+
const proposedPath = `docs/ja/specdojo/${kind}s/${authority}/${stem}-${kind}.md`;
|
|
146
|
+
validateDeliverablePath(opts.repoRoot, proposedPath);
|
|
147
|
+
// Do not reuse somebody else's kata when the generated id/path collides.
|
|
148
|
+
if (entries[id] || existsSync(resolve(opts.repoRoot, proposedPath)) || findKata(kind, id)) {
|
|
149
|
+
throw new Error(`Bootstrap kata id or path already exists: ${id} (${proposedPath})`);
|
|
150
|
+
}
|
|
151
|
+
refs[kind] = proposedPath;
|
|
152
|
+
kataIds.push(id);
|
|
153
|
+
kataTargets.push({ id, path: proposedPath });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
const missing = [];
|
|
158
|
+
const rulebookPath = !["none", "not-needed", "undecided"].includes(rulebook)
|
|
159
|
+
? findKata("rulebook", rulebook)
|
|
160
|
+
: undefined;
|
|
161
|
+
if (rulebookPath) {
|
|
162
|
+
refs.rulebook = rulebookPath;
|
|
163
|
+
kataIds.push(rulebook);
|
|
164
|
+
kataTargets.push({ id: rulebook, path: rulebookPath });
|
|
165
|
+
}
|
|
166
|
+
else if (opts.approach !== "freeform")
|
|
167
|
+
missing.push("rulebook");
|
|
168
|
+
const rb = rulebookPath ? metadata(resolve(opts.repoRoot, rulebookPath)) : {};
|
|
169
|
+
for (const kind of ["recipe", "sample", "template"]) {
|
|
170
|
+
const declaration = rb[kind];
|
|
171
|
+
const ids = Array.isArray(declaration) ? declaration : [declaration];
|
|
172
|
+
const notNeeded = declaration === "not-needed";
|
|
173
|
+
const required = (opts.approach === "fully-guided" && !notNeeded) ||
|
|
174
|
+
(opts.approach === "recipe-guided" && kind === "recipe") ||
|
|
175
|
+
(opts.approach === "bootstrap-finalize" && !notNeeded);
|
|
176
|
+
let resolvedAny = false;
|
|
177
|
+
for (const id of ids) {
|
|
178
|
+
if (typeof id !== "string" || ["none", "not-needed", "undecided"].includes(id))
|
|
179
|
+
continue;
|
|
180
|
+
const found = findKata(kind, id);
|
|
181
|
+
if (found) {
|
|
182
|
+
if (!resolvedAny)
|
|
183
|
+
refs[kind] = found;
|
|
184
|
+
resolvedAny = true;
|
|
185
|
+
kataIds.push(id);
|
|
186
|
+
kataTargets.push({ id, path: found });
|
|
187
|
+
}
|
|
188
|
+
else if (required)
|
|
189
|
+
missing.push(`${kind} (${id})`);
|
|
190
|
+
}
|
|
191
|
+
if (required && !resolvedAny)
|
|
192
|
+
missing.push(kind);
|
|
193
|
+
}
|
|
194
|
+
if (missing.length)
|
|
195
|
+
throw new Error(`Approach "${opts.approach}" is missing kata: ${[...new Set(missing)].join(", ")}`);
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
catalogless: true,
|
|
199
|
+
refs,
|
|
200
|
+
kataIds,
|
|
201
|
+
kataTargets,
|
|
202
|
+
info: {
|
|
203
|
+
catalogless: true,
|
|
204
|
+
resolvedPath: path,
|
|
205
|
+
deliverable: {
|
|
206
|
+
local_id: opts.targetId.split(":").pop(),
|
|
207
|
+
name: opts.targetId,
|
|
208
|
+
kind: "work",
|
|
209
|
+
overview: "個票の概要・完了条件を参照する。",
|
|
210
|
+
path,
|
|
211
|
+
rulebook,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
}
|
package/dist/register/events.js
CHANGED
|
@@ -24,6 +24,8 @@ export const REGISTER_EVENT_FIELDS = [
|
|
|
24
24
|
"approach",
|
|
25
25
|
"targets",
|
|
26
26
|
"sources",
|
|
27
|
+
"target_path",
|
|
28
|
+
"target_rulebook",
|
|
27
29
|
"derived_from",
|
|
28
30
|
"autopilot",
|
|
29
31
|
];
|
|
@@ -77,6 +79,8 @@ export function registerEventFieldValues(content, filename, timeZone) {
|
|
|
77
79
|
block_reason: parsed.blockReason,
|
|
78
80
|
approach: item.approach ?? CELL_NONE,
|
|
79
81
|
targets: item.targets ? JSON.stringify(item.targets) : CELL_NONE,
|
|
82
|
+
target_path: item.targetPath ?? CELL_NONE,
|
|
83
|
+
target_rulebook: item.targetRulebook ?? CELL_NONE,
|
|
80
84
|
sources: item.sources ? JSON.stringify(item.sources) : CELL_NONE,
|
|
81
85
|
derived_from: item.derivedFrom ? JSON.stringify(item.derivedFrom) : CELL_NONE,
|
|
82
86
|
autopilot: item.autopilot ?? CELL_NONE,
|
package/dist/register/item.js
CHANGED
|
@@ -71,6 +71,8 @@ const SPECDOJO_KEY_ORDER = [
|
|
|
71
71
|
"approach",
|
|
72
72
|
"targets",
|
|
73
73
|
"sources",
|
|
74
|
+
"target_path",
|
|
75
|
+
"target_rulebook",
|
|
74
76
|
];
|
|
75
77
|
// ================================
|
|
76
78
|
// Derivation helpers
|
|
@@ -246,6 +248,10 @@ export function readRegisterItemContent(content, filename) {
|
|
|
246
248
|
conclusion: asString(fields.conclusion) ?? CELL_NONE,
|
|
247
249
|
ticket: ticketRefCell(filename),
|
|
248
250
|
...(approach ? { approach } : {}),
|
|
251
|
+
...(asString(fields.target_path) ? { targetPath: asString(fields.target_path) } : {}),
|
|
252
|
+
...(asString(fields.target_rulebook)
|
|
253
|
+
? { targetRulebook: asString(fields.target_rulebook) }
|
|
254
|
+
: {}),
|
|
249
255
|
...(targets && targets.length > 0 ? { targets } : {}),
|
|
250
256
|
...(sources && sources.length > 0 ? { sources } : {}),
|
|
251
257
|
...(derivedFrom && derivedFrom.length > 0 ? { derivedFrom } : {}),
|
|
@@ -371,6 +377,8 @@ export function registerItemFieldsFromItem(item) {
|
|
|
371
377
|
? null
|
|
372
378
|
: inlineCodeAnglePlaceholders(item.conclusion.trim()),
|
|
373
379
|
...(item.approach ? { approach: item.approach } : {}),
|
|
380
|
+
...(item.targetPath ? { target_path: item.targetPath } : {}),
|
|
381
|
+
...(item.targetRulebook ? { target_rulebook: item.targetRulebook } : {}),
|
|
374
382
|
...(item.targets && item.targets.length > 0 ? { targets: item.targets } : {}),
|
|
375
383
|
...(item.sources && item.sources.length > 0 ? { sources: item.sources } : {}),
|
|
376
384
|
...(item.derivedFrom && item.derivedFrom.length > 0 ? { derived_from: item.derivedFrom } : {}),
|
package/dist/review/grade.js
CHANGED
|
@@ -2,8 +2,8 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { gitEnvironment } from "../shared/git-environment.js";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
5
6
|
import { gradeContentHash, gradeFindingDisplayMessage, gradeResultPathForDocument, parseGradeResult, } from "../shared/grade-result.js";
|
|
6
|
-
export const REVIEW_GRADE_SCRIPT = join("tools", "grade", "run-per-document.sh");
|
|
7
7
|
function errorMessage(error) {
|
|
8
8
|
return error instanceof Error ? error.message : String(error);
|
|
9
9
|
}
|
|
@@ -59,10 +59,10 @@ export function reviewGradeFreshness(opts) {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Decide whether the runner grades the subject before the review plan is written. A fresh grade is
|
|
62
|
-
* reused; an unresolved subject
|
|
62
|
+
* reused; an unresolved subject cannot be graded.
|
|
63
63
|
*/
|
|
64
64
|
export function decideReviewGradeAction(opts) {
|
|
65
|
-
const { freshness,
|
|
65
|
+
const { freshness, dryRun } = opts;
|
|
66
66
|
if (freshness.state === "fresh")
|
|
67
67
|
return { run: false, outcome: { action: "skipped" } };
|
|
68
68
|
if (freshness.state === "unresolved") {
|
|
@@ -70,15 +70,6 @@ export function decideReviewGradeAction(opts) {
|
|
|
70
70
|
}
|
|
71
71
|
if (dryRun)
|
|
72
72
|
return { run: false, outcome: { action: "not-run", detail: "dry-run のため実行しない" } };
|
|
73
|
-
if (!scriptAvailable) {
|
|
74
|
-
return {
|
|
75
|
-
run: false,
|
|
76
|
-
outcome: {
|
|
77
|
-
action: "not-run",
|
|
78
|
-
detail: `grade の実行スクリプトがリポジトリにない: ${REVIEW_GRADE_SCRIPT.split("\\").join("/")}`,
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
73
|
return { run: true };
|
|
83
74
|
}
|
|
84
75
|
export function reviewGradeRunId(taskId, now) {
|
|
@@ -91,7 +82,8 @@ export function reviewGradeRunId(taskId, now) {
|
|
|
91
82
|
}
|
|
92
83
|
export function reviewGradeArgs(opts) {
|
|
93
84
|
const args = [
|
|
94
|
-
|
|
85
|
+
"grade",
|
|
86
|
+
"run",
|
|
95
87
|
"--run-id",
|
|
96
88
|
opts.runId,
|
|
97
89
|
"--project",
|
|
@@ -103,6 +95,10 @@ export function reviewGradeArgs(opts) {
|
|
|
103
95
|
if (opts.target === "kata")
|
|
104
96
|
args.push("--kind", "all");
|
|
105
97
|
args.push("--path", opts.subjectPath);
|
|
98
|
+
if (opts.by)
|
|
99
|
+
args.push("--by", opts.by);
|
|
100
|
+
if (opts.execDefaultsPath)
|
|
101
|
+
args.push("--exec-defaults", opts.execDefaultsPath);
|
|
106
102
|
return args;
|
|
107
103
|
}
|
|
108
104
|
const defaultInvoke = (command, args, cwd) => new Promise((resolvePromise) => {
|
|
@@ -140,7 +136,6 @@ export async function ensureReviewGrade(opts) {
|
|
|
140
136
|
});
|
|
141
137
|
const decision = decideReviewGradeAction({
|
|
142
138
|
freshness,
|
|
143
|
-
scriptAvailable: existsSync(join(opts.repoRoot, REVIEW_GRADE_SCRIPT)),
|
|
144
139
|
dryRun: opts.dryRun,
|
|
145
140
|
});
|
|
146
141
|
if (!decision.run)
|
|
@@ -151,21 +146,28 @@ export async function ensureReviewGrade(opts) {
|
|
|
151
146
|
projectId: opts.projectId,
|
|
152
147
|
target: opts.target,
|
|
153
148
|
subjectPath: opts.subjectPath,
|
|
149
|
+
by: opts.by,
|
|
150
|
+
execDefaultsPath: opts.execDefaultsPath,
|
|
154
151
|
});
|
|
155
152
|
const invoke = opts.invoke ?? defaultInvoke;
|
|
156
153
|
try {
|
|
157
|
-
|
|
154
|
+
// Resolve the entrypoint from this package, never from the consumer repository.
|
|
155
|
+
const javascript = fileURLToPath(new URL("../specdojo.js", import.meta.url));
|
|
156
|
+
const entryArgs = existsSync(javascript)
|
|
157
|
+
? [javascript]
|
|
158
|
+
: ["--import", "tsx", fileURLToPath(new URL("../specdojo.ts", import.meta.url))];
|
|
159
|
+
const { exitCode, stderr } = await invoke(process.execPath, [...entryArgs, ...args], opts.repoRoot);
|
|
158
160
|
if (exitCode === 0)
|
|
159
161
|
return { action: "executed", runId };
|
|
160
162
|
const reason = lastLine(stderr);
|
|
161
163
|
return {
|
|
162
164
|
action: "failed",
|
|
163
165
|
runId,
|
|
164
|
-
detail:
|
|
166
|
+
detail: `${opts.subjectPath}: exit ${exitCode}${reason ? `: ${reason}` : ""}`,
|
|
165
167
|
};
|
|
166
168
|
}
|
|
167
169
|
catch (error) {
|
|
168
|
-
return { action: "failed", runId, detail: errorMessage(error) };
|
|
170
|
+
return { action: "failed", runId, detail: `${opts.subjectPath}: ${errorMessage(error)}` };
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
function outcomeLine(outcome) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -75,9 +75,11 @@ export async function buildProviderScaffoldPlan(opts) {
|
|
|
75
75
|
relFile === PROVIDER_GLOBAL_SETTINGS[provider]?.templateRelPath) {
|
|
76
76
|
continue;
|
|
77
77
|
}
|
|
78
|
-
const destinationRelPath =
|
|
79
|
-
?
|
|
80
|
-
:
|
|
78
|
+
const destinationRelPath = provider === "opencode" && relFile === "opencode.json"
|
|
79
|
+
? "opencode.json"
|
|
80
|
+
: relFile.startsWith("agents/") || relFile.startsWith("rules/")
|
|
81
|
+
? `.${provider}/${relFile}`
|
|
82
|
+
: `.specdojo/${provider}/${relFile}`;
|
|
81
83
|
entries.push({
|
|
82
84
|
sourcePath: path.join(templateDir, ...relFile.split("/")),
|
|
83
85
|
destinationPath: path.join(repoRoot, ...destinationRelPath.split("/")),
|
package/dist/specdojo.js
CHANGED
|
@@ -19,6 +19,7 @@ import { registerYamlPagesCommands } from "./docs/yaml-pages-command.js";
|
|
|
19
19
|
import { registerDashboardCommands } from "./dashboard/dashboard.js";
|
|
20
20
|
import { registerGradeCommand } from "./grade/grade.js";
|
|
21
21
|
import { registerAgentCommands } from "./commands/agent.js";
|
|
22
|
+
import { resolveGradingPlanActor, runAgentPlan } from "./exec/agent-plan.js";
|
|
22
23
|
import { registerKataCommands } from "./kata/command.js";
|
|
23
24
|
import { registerDevcontainerCommands } from "./devcontainer/command.js";
|
|
24
25
|
import { registerInitCommand } from "./commands/init.js";
|
|
@@ -58,7 +59,10 @@ async function main() {
|
|
|
58
59
|
registerBuildCommand(program);
|
|
59
60
|
registerYamlPagesCommands(program);
|
|
60
61
|
registerDashboardCommands(program);
|
|
61
|
-
registerGradeCommand(program
|
|
62
|
+
registerGradeCommand(program, {
|
|
63
|
+
resolveActor: resolveGradingPlanActor,
|
|
64
|
+
executePlan: runAgentPlan,
|
|
65
|
+
});
|
|
62
66
|
registerAgentCommands(program);
|
|
63
67
|
registerKataCommands(program);
|
|
64
68
|
registerDevcontainerCommands(program);
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -40,8 +40,8 @@ _GRADE_SUMMARY_
|
|
|
40
40
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
41
41
|
|
|
42
42
|
<!-- prettier-ignore-start -->
|
|
43
|
-
| ID
|
|
44
|
-
| --- |
|
|
43
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
44
|
+
| --- | --- | --- | --- |
|
|
45
45
|
_DONE_CRITERIA_ROWS_
|
|
46
46
|
<!-- prettier-ignore-end -->
|
|
47
47
|
|
|
@@ -35,8 +35,8 @@ _GRADE_SUMMARY_
|
|
|
35
35
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
36
36
|
|
|
37
37
|
<!-- prettier-ignore-start -->
|
|
38
|
-
| ID
|
|
39
|
-
| --- |
|
|
38
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
40
|
_DONE_CRITERIA_ROWS_
|
|
41
41
|
<!-- prettier-ignore-end -->
|
|
42
42
|
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -34,8 +34,8 @@ _GRADE_SUMMARY_
|
|
|
34
34
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
35
35
|
|
|
36
36
|
<!-- prettier-ignore-start -->
|
|
37
|
-
| ID
|
|
38
|
-
| --- |
|
|
37
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
39
|
_DONE_CRITERIA_ROWS_
|
|
40
40
|
<!-- prettier-ignore-end -->
|
|
41
41
|
|
|
@@ -35,8 +35,8 @@ _GRADE_SUMMARY_
|
|
|
35
35
|
<!-- markdownlint-disable MD055 MD056 -->
|
|
36
36
|
|
|
37
37
|
<!-- prettier-ignore-start -->
|
|
38
|
-
| ID
|
|
39
|
-
| --- |
|
|
38
|
+
| ID | ロール | `viewpoint_id` | 完了条件 |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
40
|
_DONE_CRITERIA_ROWS_
|
|
41
41
|
<!-- prettier-ignore-end -->
|
|
42
42
|
|
|
@@ -262,6 +262,36 @@ rate_limit_policy:
|
|
|
262
262
|
|
|
263
263
|
この例では共有 defaults の検証は両 project に適用され、`specdojo-lp` の 2 件は `prj-0002` の run だけに適用されます。`prj-0001` は `specdojo-lp` を `repos` に持たなくても影響を受けません。共有側と project 側に同じ ID・同じ `repo` の組を書くと、合成後の重複として agent 起動前にエラーになります。project 固有の検証も親 runner が固定 argv で実行し、evidence には `source: runner` と実行先の `repo` が記録されます。
|
|
264
264
|
|
|
265
|
+
共有 defaults の検証を減らす場合は、`projects.<id>.run.parent_validations_exclude` に除外する検証を指定します。たとえば共有一覧が `lint-fm`・`lint-md`・`lint-ts`・`typecheck`・`test-unit`・`test-integration`・`validate-schema` の場合、文書と LP を扱う `prj-0002` だけで本体の検証を外す設定は次のとおりです。`exec-defaults.yaml` の複製は不要です。
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"projects": {
|
|
270
|
+
"prj-0001": {
|
|
271
|
+
"run": { "exec_defaults": ".specdojo/exec-defaults.yaml" }
|
|
272
|
+
},
|
|
273
|
+
"prj-0002": {
|
|
274
|
+
"repos": [{ "name": "specdojo-lp", "path": "../specdojo-lp" }],
|
|
275
|
+
"run": {
|
|
276
|
+
"exec_defaults": ".specdojo/exec-defaults.yaml",
|
|
277
|
+
"parent_validations_exclude": [
|
|
278
|
+
"lint-ts",
|
|
279
|
+
"typecheck",
|
|
280
|
+
"test-unit",
|
|
281
|
+
"test-integration",
|
|
282
|
+
"validate-schema"
|
|
283
|
+
],
|
|
284
|
+
"parent_validations": [{ "id": "typecheck", "repo": "specdojo-lp" }]
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
有効な一覧は「共有 defaults から除外 → project の追加」の順で求めます。この例の `prj-0002` では `lint-fm`・`lint-md`・`specdojo-lp` の `typecheck` だけが実行され、`prj-0001` の 7 件は変わりません。除外を省略するか `[]` にすると従来の追記動作を保ちます。検証以外の共有 defaults の設定も保持します。
|
|
292
|
+
|
|
293
|
+
除外の要素も ID または `{ id, repo }` です。ID だけなら `repo: project` と同じで、同じ ID のプロダクトリポジトリ向け検証は除外しません。除外先は共有一覧に存在する ID と実行先の組に限り、project の追加一覧からは除外しません。未知の ID、不正な要素、共有一覧に存在しない組の除外、除外一覧内または最終一覧内の組の重複は、agent 起動前に設定エラーになります。除外前の共有一覧自体も検証するため、除外で不正な共有設定を隠すことはできません。除外した組を追加一覧で末尾に戻すことはできます。
|
|
294
|
+
|
|
265
295
|
`wait` の待機中は、同一 worktree と register / pipeline の状態を別 run から保護するため project の実行ロックを保持します。register worktree の `--join` 実行は共有枠の範囲で引き続き動作できます。wait / fallback の再開時刻と切替元・切替先は pipeline state と executor evidence に記録されます。
|
|
266
296
|
|
|
267
297
|
### 5.1. register の難易度別振り分け
|
|
@@ -538,17 +568,17 @@ executor の出力は、そのまま reporter へ渡さずに run 単位の evid
|
|
|
538
568
|
|
|
539
569
|
agent が exec 実行時に読み込む provider 固有の設定(agent 定義・permission 設定)は、npm package 内の `templates/<provider>/` を配布原本とし、利用プロジェクトへコピーして使います。worktree 実行はコミット済み内容から worktree を作るため、コピーした設定は必ずコミットします。
|
|
540
570
|
|
|
541
|
-
配置規則は provider 名から機械的に決まります(`agents/` 配下 → `.<provider>/agents/`、`rules/` 配下 → `.<provider>/rules
|
|
571
|
+
配置規則は provider 名から機械的に決まります(`agents/` 配下 → `.<provider>/agents/`、`rules/` 配下 → `.<provider>/rules/`、`opencode.json` → リポジトリ直下の `opencode.json`、それ以外のファイル → `.specdojo/<provider>/`、`README.md` はコピーしません)。provider ごとの配布内容は次のとおりです。
|
|
542
572
|
|
|
543
573
|
| provider | 配布内容 | 配置先 |
|
|
544
574
|
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
545
575
|
| claude | `agents/*.md`(役割ごとの agent 定義)、`settings.edit.json` / `settings.orchestrator.json` / `settings.review.json` / `settings.report.json` | `.claude/agents/`、`.specdojo/claude/` |
|
|
546
576
|
| codex | `agents/*.toml`(親 Codex が spawn する subagent 定義)、`rules/*.rules`(command rule) | `.codex/agents/`、`.codex/rules/` |
|
|
547
|
-
| opencode | `agents/*.md`(permission frontmatter 込みの agent
|
|
577
|
+
| opencode | `agents/*.md`(permission frontmatter 込みの agent 定義)、`opencode.json`(Ollama 接続・モデル設定) | `.opencode/agents/`、`opencode.json` |
|
|
548
578
|
| copilot | `agent-members-snippet.yaml`(agent 定義)と `exec-defaults-snippet.yaml`(`providers.copilot` の command template・rate limit 検出)の参照スニペット | `.specdojo/copilot/` |
|
|
549
579
|
| antigravity | `orchestrator.md`、agent / provider 設定スニペット。`settings.global.json` は `--global` 用のマージ原本であり repository へは配置しない | `.specdojo/antigravity/` |
|
|
550
580
|
|
|
551
|
-
|
|
581
|
+
導入手順と手動設定(`.codex/config.toml` や接続先 URL の調整、Modelfile によるローカル派生タグの作成など)は各 `templates/<provider>/README.md` を参照します。
|
|
552
582
|
|
|
553
583
|
`.specdojo/exec-defaults.yaml` の `providers.claude.command_template` には `--settings .specdojo/claude/settings.{mode}.json` を指定します。`--permission-mode bypassPermissions` は使いません(`.claude/settings.json` の `disableBypassPermissionsMode: "disable"` で起動自体を拒否します)。
|
|
554
584
|
|
|
@@ -585,15 +615,15 @@ specdojo config scaffold --provider claude
|
|
|
585
615
|
|
|
586
616
|
`specdojo init --exec` と `config scaffold` が配布する agent の名簿と定義は、実体と別名の 2 段構成です(0.4.0 から)。実体は model の系統と役割で名付け、provider・`model`・役割を持ちます。従来の名前は `aliases` で実体を指す別名として残します。claude と opencode の agent の定義は役割(executor・review executor・reporter)ごとの 1 ファイルで `model` を持たず、`command_params.by_mode` で mode から定義を選び、model は実体の `model` を `--model {model}` で渡します。
|
|
587
617
|
|
|
588
|
-
| provider | init が生成する実体
|
|
589
|
-
| ----------- |
|
|
590
|
-
| claude | `sonnet-executor`・`sonnet-review-executor`・`sonnet-reporter`
|
|
591
|
-
| claude | `opus-executor`・`opus-review-executor`(expert)
|
|
592
|
-
| codex | `luna-executor`・`luna-review-executor`・`luna-reporter`
|
|
593
|
-
| codex | `sol-executor`・`sol-review-executor`(expert)
|
|
594
|
-
| opencode | `gemma-executor`・`gemma-review-executor`・`gemma-reporter`
|
|
595
|
-
| antigravity | `flash-executor`・`flash-review-executor`・`flash-reporter`
|
|
596
|
-
| copilot | `copilot-executor`・`copilot-review-executor`・`copilot-reporter`
|
|
618
|
+
| provider | init が生成する実体 | 別名(従来の名前) | model の書き場所 |
|
|
619
|
+
| ----------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
620
|
+
| claude | `sonnet-executor`・`sonnet-review-executor`・`sonnet-reporter` | `claude-executor`・`claude-review-executor`・`claude-reporter` | 実体の `model`(`sonnet`) |
|
|
621
|
+
| claude | `opus-executor`・`opus-review-executor`(expert) | `claude-expert-executor`・`claude-expert-review-executor` | 実体の `model`(`opus`) |
|
|
622
|
+
| codex | `luna-executor`・`luna-review-executor`・`luna-reporter` | `codex-executor`・`codex-review-executor`・`codex-reporter` | 実体の `model`(`gpt-6-luna`、effort は `by_proficiency`) |
|
|
623
|
+
| codex | `sol-executor`・`sol-review-executor`(expert) | `codex-expert-executor`・`codex-expert-review-executor` | 実体の `model`(`gpt-6.1-sol`、effort は `by_proficiency`) |
|
|
624
|
+
| 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`) |
|
|
625
|
+
| antigravity | `flash-executor`・`flash-review-executor`・`flash-reporter` | `agy-executor`・`agy-review-executor`・`agy-reporter` | 実体の `model`(推論強度を含む ID) |
|
|
626
|
+
| copilot | `copilot-executor`・`copilot-review-executor`・`copilot-reporter` | なし(`--model auto` で model を自動選択するため系統で名付けない) | `command_template` の `--model auto` |
|
|
597
627
|
|
|
598
628
|
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 を割り当てません。
|
|
599
629
|
|
|
@@ -779,6 +809,8 @@ runner は agent の各試行前後でファイル内容を比較し、差分が
|
|
|
779
809
|
|
|
780
810
|
agentと親検証の子プロセスを起動する際は、`gitEnvironment()`で`GIT_DIR`、`GIT_WORK_TREE`、`GIT_COMMON_DIR`、index・object・replace関連のrepository固有環境変数を除去します。除去対象は`src/shared/git-environment.ts`の`GIT_LOCAL_ENV_VARS`を正本とします。Vitestの全3設定も共通setupを使ってtest module読込前に同じ変数をworkerから除去するため、Git hook経由で`npm test`が起動されても、テストfixtureはcwdの一時repositoryを参照し、linked worktreeのgitdirや共有configを参照しません。
|
|
781
811
|
|
|
812
|
+
Vitestの共通setupは、シェルから継承した`SPECDOJO_PROJECT`も除去します。これにより、orchestratorの対象projectがテストfixtureの設定に存在しなくても、unit・integrationのworkerとその子プロセスはfixture側の設定からprojectを解決できます。project選択を検証するテスト自身がsetupの後に設定する`SPECDOJO_PROJECT`は有効です。
|
|
813
|
+
|
|
782
814
|
TypeScriptのテスト・tool・本体コードが`spawnSync`、`spawn`、`execFileSync`、`execFile`でGitを直接起動する箇所は、AST検査により`gitEnvironment()`から作った`env`だけを許可します。`env: process.env`や単なる`env`プロパティは隔離済みとは扱いません。shell scriptとnpm scriptのGit起動はこのAST検査の対象外ですが、現状のhook経路はVitest setupを必ず通り、hookから直接Gitを起動するテスト用scriptはありません。今後その経路を追加する場合は、入口で`GIT_LOCAL_ENV_VARS`相当を除去する専用検査を追加します。
|
|
783
815
|
|
|
784
816
|
executor / reporter pipelineのexecutor promptは、commitとrepository設定を親runnerが所有することを明記し、`git commit`およびlocal / global / system configの変更(`user.name` / `user.email`を含む)を禁止します。fixture commitに使うテスト用identityはVitest workerと子プロセスの環境変数だけへ注入し、fixtureを含むrepositoryのlocal configへは書き込みません。
|
|
@@ -90,6 +90,10 @@ register 実行は exec events を記録しないため、schedule の Ready・C
|
|
|
90
90
|
|
|
91
91
|
worktree の checkpoint 作成時に root の index に staged 変更がある場合、checkpoint 対象の plan、result、event、登録簿記帳と重なるパスだけを停止理由にします。重ならない staged 変更はパスを警告へ表示して保持したまま実行を続けます。checkpoint または register の runner commit が失敗した場合も、runner が対象にしたパスだけを unstage し、無関係な staged 変更は変更しません。
|
|
92
92
|
|
|
93
|
+
grade の結果・完了条件・未完了段のサイドカー(`execution_path/grade/results/`、`criteria/`、`pipeline/`)の未コミット変更も checkpoint に含めます。worktree は分岐前の評価結果を読み取り、更新したサイドカーを統合します。分岐後に root で同じサイドカーが更新された場合は、古い評価で上書きしないよう統合を止めます。両側の評価対象と内容を照合してから再開してください。
|
|
94
|
+
|
|
95
|
+
schedule の review 前の評価は、同じ package の `grade run` を起動します。最新の評価結果は再利用し、必要な評価では選択済み review agent の実体名と起動設定を引き継ぎます。開発用スクリプトの配置は不要です。失敗時は対象文書と理由を review plan に示し、review が評価結果の鮮度・利用可否を判断します。`viewpoints_path` がない project では同梱の `specdojo:pm-review-viewpoints` を参照し、固有の差分が必要なら設定したパスへ `exec scaffold --project <id>` で雛形を生成します。
|
|
96
|
+
|
|
93
97
|
register 実行の場所は `.specdojo/exec-defaults.yaml` の `run.register_execution`(`worktree` / `in-place`)で選びます。設定がない既存リポジトリは互換性のため in-place のままです。CLI の `--worktree` / `--in-place` は設定を上書きし、両方を同時に指定するとエラーになります。
|
|
94
98
|
|
|
95
99
|
通常は、失敗時の変更を隔離でき、`--resume` / `--force-restart` を使える worktree を選びます。worktree の準備時間が作業時間に見合わない、変更対象が小さく、失敗時に作業ツリーへ残る差分をその場で整理できる場合だけ `--in-place` を使います。in-place では `--resume` / `--force-restart` / `--join` と `--parallel` は使えません。`--register-commit` は in-place だけで意味を持ち、worktree は常に checkpoint と統合 commit を作ります。
|