specdojo 0.3.0 → 0.3.1
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 +18 -0
- package/dist/catalog-build-references.js +144 -0
- package/dist/catalog-build-render.js +144 -0
- package/dist/catalog-build.js +13 -290
- package/dist/catalog-generate.js +6 -9
- package/dist/catalog-plan-generate.js +2 -2
- package/dist/catalog-plan.js +6 -6
- package/dist/catalog-scaffold.js +4 -4
- package/dist/catalog.js +2 -2
- package/dist/dashboard-exec-records.js +105 -0
- package/dist/dashboard-routines.js +255 -0
- package/dist/dashboard-shared.js +14 -0
- package/dist/dashboard-timeline.js +175 -0
- package/dist/dashboard.js +10 -544
- package/dist/deliverable-trash.js +3 -3
- package/dist/doc-index.js +3 -3
- package/dist/exec-commands.js +557 -0
- package/dist/exec-core.js +457 -0
- package/dist/exec-plans-core.js +693 -0
- package/dist/exec-plans-generation.js +206 -0
- package/dist/exec-plans-storage.js +131 -0
- package/dist/exec-plans.js +3 -1018
- package/dist/exec-repo-integration-git.js +23 -0
- package/dist/exec-repo-integration-sync.js +264 -0
- package/dist/exec-repo-integration.js +4 -281
- package/dist/exec-reporter-output.js +206 -0
- package/dist/exec-reporter.js +2 -206
- package/dist/exec-results.js +22 -15
- package/dist/exec-run-agent-pipeline.js +256 -0
- package/dist/exec-run-agent.js +531 -0
- package/dist/exec-run-in-place.js +541 -0
- package/dist/exec-run-job.js +717 -0
- package/dist/exec-run-lifecycle-commands.js +522 -0
- package/dist/exec-run-mode-shared.js +140 -0
- package/dist/exec-run-register-command.js +244 -0
- package/dist/exec-run-register-core.js +386 -0
- package/dist/exec-run-register-mode.js +206 -0
- package/dist/exec-run-register-resume.js +393 -0
- package/dist/exec-run-register-state.js +322 -0
- package/dist/exec-run-register-worktree.js +509 -0
- package/dist/exec-run-schedule-mode.js +294 -0
- package/dist/exec-run-schedule-prepare.js +353 -0
- package/dist/exec-run-schedule-task.js +572 -0
- package/dist/exec-run-shared.js +399 -0
- package/dist/exec-run.js +11 -6182
- package/dist/exec-shared.js +2 -2
- package/dist/exec-trial-commands.js +558 -0
- package/dist/exec-trial-core.js +371 -0
- package/dist/exec-trial.js +2 -921
- package/dist/exec-worktree-ops-commit.js +707 -0
- package/dist/exec-worktree-ops-lifecycle.js +292 -0
- package/dist/exec-worktree-ops-merge.js +303 -0
- package/dist/exec-worktree-ops.js +3 -1292
- package/dist/exec-worktree.js +32 -4
- package/dist/exec.js +2 -1006
- package/dist/frontmatter-namespace.js +2 -2
- package/dist/grade-apply.js +734 -0
- package/dist/grade-command-apply.js +250 -0
- package/dist/grade-command-inspect.js +138 -0
- package/dist/grade-command-plan.js +101 -0
- package/dist/grade-command-shared.js +68 -0
- package/dist/grade-core.js +307 -0
- package/dist/grade-markdown.js +274 -0
- package/dist/grade-pipeline-state.js +184 -0
- package/dist/grade-plan.js +507 -0
- package/dist/grade-result.js +5 -5
- package/dist/grade-target-discovery.js +265 -0
- package/dist/grade-targets.js +432 -0
- package/dist/grade.js +14 -3188
- package/dist/init-command.js +7 -7
- package/dist/job-definition.js +670 -0
- package/dist/job.js +9 -673
- package/dist/kata-command.js +2 -2
- package/dist/register-command-types.js +1 -0
- package/dist/register-core.js +363 -0
- package/dist/register-create-commands.js +245 -0
- package/dist/register-events.js +4 -4
- package/dist/register-item.js +6 -6
- package/dist/register-maintenance-commands.js +187 -0
- package/dist/register-migration.js +268 -0
- package/dist/register-renumber.js +314 -0
- package/dist/register-transition-commands.js +248 -0
- package/dist/register-update.js +230 -0
- package/dist/register-views.js +256 -0
- package/dist/register.js +61 -2069
- package/dist/review-plan.js +3 -3
- package/dist/routine-definition.js +401 -0
- package/dist/routine.js +6 -402
- package/dist/schedule-approach.js +2 -2
- package/dist/schedule-strategy-generate-document.js +273 -0
- package/dist/schedule-strategy-generate-scope.js +199 -0
- package/dist/schedule-strategy-generate.js +9 -473
- package/dist/schedule.js +4 -4
- package/dist/specdojo-config.js +3 -4
- package/dist/viewpoint-document-kinds-check.js +3 -3
- package/dist/yaml-pages.js +4 -4
- package/dist/yaml.js +28 -0
- package/docs/ja/specdojo/guides/exec-config-guide.md +6 -6
- package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +20 -18
- package/docs/ja/specdojo/guides/routine-operation-guide.md +1 -1
- package/package.json +4 -5
- package/templates/antigravity/README.md +3 -3
- package/templates/antigravity/exec-defaults-snippet.yaml +6 -4
- package/templates/init-exec-defaults.yaml +3 -1
package/dist/exec-worktree.js
CHANGED
|
@@ -76,6 +76,9 @@ export function runGitWithTransientRetry(run, onTransientFailureRetry = () => un
|
|
|
76
76
|
}
|
|
77
77
|
return result;
|
|
78
78
|
}
|
|
79
|
+
// spawnSync の既定の maxBuffer(1 MiB)では、未追跡のファイルが多い作業場所の
|
|
80
|
+
// `git status --porcelain` などが打ち切られ、子プロセスが SIGTERM で止められる。
|
|
81
|
+
export const GIT_OUTPUT_MAX_BUFFER = 256 * 1024 * 1024;
|
|
79
82
|
export function gitResult(repoRoot, args) {
|
|
80
83
|
const cwd = resolve(repoRoot);
|
|
81
84
|
const run = () => spawnSync("git", ["-C", cwd, ...args], {
|
|
@@ -84,6 +87,7 @@ export function gitResult(repoRoot, args) {
|
|
|
84
87
|
cwd,
|
|
85
88
|
encoding: "utf8",
|
|
86
89
|
env: gitEnvironment(),
|
|
90
|
+
maxBuffer: GIT_OUTPUT_MAX_BUFFER,
|
|
87
91
|
stdio: ["ignore", "pipe", "pipe"],
|
|
88
92
|
});
|
|
89
93
|
return runGitWithTransientRetry(run, ({ attempt, maxAttempts, waitMilliseconds, reason }) => {
|
|
@@ -135,14 +139,38 @@ export function summarizeGitStderr(stderr, maxLength = GIT_FAILURE_REASON_MAX_LE
|
|
|
135
139
|
const joined = selected.join(" / ");
|
|
136
140
|
return joined.length <= maxLength ? joined : `${joined.slice(0, maxLength - 1)}…`;
|
|
137
141
|
}
|
|
138
|
-
|
|
142
|
+
// 起動の失敗や出力の上限超過(ENOBUFS)では stderr が空になるため、spawnSync の
|
|
143
|
+
// error と signal から原因を組み立てる。git 自身が終了コードを返した場合は空文字を返す。
|
|
144
|
+
export function describeGitProcessFailure(outcome) {
|
|
145
|
+
const parts = [];
|
|
146
|
+
const error = outcome.error;
|
|
147
|
+
if (error) {
|
|
148
|
+
const code = "code" in error && typeof error.code === "string" ? error.code : undefined;
|
|
149
|
+
const message = error.message.trim();
|
|
150
|
+
if (code === "ENOBUFS") {
|
|
151
|
+
parts.push(`output exceeded maxBuffer (ENOBUFS): ${message}`);
|
|
152
|
+
}
|
|
153
|
+
else if (code && !message.includes(code)) {
|
|
154
|
+
parts.push(`${code}: ${message}`);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
parts.push(message || "spawn error");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (outcome.signal)
|
|
161
|
+
parts.push(`terminated by signal ${outcome.signal}`);
|
|
162
|
+
return parts.join("; ");
|
|
163
|
+
}
|
|
164
|
+
export function formatGitCommandFailure(args, stderr, processFailure = "") {
|
|
139
165
|
const subcommandIndex = args.findIndex((arg) => !arg.startsWith("-"));
|
|
140
166
|
const label = subcommandIndex === -1 ? "git" : `git ${args[subcommandIndex]}`;
|
|
141
167
|
const summary = summarizeGitArguments(subcommandIndex === -1
|
|
142
168
|
? args
|
|
143
169
|
: [...args.slice(0, subcommandIndex), ...args.slice(subcommandIndex + 1)]);
|
|
144
170
|
const detail = summary ? ` (args: ${summary})` : "";
|
|
145
|
-
const cause = summarizeGitStderr(stderr)
|
|
171
|
+
const cause = [processFailure.trim(), summarizeGitStderr(stderr)]
|
|
172
|
+
.filter((part) => part !== "")
|
|
173
|
+
.join(" / ");
|
|
146
174
|
return cause ? `${label} failed: ${cause}${detail}` : `${label} failed${detail}`;
|
|
147
175
|
}
|
|
148
176
|
// lefthook などの hook 出力から、block reason に載せる失敗ステップ名と最初のエラー行を
|
|
@@ -212,9 +240,9 @@ export class GitCommandError extends Error {
|
|
|
212
240
|
}
|
|
213
241
|
export function gitOutput(repoRoot, args) {
|
|
214
242
|
const result = gitResult(repoRoot, args);
|
|
215
|
-
if (result.status !== 0) {
|
|
243
|
+
if (result.status !== 0 || result.error) {
|
|
216
244
|
const stderr = typeof result.stderr === "string" ? result.stderr : "";
|
|
217
|
-
throw new GitCommandError(formatGitCommandFailure(args, stderr), args, stderr);
|
|
245
|
+
throw new GitCommandError(formatGitCommandFailure(args, stderr, describeGitProcessFailure(result)), args, stderr);
|
|
218
246
|
}
|
|
219
247
|
return typeof result.stdout === "string" ? result.stdout : "";
|
|
220
248
|
}
|