agentplane 0.3.1 → 0.3.3
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/assets/AGENTS.md +5 -4
- package/assets/agents/CODER.json +4 -3
- package/assets/agents/DOCS.json +1 -1
- package/assets/agents/INTEGRATOR.json +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -0
- package/assets/agents/PLANNER.json +1 -0
- package/assets/agents/TESTER.json +3 -1
- package/assets/policy/dod.code.md +2 -2
- package/assets/policy/dod.core.md +16 -2
- package/assets/policy/dod.docs.md +2 -2
- package/assets/policy/incidents.md +44 -1
- package/assets/policy/workflow.direct.md +10 -5
- package/bin/agentplane.js +116 -18
- package/bin/dist-guard.js +78 -10
- package/bin/runtime-context.d.ts +23 -0
- package/bin/runtime-context.js +94 -0
- package/bin/runtime-watch.d.ts +26 -0
- package/bin/runtime-watch.js +116 -0
- package/bin/stale-dist-policy.d.ts +6 -0
- package/bin/stale-dist-policy.js +44 -0
- package/dist/.build-manifest.json +2480 -5
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +9 -12
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +23 -18
- package/dist/backends/task-backend/shared/constants.d.ts +1 -0
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -0
- package/dist/backends/task-backend/shared/doc.d.ts +1 -0
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/doc.js +4 -1
- package/dist/backends/task-backend/shared/export.js +3 -3
- package/dist/cli/bootstrap-guide.d.ts +16 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -0
- package/dist/cli/bootstrap-guide.js +112 -0
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +62 -203
- package/dist/cli/command-snippets.d.ts +2 -2
- package/dist/cli/command-snippets.js +2 -2
- package/dist/cli/run-cli/catalog.d.ts +7 -0
- package/dist/cli/run-cli/catalog.d.ts.map +1 -0
- package/dist/cli/run-cli/catalog.js +22 -0
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +11 -0
- package/dist/cli/run-cli/commands/core.js +1 -1
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +2 -0
- package/dist/cli/run-cli/commands/init.js +5 -14
- package/dist/cli/run-cli/error-guidance.d.ts +9 -0
- package/dist/cli/run-cli/error-guidance.d.ts.map +1 -0
- package/dist/cli/run-cli/error-guidance.js +180 -0
- package/dist/cli/run-cli/globals.d.ts +22 -0
- package/dist/cli/run-cli/globals.d.ts.map +1 -0
- package/dist/cli/run-cli/globals.js +197 -0
- package/dist/cli/run-cli/update-warning.d.ts +6 -0
- package/dist/cli/run-cli/update-warning.d.ts.map +1 -0
- package/dist/cli/run-cli/update-warning.js +64 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +5 -476
- package/dist/cli/spec/docs-render.d.ts.map +1 -1
- package/dist/cli/spec/docs-render.js +14 -1
- package/dist/commands/doctor/archive.d.ts +4 -0
- package/dist/commands/doctor/archive.d.ts.map +1 -0
- package/dist/commands/doctor/archive.js +211 -0
- package/dist/commands/doctor/fixes.d.ts +9 -0
- package/dist/commands/doctor/fixes.d.ts.map +1 -0
- package/dist/commands/doctor/fixes.js +40 -0
- package/dist/commands/doctor/layering.d.ts +2 -0
- package/dist/commands/doctor/layering.d.ts.map +1 -0
- package/dist/commands/doctor/layering.js +87 -0
- package/dist/commands/doctor/runtime.d.ts +4 -0
- package/dist/commands/doctor/runtime.d.ts.map +1 -0
- package/dist/commands/doctor/runtime.js +56 -0
- package/dist/commands/doctor/workflow.d.ts +6 -0
- package/dist/commands/doctor/workflow.d.ts.map +1 -0
- package/dist/commands/doctor/workflow.js +62 -0
- package/dist/commands/doctor/workspace.d.ts +2 -0
- package/dist/commands/doctor/workspace.d.ts.map +1 -0
- package/dist/commands/doctor/workspace.js +165 -0
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +16 -305
- package/dist/commands/doctor.spec.d.ts +1 -0
- package/dist/commands/doctor.spec.d.ts.map +1 -1
- package/dist/commands/doctor.spec.js +15 -1
- package/dist/commands/finish.run.d.ts.map +1 -1
- package/dist/commands/finish.run.js +1 -0
- package/dist/commands/finish.spec.d.ts +1 -0
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +23 -2
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +19 -0
- package/dist/commands/release/apply.command.d.ts +2 -7
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +159 -382
- package/dist/commands/release/apply.mutation.d.ts +7 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -0
- package/dist/commands/release/apply.mutation.js +107 -0
- package/dist/commands/release/apply.preflight.d.ts +25 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -0
- package/dist/commands/release/apply.preflight.js +338 -0
- package/dist/commands/release/apply.reporting.d.ts +4 -0
- package/dist/commands/release/apply.reporting.d.ts.map +1 -0
- package/dist/commands/release/apply.reporting.js +24 -0
- package/dist/commands/release/apply.types.d.ts +46 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -0
- package/dist/commands/release/apply.types.js +1 -0
- package/dist/commands/runtime.command.d.ts +28 -0
- package/dist/commands/runtime.command.d.ts.map +1 -0
- package/dist/commands/runtime.command.js +169 -0
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +7 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +3 -33
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +2 -2
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +2 -2
- package/dist/commands/task/close-noop.d.ts.map +1 -1
- package/dist/commands/task/close-noop.js +2 -2
- package/dist/commands/task/comment.js +2 -2
- package/dist/commands/task/derive.d.ts.map +1 -1
- package/dist/commands/task/derive.js +3 -3
- package/dist/commands/task/doc-template.d.ts +10 -0
- package/dist/commands/task/doc-template.d.ts.map +1 -0
- package/dist/commands/task/doc-template.js +104 -0
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +36 -1
- package/dist/commands/task/finish.d.ts +1 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +26 -10
- package/dist/commands/task/migrate-doc.command.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.command.js +5 -1
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +136 -2
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +4 -110
- package/dist/commands/task/new.spec.js +3 -3
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +5 -4
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +7 -52
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +2 -2
- package/dist/commands/task/shared/dependencies.d.ts +15 -0
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -0
- package/dist/commands/task/shared/dependencies.js +143 -0
- package/dist/commands/task/shared/docs.d.ts +21 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -0
- package/dist/commands/task/shared/docs.js +121 -0
- package/dist/commands/task/shared/listing.d.ts +20 -0
- package/dist/commands/task/shared/listing.d.ts.map +1 -0
- package/dist/commands/task/shared/listing.js +127 -0
- package/dist/commands/task/shared/tags.d.ts +24 -0
- package/dist/commands/task/shared/tags.d.ts.map +1 -0
- package/dist/commands/task/shared/tags.js +177 -0
- package/dist/commands/task/shared/transitions.d.ts +42 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -0
- package/dist/commands/task/shared/transitions.js +175 -0
- package/dist/commands/task/shared.d.ts +5 -106
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +5 -681
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +7 -5
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +9 -25
- package/dist/commands/task/verify-show.command.d.ts.map +1 -1
- package/dist/commands/task/verify-show.command.js +5 -1
- package/dist/commands/upgrade/apply.d.ts +44 -0
- package/dist/commands/upgrade/apply.d.ts.map +1 -0
- package/dist/commands/upgrade/apply.js +180 -0
- package/dist/commands/upgrade/report.d.ts +21 -0
- package/dist/commands/upgrade/report.d.ts.map +1 -0
- package/dist/commands/upgrade/report.js +81 -0
- package/dist/commands/upgrade/source.d.ts +35 -0
- package/dist/commands/upgrade/source.d.ts.map +1 -0
- package/dist/commands/upgrade/source.js +109 -0
- package/dist/commands/upgrade/types.d.ts +31 -0
- package/dist/commands/upgrade/types.d.ts.map +1 -0
- package/dist/commands/upgrade/types.js +1 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +11 -7
- package/dist/commands/upgrade.d.ts +1 -35
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +54 -320
- package/dist/shared/diagnostics.d.ts +23 -0
- package/dist/shared/diagnostics.d.ts.map +1 -0
- package/dist/shared/diagnostics.js +57 -0
- package/dist/shared/errors.d.ts +2 -0
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +2 -0
- package/dist/shared/repo-cli-version.d.ts +13 -0
- package/dist/shared/repo-cli-version.d.ts.map +1 -0
- package/dist/shared/repo-cli-version.js +63 -0
- package/dist/shared/runtime-source.d.ts +33 -0
- package/dist/shared/runtime-source.d.ts.map +1 -0
- package/dist/shared/runtime-source.js +156 -0
- package/dist/shared/version-compare.d.ts +7 -0
- package/dist/shared/version-compare.d.ts.map +1 -0
- package/dist/shared/version-compare.js +30 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.run.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.run.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAYrD,eAAO,MAAM,SAAS,EAAE,cAAc,CAAC,YAAY,CAuDlD,CAAC"}
|
|
@@ -1,316 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { resolveProject } from "@agentplaneorg/core";
|
|
1
|
+
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
4
2
|
import { warnMessage, successMessage } from "../cli/output.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
async function walk(absDir) {
|
|
13
|
-
const entries = await fs.readdir(absDir, { withFileTypes: true });
|
|
14
|
-
for (const ent of entries) {
|
|
15
|
-
if (ent.name.startsWith("."))
|
|
16
|
-
continue;
|
|
17
|
-
if (ent.name === "__snapshots__")
|
|
18
|
-
continue;
|
|
19
|
-
if (ent.name === "node_modules")
|
|
20
|
-
continue;
|
|
21
|
-
const abs = path.join(absDir, ent.name);
|
|
22
|
-
if (ent.isDirectory()) {
|
|
23
|
-
await walk(abs);
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (ent.isFile() && ent.name.endsWith(".ts")) {
|
|
27
|
-
out.push({ absPath: abs, relPath: path.relative(rootDir, abs) });
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
await walk(rootDir);
|
|
32
|
-
return out;
|
|
33
|
-
}
|
|
34
|
-
function extractImports(source) {
|
|
35
|
-
const imports = [];
|
|
36
|
-
const re = /^\s*import\s+(?:type\s+)?(?:[^"']*?\s+from\s+)?["']([^"']+)["']\s*;?/gm;
|
|
37
|
-
for (const match of source.matchAll(re)) {
|
|
38
|
-
imports.push(match[1] ?? "");
|
|
39
|
-
}
|
|
40
|
-
return imports.filter(Boolean);
|
|
41
|
-
}
|
|
42
|
-
async function pathExists(absPath) {
|
|
43
|
-
try {
|
|
44
|
-
await fs.access(absPath);
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async function isDirectory(absPath) {
|
|
52
|
-
try {
|
|
53
|
-
const st = await fs.stat(absPath);
|
|
54
|
-
return st.isDirectory();
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
async function checkWorkspace(repoRoot) {
|
|
61
|
-
const problems = [];
|
|
62
|
-
const requiredFiles = [path.join(repoRoot, ".agentplane", "config.json")];
|
|
63
|
-
for (const filePath of requiredFiles) {
|
|
64
|
-
if (!(await pathExists(filePath))) {
|
|
65
|
-
problems.push(`Missing required file: ${path.relative(repoRoot, filePath)}`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const gateway = await resolvePolicyGatewayForRepo({
|
|
69
|
-
gitRoot: repoRoot,
|
|
70
|
-
fallbackFlavor: "codex",
|
|
71
|
-
});
|
|
72
|
-
if (!(await pathExists(gateway.absPath))) {
|
|
73
|
-
problems.push("Missing required policy gateway file: AGENTS.md or CLAUDE.md");
|
|
74
|
-
}
|
|
75
|
-
const agentsDir = path.join(repoRoot, ".agentplane", "agents");
|
|
76
|
-
if (!(await isDirectory(agentsDir))) {
|
|
77
|
-
problems.push("Missing required directory: .agentplane/agents");
|
|
78
|
-
return problems;
|
|
79
|
-
}
|
|
80
|
-
const entries = await fs.readdir(agentsDir);
|
|
81
|
-
const hasJson = entries.some((name) => name.endsWith(".json"));
|
|
82
|
-
if (!hasJson) {
|
|
83
|
-
problems.push("No agent profiles found in .agentplane/agents (*.json expected).");
|
|
84
|
-
}
|
|
85
|
-
return problems;
|
|
86
|
-
}
|
|
87
|
-
async function checkLayering(repoRoot) {
|
|
88
|
-
const problems = [];
|
|
89
|
-
const agentplaneSrcRoot = path.join(repoRoot, "packages", "agentplane", "src");
|
|
90
|
-
if (!(await isDirectory(agentplaneSrcRoot))) {
|
|
91
|
-
problems.push("Dev source checks requested but packages/agentplane/src was not found in this workspace.");
|
|
92
|
-
return problems;
|
|
93
|
-
}
|
|
94
|
-
const cliRoot = path.join(agentplaneSrcRoot, "cli");
|
|
95
|
-
const cliFiles = await listTsFiles(cliRoot);
|
|
96
|
-
for (const f of cliFiles) {
|
|
97
|
-
const src = await fs.readFile(f.absPath, "utf8");
|
|
98
|
-
const imports = extractImports(src);
|
|
99
|
-
const hits = imports.filter((s) => s.includes("/adapters/") ||
|
|
100
|
-
s.includes("../adapters") ||
|
|
101
|
-
s.includes("../../adapters") ||
|
|
102
|
-
s.includes("../../../adapters"));
|
|
103
|
-
if (hits.length > 0) {
|
|
104
|
-
problems.push(`${f.relPath} imports adapters directly: ${hits.join(", ")}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const roots = [path.join(agentplaneSrcRoot, "usecases"), path.join(agentplaneSrcRoot, "ports")];
|
|
108
|
-
const banned = [
|
|
109
|
-
"node:fs",
|
|
110
|
-
"node:fs/promises",
|
|
111
|
-
"fs",
|
|
112
|
-
"fs/promises",
|
|
113
|
-
"node:path",
|
|
114
|
-
"path",
|
|
115
|
-
"simple-git",
|
|
116
|
-
"isomorphic-git",
|
|
117
|
-
];
|
|
118
|
-
for (const root of roots) {
|
|
119
|
-
const files = await listTsFiles(root);
|
|
120
|
-
for (const f of files) {
|
|
121
|
-
const src = await fs.readFile(f.absPath, "utf8");
|
|
122
|
-
const imports = extractImports(src);
|
|
123
|
-
const hits = imports.filter((s) => banned.some((b) => s === b || s.startsWith(`${b}/`)));
|
|
124
|
-
if (hits.length > 0) {
|
|
125
|
-
problems.push(`${f.relPath} imports banned modules: ${hits.join(", ")}`);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return problems;
|
|
130
|
-
}
|
|
131
|
-
async function safeFixGitignore(repoRoot) {
|
|
132
|
-
const gitignorePath = path.join(repoRoot, ".gitignore");
|
|
133
|
-
let existing = "";
|
|
134
|
-
try {
|
|
135
|
-
existing = await fs.readFile(gitignorePath, "utf8");
|
|
136
|
-
}
|
|
137
|
-
catch {
|
|
138
|
-
// If .gitignore doesn't exist, do not create it implicitly (keep doctor safe).
|
|
139
|
-
return { changed: false, note: "Skip: .gitignore not found." };
|
|
140
|
-
}
|
|
141
|
-
const lines = existing.split(/\r?\n/);
|
|
142
|
-
const existingSet = new Set(lines.map((line) => line.trimEnd()));
|
|
143
|
-
const missing = RUNTIME_GITIGNORE_LINES.filter((line) => !existingSet.has(line));
|
|
144
|
-
if (missing.length === 0) {
|
|
145
|
-
return { changed: false, note: "OK: .gitignore already contains agentplane runtime ignores." };
|
|
146
|
-
}
|
|
147
|
-
const nextLines = [...lines];
|
|
148
|
-
if (nextLines.length > 0 && nextLines.at(-1) !== "")
|
|
149
|
-
nextLines.push("");
|
|
150
|
-
nextLines.push(...missing, "");
|
|
151
|
-
const next = `${nextLines.join("\n")}`.replaceAll(/\n{2,}$/g, "\n");
|
|
152
|
-
await fs.writeFile(gitignorePath, next, "utf8");
|
|
153
|
-
return {
|
|
154
|
-
changed: true,
|
|
155
|
-
note: `Fixed: added agentplane runtime ignores to .gitignore (${missing.length} lines).`,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
async function safeFixTaskIndex(repoRoot) {
|
|
159
|
-
try {
|
|
160
|
-
// Best-effort: rebuilding the index is a side-effect of listing tasks for the local backend.
|
|
161
|
-
const ctx = await loadCommandContext({ cwd: repoRoot, rootOverride: null });
|
|
162
|
-
await ctx.taskBackend.listTasks();
|
|
163
|
-
return { changed: true, note: "OK: rebuilt tasks index cache (best-effort)." };
|
|
164
|
-
}
|
|
165
|
-
catch {
|
|
166
|
-
return { changed: false, note: "Skip: could not rebuild tasks index cache." };
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
async function checkWorkflowContract(repoRoot) {
|
|
170
|
-
const result = await validateWorkflowAtPath(repoRoot);
|
|
171
|
-
const findings = result.diagnostics.map((d) => `[${d.severity}] ${d.code} ${d.path}: ${d.message}`);
|
|
172
|
-
emitWorkflowEvent({
|
|
173
|
-
event: "workflow_doctor_check",
|
|
174
|
-
details: { ok: result.ok, findings: result.diagnostics.length },
|
|
175
|
-
});
|
|
176
|
-
return findings;
|
|
177
|
-
}
|
|
178
|
-
function findingSeverity(problem) {
|
|
179
|
-
const normalized = problem.trimStart();
|
|
180
|
-
if (normalized.startsWith("[WARN]"))
|
|
181
|
-
return "WARN";
|
|
182
|
-
if (normalized.startsWith("[INFO]"))
|
|
183
|
-
return "INFO";
|
|
184
|
-
if (normalized.startsWith("[ERROR]"))
|
|
185
|
-
return "ERROR";
|
|
186
|
-
return "ERROR";
|
|
187
|
-
}
|
|
188
|
-
async function safeFixWorkflow(repoRoot) {
|
|
189
|
-
const paths = resolveWorkflowPaths(repoRoot);
|
|
190
|
-
let current = "";
|
|
191
|
-
let sourcePath = paths.workflowPath;
|
|
192
|
-
try {
|
|
193
|
-
current = await fs.readFile(paths.workflowPath, "utf8");
|
|
194
|
-
}
|
|
195
|
-
catch {
|
|
196
|
-
try {
|
|
197
|
-
current = await fs.readFile(paths.legacyWorkflowPath, "utf8");
|
|
198
|
-
sourcePath = paths.legacyWorkflowPath;
|
|
199
|
-
}
|
|
200
|
-
catch {
|
|
201
|
-
return { changed: false, note: "Skip: workflow contract file not found." };
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
const fixed = safeAutofixWorkflowText(current);
|
|
205
|
-
if (fixed.diagnostics.some((d) => d.code === "WF_FIX_SKIPPED_UNSAFE")) {
|
|
206
|
-
const details = fixed.diagnostics.map((d) => `${d.path}`).join(", ");
|
|
207
|
-
return {
|
|
208
|
-
changed: false,
|
|
209
|
-
note: `Skip: unsafe workflow autofix required (unknown keys). Proposed manual review: ${details}`,
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
if (!fixed.changed) {
|
|
213
|
-
if (sourcePath === paths.workflowPath) {
|
|
214
|
-
return { changed: false, note: "OK: workflow contract already normalized." };
|
|
215
|
-
}
|
|
216
|
-
await fs.mkdir(path.dirname(paths.workflowPath), { recursive: true });
|
|
217
|
-
await fs.writeFile(paths.workflowPath, current, "utf8");
|
|
218
|
-
await fs.rm(paths.legacyWorkflowPath, { force: true });
|
|
219
|
-
await fs.mkdir(paths.workflowDir, { recursive: true });
|
|
220
|
-
await fs.copyFile(paths.workflowPath, paths.lastKnownGoodPath);
|
|
221
|
-
return {
|
|
222
|
-
changed: true,
|
|
223
|
-
note: "Fixed: moved legacy WORKFLOW.md into .agentplane and refreshed last-known-good.",
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
await fs.mkdir(path.dirname(paths.workflowPath), { recursive: true });
|
|
227
|
-
await fs.writeFile(paths.workflowPath, fixed.text, "utf8");
|
|
228
|
-
if (sourcePath === paths.legacyWorkflowPath) {
|
|
229
|
-
await fs.rm(paths.legacyWorkflowPath, { force: true });
|
|
230
|
-
}
|
|
231
|
-
await fs.mkdir(paths.workflowDir, { recursive: true });
|
|
232
|
-
await fs.copyFile(paths.workflowPath, paths.lastKnownGoodPath);
|
|
233
|
-
return {
|
|
234
|
-
changed: true,
|
|
235
|
-
note: "Fixed: normalized workflow contract and refreshed last-known-good.",
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
async function checkDoneTaskCommitInvariants(repoRoot) {
|
|
239
|
-
const tasksPath = path.join(repoRoot, ".agentplane", "tasks.json");
|
|
240
|
-
let raw = "";
|
|
241
|
-
try {
|
|
242
|
-
raw = await fs.readFile(tasksPath, "utf8");
|
|
243
|
-
}
|
|
244
|
-
catch {
|
|
245
|
-
return [];
|
|
246
|
-
}
|
|
247
|
-
let parsed;
|
|
248
|
-
try {
|
|
249
|
-
parsed = JSON.parse(raw);
|
|
250
|
-
}
|
|
251
|
-
catch {
|
|
252
|
-
return [`Invalid JSON snapshot: ${path.relative(repoRoot, tasksPath)}`];
|
|
253
|
-
}
|
|
254
|
-
const all = Array.isArray(parsed.tasks) ? parsed.tasks : [];
|
|
255
|
-
const done = all.filter((t) => {
|
|
256
|
-
const status = typeof t.status === "string" ? t.status : "";
|
|
257
|
-
return status.toUpperCase() === "DONE";
|
|
258
|
-
});
|
|
259
|
-
if (done.length === 0)
|
|
260
|
-
return [];
|
|
261
|
-
const problems = [];
|
|
262
|
-
const hashes = new Set();
|
|
263
|
-
for (const task of done) {
|
|
264
|
-
const id = typeof task.id === "string" ? task.id : "<unknown>";
|
|
265
|
-
const hash = typeof task.commit?.hash === "string" ? task.commit.hash.trim() : "";
|
|
266
|
-
if (!hash) {
|
|
267
|
-
problems.push(`DONE task is missing implementation commit hash: ${id} (finish with --commit <hash>).`);
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
hashes.add(hash);
|
|
271
|
-
}
|
|
272
|
-
if (hashes.size === 0)
|
|
273
|
-
return problems;
|
|
274
|
-
const subjectByHash = new Map();
|
|
275
|
-
for (const hash of hashes) {
|
|
276
|
-
try {
|
|
277
|
-
const { stdout } = await execFileAsync("git", ["show", "-s", "--format=%s", hash], {
|
|
278
|
-
cwd: repoRoot,
|
|
279
|
-
env: gitEnv(),
|
|
280
|
-
});
|
|
281
|
-
subjectByHash.set(hash, String(stdout ?? "").trim());
|
|
282
|
-
}
|
|
283
|
-
catch {
|
|
284
|
-
subjectByHash.set(hash, "");
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
for (const task of done) {
|
|
288
|
-
const id = typeof task.id === "string" ? task.id : "<unknown>";
|
|
289
|
-
const hash = typeof task.commit?.hash === "string" ? task.commit.hash.trim() : "";
|
|
290
|
-
if (!hash)
|
|
291
|
-
continue;
|
|
292
|
-
const subject = subjectByHash.get(hash) ?? "";
|
|
293
|
-
if (!subject) {
|
|
294
|
-
problems.push(`[WARN] DONE task references unknown commit hash: ${id} -> ${hash}`);
|
|
295
|
-
continue;
|
|
296
|
-
}
|
|
297
|
-
if (/\bclose:/iu.test(subject)) {
|
|
298
|
-
problems.push(`[WARN] DONE task implementation commit points to a close commit: ${id} -> ${hash} (${subject})`);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return problems;
|
|
302
|
-
}
|
|
3
|
+
import { checkDoneTaskCommitInvariants } from "./doctor/archive.js";
|
|
4
|
+
import { safeFixGitignore, safeFixTaskIndex } from "./doctor/fixes.js";
|
|
5
|
+
import { checkLayering } from "./doctor/layering.js";
|
|
6
|
+
import { checkRuntimeSourceFacts, findingSeverity } from "./doctor/runtime.js";
|
|
7
|
+
import { checkWorkspace } from "./doctor/workspace.js";
|
|
8
|
+
import { checkWorkflowContract, safeFixWorkflow } from "./doctor/workflow.js";
|
|
9
|
+
import { isWorkflowEnforcementDisabled, workflowEnforcementEnvHint, } from "../workflow-runtime/index.js";
|
|
303
10
|
export const runDoctor = async (ctx, p) => {
|
|
304
11
|
const resolved = await resolveProject({ cwd: ctx.cwd, rootOverride: ctx.rootOverride ?? null });
|
|
305
12
|
const repoRoot = resolved.gitRoot;
|
|
13
|
+
const loadedConfig = await loadConfig(resolved.agentplaneDir);
|
|
306
14
|
const runChecks = async () => {
|
|
307
|
-
|
|
308
|
-
|
|
15
|
+
let checks = [
|
|
16
|
+
...(await checkWorkspace(repoRoot)),
|
|
17
|
+
...checkRuntimeSourceFacts(ctx.cwd, loadedConfig.config),
|
|
18
|
+
...(await checkDoneTaskCommitInvariants(repoRoot, { fullArchive: p.archiveFull })),
|
|
19
|
+
];
|
|
309
20
|
if (!isWorkflowEnforcementDisabled()) {
|
|
310
|
-
checks
|
|
21
|
+
checks = [...checks, ...(await checkWorkflowContract(repoRoot))];
|
|
311
22
|
}
|
|
312
23
|
if (p.dev) {
|
|
313
|
-
checks
|
|
24
|
+
checks = [...checks, ...(await checkLayering(repoRoot))];
|
|
314
25
|
}
|
|
315
26
|
return checks;
|
|
316
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.spec.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.spec.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAkChD,CAAC"}
|
|
@@ -10,11 +10,25 @@ export const doctorSpec = {
|
|
|
10
10
|
default: false,
|
|
11
11
|
description: "Run monorepo source-layer checks (requires packages/agentplane/src).",
|
|
12
12
|
},
|
|
13
|
+
{
|
|
14
|
+
kind: "boolean",
|
|
15
|
+
name: "archive-full",
|
|
16
|
+
default: false,
|
|
17
|
+
description: "Run the full historical task archive audit instead of the bounded recent scan.",
|
|
18
|
+
},
|
|
13
19
|
],
|
|
14
20
|
examples: [
|
|
15
21
|
{ cmd: "agentplane doctor", why: "Check installed workspace invariants." },
|
|
22
|
+
{
|
|
23
|
+
cmd: "agentplane doctor --archive-full",
|
|
24
|
+
why: "Also scan the full historical task archive for older commit anomalies.",
|
|
25
|
+
},
|
|
16
26
|
{ cmd: "agentplane doctor --dev", why: "Also run monorepo source-layer checks." },
|
|
17
27
|
{ cmd: "agentplane doctor --fix", why: "Apply safe-only fixes (idempotent)." },
|
|
18
28
|
],
|
|
19
|
-
parse: (raw) => ({
|
|
29
|
+
parse: (raw) => ({
|
|
30
|
+
fix: raw.opts.fix === true,
|
|
31
|
+
dev: raw.opts.dev === true,
|
|
32
|
+
archiveFull: raw.opts["archive-full"] === true,
|
|
33
|
+
}),
|
|
20
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finish.run.d.ts","sourceRoot":"","sources":["../../src/commands/finish.run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEjE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACrE,KAAK,UAAU,EAAE,GAAG,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"finish.run.d.ts","sourceRoot":"","sources":["../../src/commands/finish.run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEjE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACrE,KAAK,UAAU,EAAE,GAAG,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,CAuCjE"}
|
|
@@ -36,6 +36,7 @@ export function makeRunFinishHandler(getCtx) {
|
|
|
36
36
|
statusCommitRequireClean: p.statusCommitRequireClean,
|
|
37
37
|
confirmStatusCommit: p.confirmStatusCommit,
|
|
38
38
|
closeCommit: p.closeCommit,
|
|
39
|
+
noCloseCommit: p.noCloseCommit,
|
|
39
40
|
closeUnstageOthers: p.closeUnstageOthers,
|
|
40
41
|
quiet: p.quiet,
|
|
41
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finish.spec.d.ts","sourceRoot":"","sources":["../../src/commands/finish.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AASvD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"finish.spec.d.ts","sourceRoot":"","sources":["../../src/commands/finish.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AASvD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CA6ThD,CAAC"}
|
|
@@ -145,6 +145,12 @@ export const finishSpec = {
|
|
|
145
145
|
default: false,
|
|
146
146
|
description: "After finishing, run a deterministic close commit for the task README (single-task only).",
|
|
147
147
|
},
|
|
148
|
+
{
|
|
149
|
+
kind: "boolean",
|
|
150
|
+
name: "no-close-commit",
|
|
151
|
+
default: false,
|
|
152
|
+
description: "Disable the default deterministic close commit in direct mode (single-task only).",
|
|
153
|
+
},
|
|
148
154
|
{
|
|
149
155
|
kind: "boolean",
|
|
150
156
|
name: "close-unstage-others",
|
|
@@ -228,12 +234,26 @@ export const finishSpec = {
|
|
|
228
234
|
message: "--close-commit requires exactly one task id",
|
|
229
235
|
});
|
|
230
236
|
}
|
|
231
|
-
if (raw.opts["close-commit"] === true &&
|
|
237
|
+
if (raw.opts["no-close-commit"] === true && taskIds.length !== 1) {
|
|
238
|
+
throw usageError({
|
|
239
|
+
spec: finishSpec,
|
|
240
|
+
command: "finish",
|
|
241
|
+
message: "--no-close-commit requires exactly one task id",
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
if (raw.opts["close-commit"] === true && raw.opts["no-close-commit"] === true) {
|
|
245
|
+
throw usageError({
|
|
246
|
+
spec: finishSpec,
|
|
247
|
+
command: "finish",
|
|
248
|
+
message: "--close-commit and --no-close-commit are mutually exclusive",
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
if ((raw.opts["close-commit"] === true || raw.opts["no-close-commit"] === true) &&
|
|
232
252
|
(raw.opts["commit-from-comment"] === true || raw.opts["status-commit"] === true)) {
|
|
233
253
|
throw usageError({
|
|
234
254
|
spec: finishSpec,
|
|
235
255
|
command: "finish",
|
|
236
|
-
message: "--close-commit cannot be combined with --commit-from-comment/--status-commit",
|
|
256
|
+
message: "--close-commit/--no-close-commit cannot be combined with --commit-from-comment/--status-commit",
|
|
237
257
|
});
|
|
238
258
|
}
|
|
239
259
|
if (raw.opts["close-unstage-others"] === true && raw.opts["close-commit"] !== true) {
|
|
@@ -279,6 +299,7 @@ export const finishSpec = {
|
|
|
279
299
|
statusCommitRequireClean: raw.opts["status-commit-require-clean"] === true,
|
|
280
300
|
confirmStatusCommit: raw.opts["confirm-status-commit"] === true,
|
|
281
301
|
closeCommit: raw.opts["close-commit"] === true,
|
|
302
|
+
noCloseCommit: raw.opts["no-close-commit"] === true,
|
|
282
303
|
closeUnstageOthers: raw.opts["close-unstage-others"] === true,
|
|
283
304
|
quiet: raw.opts.quiet === true,
|
|
284
305
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/guard/impl/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/guard/impl/commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQvF,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAuExE,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBlB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBlB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAa9E;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgKlB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mapCoreError } from "../../../cli/error-map.js";
|
|
2
2
|
import { successMessage } from "../../../cli/output.js";
|
|
3
|
+
import { withDiagnosticContext } from "../../../shared/diagnostics.js";
|
|
3
4
|
import { CliError } from "../../../shared/errors.js";
|
|
4
5
|
import { loadCommandContext } from "../../shared/task-backend.js";
|
|
5
6
|
import { loadTaskFromContext } from "../../shared/task-backend.js";
|
|
@@ -50,6 +51,15 @@ function asCommitFailure(err) {
|
|
|
50
51
|
exitCode: 5,
|
|
51
52
|
code: "E_GIT",
|
|
52
53
|
message: lines.join("\n"),
|
|
54
|
+
context: withDiagnosticContext({ command: "commit" }, {
|
|
55
|
+
state: "git rejected the generated close commit",
|
|
56
|
+
likelyCause: "a hook or commit policy blocked the deterministic task close commit after the task README was staged",
|
|
57
|
+
nextAction: {
|
|
58
|
+
command: "git status --short --untracked-files=no",
|
|
59
|
+
reason: "inspect the staged close-commit payload before fixing the hook or policy failure",
|
|
60
|
+
reasonCode: "git_close_commit_blocked",
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
53
63
|
});
|
|
54
64
|
}
|
|
55
65
|
return null;
|
|
@@ -150,6 +160,15 @@ export async function cmdCommit(opts) {
|
|
|
150
160
|
exitCode: 5,
|
|
151
161
|
code: "E_GIT",
|
|
152
162
|
message: "Staged files exist (close commit requires an empty index; rerun with --unstage-others to auto-unstage).",
|
|
163
|
+
context: withDiagnosticContext({ command: "commit" }, {
|
|
164
|
+
state: "close commit cannot run with a non-empty git index",
|
|
165
|
+
likelyCause: "deterministic close commits only stage the task README, but other staged files are already in the index",
|
|
166
|
+
nextAction: {
|
|
167
|
+
command: "git restore --staged -- .",
|
|
168
|
+
reason: "clear the current index before rerunning the close commit flow",
|
|
169
|
+
reasonCode: "git_close_commit_dirty_index",
|
|
170
|
+
},
|
|
171
|
+
}),
|
|
153
172
|
});
|
|
154
173
|
}
|
|
155
174
|
const task = await loadTaskFromContext({ ctx, taskId: opts.taskId });
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
-
|
|
3
|
-
plan?: string;
|
|
4
|
-
yes: boolean;
|
|
5
|
-
push: boolean;
|
|
6
|
-
remote: string;
|
|
7
|
-
};
|
|
8
|
-
export type ReleaseApplyParsed = ReleaseApplyFlags;
|
|
2
|
+
import type { ReleaseApplyParsed } from "./apply.types.js";
|
|
9
3
|
export declare const releaseApplySpec: CommandSpec<ReleaseApplyParsed>;
|
|
10
4
|
export declare const runReleaseApply: CommandHandler<ReleaseApplyParsed>;
|
|
5
|
+
export { pushReleaseRefs } from "./apply.reporting.js";
|
|
11
6
|
//# sourceMappingURL=apply.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.command.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA4B1E,OAAO,KAAK,EAAE,kBAAkB,EAA0C,MAAM,kBAAkB,CAAC;AA2NnG,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAiF5D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAmE9D,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|