agentplane 0.2.26 → 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/README.md +3 -1
- package/assets/AGENTS.md +123 -526
- package/assets/agents/UPGRADER.json +10 -9
- package/assets/framework.manifest.json +112 -7
- package/assets/policy/check-routing.mjs +180 -0
- package/assets/policy/dod.code.md +25 -0
- package/assets/policy/dod.core.md +32 -0
- package/assets/policy/dod.docs.md +32 -0
- package/assets/policy/examples/migration-note.md +6 -0
- package/assets/policy/examples/pr-note.md +16 -0
- package/assets/policy/examples/unit-test-pattern.md +19 -0
- package/assets/policy/governance.md +37 -0
- package/assets/policy/incidents.md +36 -0
- package/assets/policy/security.must.md +7 -0
- package/assets/policy/workflow.branch_pr.md +34 -0
- package/assets/policy/workflow.direct.md +46 -0
- package/assets/policy/workflow.md +9 -0
- package/assets/policy/workflow.release.md +31 -0
- package/assets/policy/workflow.upgrade.md +20 -0
- package/bin/agentplane.js +41 -88
- package/bin/dist-guard.js +124 -0
- package/dist/.build-manifest.json +5 -5
- package/dist/agents/agents-template.d.ts +7 -0
- package/dist/agents/agents-template.d.ts.map +1 -1
- package/dist/agents/agents-template.js +41 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +18 -9
- package/dist/cli/command-snippets.d.ts +1 -1
- package/dist/cli/command-snippets.js +1 -1
- package/dist/cli/run-cli/commands/core.js +2 -2
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/ide.js +8 -3
- package/dist/cli/run-cli/commands/init/ui.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/ui.js +1 -2
- package/dist/cli/run-cli/commands/init/write-agents.d.ts +2 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-agents.js +24 -5
- package/dist/cli/run-cli/commands/init/write-workflow.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/write-workflow.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-workflow.js +6 -0
- package/dist/cli/run-cli/commands/init.d.ts +2 -0
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +47 -19
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +125 -7
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +11 -6
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +9 -4
- package/dist/commands/release/plan.command.d.ts.map +1 -1
- package/dist/commands/release/plan.command.js +9 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +32 -0
- package/dist/commands/task/doc.command.d.ts.map +1 -1
- package/dist/commands/task/doc.command.js +1 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +9 -1
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +41 -4
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +7 -1
- package/dist/commands/task/shared.d.ts +7 -0
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +37 -0
- package/dist/commands/task/start-ready.js +1 -1
- package/dist/commands/upgrade.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +2 -2
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +263 -294
- package/dist/commands/workflow-build.command.d.ts.map +1 -1
- package/dist/commands/workflow-build.command.js +7 -0
- package/dist/commands/workflow-playbook.command.d.ts.map +1 -1
- package/dist/commands/workflow-playbook.command.js +0 -1
- package/dist/shared/policy-gateway.d.ts +15 -0
- package/dist/shared/policy-gateway.d.ts.map +1 -0
- package/dist/shared/policy-gateway.js +49 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +1 -0
- package/dist/shared/runtime-artifacts.d.ts +2 -2
- package/dist/shared/runtime-artifacts.d.ts.map +1 -1
- package/dist/shared/runtime-artifacts.js +4 -0
- package/dist/workflow-runtime/build.d.ts +1 -1
- package/dist/workflow-runtime/build.d.ts.map +1 -1
- package/dist/workflow-runtime/build.js +14 -2
- package/package.json +2 -2
|
@@ -92,6 +92,9 @@ function changesMarkdown(changes) {
|
|
|
92
92
|
.join("\n")
|
|
93
93
|
.trim() + "\n");
|
|
94
94
|
}
|
|
95
|
+
function requiredBulletCount(changeCount) {
|
|
96
|
+
return Math.max(1, changeCount);
|
|
97
|
+
}
|
|
95
98
|
function releaseInstructions(opts) {
|
|
96
99
|
return (`# Release plan\n\n` +
|
|
97
100
|
`## Target\n\n` +
|
|
@@ -103,8 +106,10 @@ function releaseInstructions(opts) {
|
|
|
103
106
|
`## Agent task: write release notes\n\n` +
|
|
104
107
|
`Write English release notes as \`docs/releases/${opts.nextTag}.md\`.\n\n` +
|
|
105
108
|
`Rules:\n` +
|
|
106
|
-
`- Use human-readable bullets focused on outcomes and user-facing improvements.\n` +
|
|
107
|
-
`-
|
|
109
|
+
`- Use detailed, human-readable bullets focused on outcomes and user-facing improvements.\n` +
|
|
110
|
+
`- Cover all listed differences from \`changes.md\`; do not omit commits.\n` +
|
|
111
|
+
`- Keep one concrete bullet per listed change in plain language.\n` +
|
|
112
|
+
`- Write at least ${opts.minBullets} bullet points.\n` +
|
|
108
113
|
`- Do not include Cyrillic.\n` +
|
|
109
114
|
`- Use \`docs/releases/TEMPLATE.md\` as the structure.\n\n` +
|
|
110
115
|
`Inputs:\n` +
|
|
@@ -216,13 +221,14 @@ export const runReleasePlan = async (ctx, flags) => {
|
|
|
216
221
|
const nextVersion = bumpVersion(coreVersion, flags.bump);
|
|
217
222
|
const nextTag = `v${nextVersion}`;
|
|
218
223
|
const changes = await listChanges(gitRoot, prevTag);
|
|
224
|
+
const minBullets = requiredBulletCount(changes.length);
|
|
219
225
|
const runId = new Date().toISOString().replaceAll(":", "-").replaceAll(".", "-");
|
|
220
226
|
const baseDir = path.join(gitRoot, ".agentplane", ".release", "plan", runId);
|
|
221
227
|
await mkdir(baseDir, { recursive: true });
|
|
222
228
|
await writeFile(path.join(baseDir, "version.json"), JSON.stringify({ prevTag, prevVersion: coreVersion, nextTag, nextVersion, bump: flags.bump }, null, 2) + "\n", "utf8");
|
|
223
229
|
await writeFile(path.join(baseDir, "changes.json"), JSON.stringify(changes, null, 2) + "\n", "utf8");
|
|
224
230
|
await writeFile(path.join(baseDir, "changes.md"), changesMarkdown(changes), "utf8");
|
|
225
|
-
await writeFile(path.join(baseDir, "instructions.md"), releaseInstructions({ nextTag, prevTag, bump: flags.bump }), "utf8");
|
|
231
|
+
await writeFile(path.join(baseDir, "instructions.md"), releaseInstructions({ nextTag, prevTag, bump: flags.bump, minBullets }), "utf8");
|
|
226
232
|
process.stdout.write(`Release plan written: ${path.relative(gitRoot, baseDir)}\n`);
|
|
227
233
|
process.stdout.write(`Next tag: ${nextTag}\n`);
|
|
228
234
|
process.stdout.write(`Hint: Create a DOCS task to write docs/releases/${nextTag}.md based on this plan.\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/task/add.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/task/add.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAoCpF,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,MAAM,CAAC,CA6DlB"}
|
|
@@ -2,6 +2,33 @@ import { mapBackendError } from "../../cli/error-map.js";
|
|
|
2
2
|
import { CliError } from "../../shared/errors.js";
|
|
3
3
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
4
4
|
import { dedupeStrings, normalizeTaskStatus, nowIso } from "./shared.js";
|
|
5
|
+
import { ensureDocSections, setMarkdownSection } from "@agentplaneorg/core";
|
|
6
|
+
function defaultTaskDoc(opts) {
|
|
7
|
+
const baseDoc = ensureDocSections("", opts.requiredSections);
|
|
8
|
+
const summary = `${opts.title}\n\n${opts.description}`;
|
|
9
|
+
const scope = [
|
|
10
|
+
`- In scope: ${opts.description}.`,
|
|
11
|
+
`- Out of scope: unrelated refactors not required for "${opts.title}".`,
|
|
12
|
+
].join("\n");
|
|
13
|
+
const plan = [
|
|
14
|
+
`1. Implement the change for "${opts.title}".`,
|
|
15
|
+
"2. Run required checks and capture verification evidence.",
|
|
16
|
+
"3. Finalize task notes and finish with traceable commit metadata.",
|
|
17
|
+
].join("\n");
|
|
18
|
+
const risks = [
|
|
19
|
+
"- Risk: hidden regressions in touched paths.",
|
|
20
|
+
"- Mitigation: run required checks before finish and record evidence.",
|
|
21
|
+
].join("\n");
|
|
22
|
+
const rollback = [
|
|
23
|
+
"- Revert task-related commit(s).",
|
|
24
|
+
"- Re-run required checks to confirm rollback safety.",
|
|
25
|
+
].join("\n");
|
|
26
|
+
const withSummary = setMarkdownSection(baseDoc, "Summary", summary);
|
|
27
|
+
const withScope = setMarkdownSection(withSummary, "Scope", scope);
|
|
28
|
+
const withPlan = setMarkdownSection(withScope, "Plan", plan);
|
|
29
|
+
const withRisks = setMarkdownSection(withPlan, "Risks", risks);
|
|
30
|
+
return setMarkdownSection(withRisks, "Rollback Plan", rollback);
|
|
31
|
+
}
|
|
5
32
|
export async function cmdTaskAdd(opts) {
|
|
6
33
|
try {
|
|
7
34
|
const ctx = opts.ctx ??
|
|
@@ -39,6 +66,11 @@ export async function cmdTaskAdd(opts) {
|
|
|
39
66
|
doc_updated_at: nowIso(),
|
|
40
67
|
doc_updated_by: docUpdatedBy,
|
|
41
68
|
id_source: "explicit",
|
|
69
|
+
doc: defaultTaskDoc({
|
|
70
|
+
requiredSections: ctx.config.tasks.doc.required_sections,
|
|
71
|
+
title: opts.title,
|
|
72
|
+
description: opts.description,
|
|
73
|
+
}),
|
|
42
74
|
}));
|
|
43
75
|
if (ctx.taskBackend.writeTasks) {
|
|
44
76
|
await ctx.taskBackend.writeTasks(tasks);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtE,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"doc.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/doc.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtE,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAelD,CAAC;AAEF,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAK9E"}
|
|
@@ -6,6 +6,7 @@ export const taskDocSpec = {
|
|
|
6
6
|
synopsis: [
|
|
7
7
|
"agentplane task doc show <task-id> [--section <name>] [--quiet]",
|
|
8
8
|
"agentplane task doc set <task-id> --section <name> (--text <text> | --file <path>) [--updated-by <id>]",
|
|
9
|
+
"agentplane task doc set <task-id> --section Summary --file ./task-readme.md # if payload contains multiple known ## headings, apply as full-doc update",
|
|
9
10
|
],
|
|
10
11
|
args: [{ name: "subcommand", required: false, valueHint: "<show|set>" }],
|
|
11
12
|
parse: (raw) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finish.d.ts","sourceRoot":"","sources":["../../../src/commands/task/finish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"finish.d.ts","sourceRoot":"","sources":["../../../src/commands/task/finish.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAoCnC,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,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,CAAC,EAAE,OAAO,CAAC;IACd,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,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsWlB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ensureDocSections } from "@agentplaneorg/core";
|
|
1
2
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
2
3
|
import { invalidValueMessage, successMessage } from "../../cli/output.js";
|
|
3
4
|
import { formatCommentBodyForCommit } from "../../shared/comment-format.js";
|
|
@@ -10,7 +11,7 @@ import { ensureReconciledBeforeMutation } from "../shared/reconcile-check.js";
|
|
|
10
11
|
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
11
12
|
import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
|
|
12
13
|
import { readDirectWorkLock } from "../../shared/direct-work-lock.js";
|
|
13
|
-
import { appendTaskEvent, defaultCommitEmojiForStatus, enforceStatusCommitPolicy, ensureVerificationSatisfiedIfRequired, nowIso, readCommitInfo, readHeadCommit, requireStructuredComment, resolvePrimaryTag, toStringArray, } from "./shared.js";
|
|
14
|
+
import { appendTaskEvent, defaultCommitEmojiForStatus, enforceStatusCommitPolicy, ensureAgentFilledRequiredDocSections, ensureVerificationSatisfiedIfRequired, nowIso, readCommitInfo, readHeadCommit, requireStructuredComment, resolvePrimaryTag, toStringArray, } from "./shared.js";
|
|
14
15
|
async function clearDirectWorkLockIfMatches(opts) {
|
|
15
16
|
const lockPath = path.join(opts.agentplaneDir, "cache", "direct-work.json");
|
|
16
17
|
try {
|
|
@@ -139,6 +140,13 @@ export async function cmdFinish(opts) {
|
|
|
139
140
|
primaryTag = resolvePrimaryTag(toStringArray(task.tags), ctx).primary;
|
|
140
141
|
}
|
|
141
142
|
ensureVerificationSatisfiedIfRequired(task, ctx.config);
|
|
143
|
+
const normalizedDoc = ensureDocSections(typeof task.doc === "string" ? task.doc : "", ctx.config.tasks.doc.required_sections);
|
|
144
|
+
ensureAgentFilledRequiredDocSections({
|
|
145
|
+
task,
|
|
146
|
+
config: ctx.config,
|
|
147
|
+
doc: normalizedDoc,
|
|
148
|
+
action: "finish task",
|
|
149
|
+
});
|
|
142
150
|
if (taskId === metaTaskId) {
|
|
143
151
|
const tags = Array.isArray(task.tags)
|
|
144
152
|
? task.tags.filter((t) => typeof t === "string")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../../src/commands/task/new.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AASpF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC5C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../../src/commands/task/new.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AASpF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC5C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA6LF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,aAAa,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoFlB"}
|
|
@@ -66,7 +66,35 @@ function insertMarkdownSectionBefore(opts) {
|
|
|
66
66
|
const out = [...lines.slice(0, beforeIdx), ...sectionLines, ...lines.slice(beforeIdx)];
|
|
67
67
|
return `${out.join("\n").trimEnd()}\n`;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function buildDefaultSummary(opts) {
|
|
70
|
+
return `${opts.title}\n\n${opts.description}`;
|
|
71
|
+
}
|
|
72
|
+
function buildDefaultScope(opts) {
|
|
73
|
+
return [
|
|
74
|
+
`- In scope: ${opts.description}.`,
|
|
75
|
+
`- Out of scope: unrelated refactors not required for "${opts.title}".`,
|
|
76
|
+
].join("\n");
|
|
77
|
+
}
|
|
78
|
+
function buildDefaultPlan(opts) {
|
|
79
|
+
return [
|
|
80
|
+
`1. Implement the change for "${opts.title}".`,
|
|
81
|
+
"2. Run required checks and capture verification evidence.",
|
|
82
|
+
"3. Finalize task notes and finish with traceable commit metadata.",
|
|
83
|
+
].join("\n");
|
|
84
|
+
}
|
|
85
|
+
function buildDefaultRisks() {
|
|
86
|
+
return [
|
|
87
|
+
"- Risk: hidden regressions in touched paths.",
|
|
88
|
+
"- Mitigation: run required checks before finish and record evidence.",
|
|
89
|
+
].join("\n");
|
|
90
|
+
}
|
|
91
|
+
function buildDefaultRollbackPlan() {
|
|
92
|
+
return [
|
|
93
|
+
"- Revert task-related commit(s).",
|
|
94
|
+
"- Re-run required checks to confirm rollback safety.",
|
|
95
|
+
].join("\n");
|
|
96
|
+
}
|
|
97
|
+
function defaultTaskDoc(opts) {
|
|
70
98
|
const verifyStepsTemplate = [
|
|
71
99
|
"<!-- TODO: FILL VERIFY STEPS -->",
|
|
72
100
|
"",
|
|
@@ -93,14 +121,19 @@ function defaultTaskDoc(requiredSections) {
|
|
|
93
121
|
"<!-- BEGIN VERIFICATION RESULTS -->",
|
|
94
122
|
"<!-- END VERIFICATION RESULTS -->",
|
|
95
123
|
].join("\n");
|
|
96
|
-
const baseDoc = ensureDocSections("", requiredSections);
|
|
124
|
+
const baseDoc = ensureDocSections("", opts.requiredSections);
|
|
97
125
|
const withVerifySteps = insertMarkdownSectionBefore({
|
|
98
126
|
body: baseDoc,
|
|
99
127
|
section: "Verify Steps",
|
|
100
128
|
text: verifyStepsTemplate,
|
|
101
129
|
beforeSection: "Verification",
|
|
102
130
|
});
|
|
103
|
-
|
|
131
|
+
const withVerification = setMarkdownSection(withVerifySteps, "Verification", verificationTemplate);
|
|
132
|
+
const withSummary = setMarkdownSection(withVerification, "Summary", buildDefaultSummary({ title: opts.title, description: opts.description }));
|
|
133
|
+
const withScope = setMarkdownSection(withSummary, "Scope", buildDefaultScope({ title: opts.title, description: opts.description }));
|
|
134
|
+
const withPlan = setMarkdownSection(withScope, "Plan", buildDefaultPlan({ title: opts.title }));
|
|
135
|
+
const withRisks = setMarkdownSection(withPlan, "Risks", buildDefaultRisks());
|
|
136
|
+
return setMarkdownSection(withRisks, "Rollback Plan", buildDefaultRollbackPlan());
|
|
104
137
|
}
|
|
105
138
|
function buildDefaultVerifyStepsSection(opts) {
|
|
106
139
|
const checks = opts.verifyCommands.length > 0
|
|
@@ -150,7 +183,11 @@ export async function runTaskNewParsed(opts) {
|
|
|
150
183
|
doc_updated_at: nowIso(),
|
|
151
184
|
doc_updated_by: p.owner,
|
|
152
185
|
id_source: "generated",
|
|
153
|
-
doc: defaultTaskDoc(
|
|
186
|
+
doc: defaultTaskDoc({
|
|
187
|
+
requiredSections: ctx.config.tasks.doc.required_sections,
|
|
188
|
+
title: p.title,
|
|
189
|
+
description: p.description,
|
|
190
|
+
}),
|
|
154
191
|
};
|
|
155
192
|
const spikeTag = (ctx.config.tasks.verify.spike_tag ?? "spike").trim().toLowerCase();
|
|
156
193
|
const primary = resolvePrimaryTag(p.tags, ctx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/task/plan.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/task/plan.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAoDnC,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ElB;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAsFlB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAuDlB"}
|
|
@@ -6,7 +6,7 @@ import { backendNotSupportedMessage } from "../../cli/output.js";
|
|
|
6
6
|
import { CliError } from "../../shared/errors.js";
|
|
7
7
|
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
8
8
|
import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
|
|
9
|
-
import { extractDocSection, isVerifyStepsFilled, nowIso, requiresVerifyStepsByPrimary, toStringArray, } from "./shared.js";
|
|
9
|
+
import { ensureAgentFilledRequiredDocSections, extractDocSection, isVerifyStepsFilled, nowIso, requiresVerifyStepsByPrimary, toStringArray, } from "./shared.js";
|
|
10
10
|
async function loadPlanTask(opts) {
|
|
11
11
|
const ctx = opts.ctx ??
|
|
12
12
|
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
@@ -129,6 +129,12 @@ export async function cmdTaskPlanApprove(opts) {
|
|
|
129
129
|
message: `${task.id}: cannot approve plan: ## Plan section is missing or empty`,
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
+
ensureAgentFilledRequiredDocSections({
|
|
133
|
+
task,
|
|
134
|
+
config,
|
|
135
|
+
doc: baseDoc,
|
|
136
|
+
action: "approve plan",
|
|
137
|
+
});
|
|
132
138
|
const enforceVerifySteps = config.tasks.verify.enforce_on_plan_approve !== false;
|
|
133
139
|
if (enforceVerifySteps) {
|
|
134
140
|
const tags = toStringArray(task.tags);
|
|
@@ -8,6 +8,13 @@ export declare function nowIso(): string;
|
|
|
8
8
|
export declare const VERIFY_STEPS_PLACEHOLDER = "<!-- TODO: FILL VERIFY STEPS -->";
|
|
9
9
|
export declare function extractDocSection(doc: string, sectionName: string): string | null;
|
|
10
10
|
export declare function isVerifyStepsFilled(sectionText: string | null): boolean;
|
|
11
|
+
export declare function isDocSectionFilled(sectionText: string | null): boolean;
|
|
12
|
+
export declare function ensureAgentFilledRequiredDocSections(opts: {
|
|
13
|
+
task: Pick<TaskData, "id">;
|
|
14
|
+
config: AgentplaneConfig;
|
|
15
|
+
doc: string;
|
|
16
|
+
action: string;
|
|
17
|
+
}): void;
|
|
11
18
|
export declare function normalizeDependsOnInput(value: string): string[];
|
|
12
19
|
export declare function normalizeTaskStatus(value: string): string;
|
|
13
20
|
export declare function toStringArray(value: unknown): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK9C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAW5D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAKjG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,eAAO,MAAM,aAAa,+BAAsB,CAAC;AAiBjD,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAED,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBjF;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAKvE;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,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AAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAI5C;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMlE;AAED,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9B,eAAe,CAkFjB;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,OAAO,EAAE;QAAE,mBAAmB,CAAC,EAAE,MAAM,MAAM,EAAE,CAAA;KAAE,CAAC;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,IAAI,CAcP;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAiBnD"}
|
|
@@ -57,6 +57,43 @@ export function isVerifyStepsFilled(sectionText) {
|
|
|
57
57
|
return false;
|
|
58
58
|
return true;
|
|
59
59
|
}
|
|
60
|
+
const DOC_PLACEHOLDER_RE = /<!--\s*TODO\b/i;
|
|
61
|
+
const DOC_SECTIONS_AUTO_MANAGED = new Set(["verification"]);
|
|
62
|
+
const DOC_SECTIONS_CONDITIONAL = new Set(["verify steps", "notes"]);
|
|
63
|
+
export function isDocSectionFilled(sectionText) {
|
|
64
|
+
const normalized = (sectionText ?? "").trim();
|
|
65
|
+
if (!normalized)
|
|
66
|
+
return false;
|
|
67
|
+
if (DOC_PLACEHOLDER_RE.test(normalized))
|
|
68
|
+
return false;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
export function ensureAgentFilledRequiredDocSections(opts) {
|
|
72
|
+
const required = dedupeStrings((opts.config.tasks.doc.required_sections ?? [])
|
|
73
|
+
.map((section) => String(section ?? "").trim())
|
|
74
|
+
.filter(Boolean));
|
|
75
|
+
const missing = [];
|
|
76
|
+
for (const section of required) {
|
|
77
|
+
const normalizedSection = section.trim().toLowerCase();
|
|
78
|
+
if (DOC_SECTIONS_AUTO_MANAGED.has(normalizedSection))
|
|
79
|
+
continue;
|
|
80
|
+
if (DOC_SECTIONS_CONDITIONAL.has(normalizedSection))
|
|
81
|
+
continue;
|
|
82
|
+
const sectionText = extractDocSection(opts.doc, section);
|
|
83
|
+
if (!isDocSectionFilled(sectionText)) {
|
|
84
|
+
missing.push(section);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (missing.length === 0)
|
|
88
|
+
return;
|
|
89
|
+
const sectionList = missing.map((section) => `## ${section}`).join(", ");
|
|
90
|
+
throw new CliError({
|
|
91
|
+
exitCode: 3,
|
|
92
|
+
code: "E_VALIDATION",
|
|
93
|
+
message: `${opts.task.id}: cannot ${opts.action}: required task doc sections are missing/empty: ${sectionList} ` +
|
|
94
|
+
`(fill via \`agentplane task doc set ${opts.task.id} --section <name> --text "..."\`)`,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
60
97
|
export function normalizeDependsOnInput(value) {
|
|
61
98
|
const trimmed = value.trim();
|
|
62
99
|
if (!trimmed || trimmed === "[]")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CA2JlD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,aAAa,CACsB,CAAC"}
|
|
@@ -4,7 +4,7 @@ export const upgradeSpec = {
|
|
|
4
4
|
id: ["upgrade"],
|
|
5
5
|
group: "Setup",
|
|
6
6
|
summary: "Upgrade the local agentplane framework bundle in the repo.",
|
|
7
|
-
description: "Upgrades the local agentplane framework bundle in the repo using a strict manifest of managed files. By default, upgrade generates an agent-assisted plan from the locally installed agentplane package assets (no network) and does not modify files. Use --auto to apply changes. Use --remote to fetch a GitHub release bundle; network access is gated by config approvals.",
|
|
7
|
+
description: "Upgrades the local agentplane framework bundle in the repo using a strict manifest of managed files. By default, upgrade generates an agent-assisted plan from the locally installed agentplane package assets (no network) and does not modify files. Use --auto to apply changes and create a dedicated upgrade commit. Use --remote to fetch a GitHub release bundle; network access is gated by config approvals.",
|
|
8
8
|
options: [
|
|
9
9
|
{
|
|
10
10
|
kind: "boolean",
|
|
@@ -16,7 +16,7 @@ export const upgradeSpec = {
|
|
|
16
16
|
kind: "boolean",
|
|
17
17
|
name: "auto",
|
|
18
18
|
default: false,
|
|
19
|
-
description: "Apply the upgrade automatically (writes managed files).",
|
|
19
|
+
description: "Apply the upgrade automatically (writes managed files) and create a dedicated upgrade commit.",
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
kind: "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AAqCA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAiGF,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,MAAM,GAAG;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,CAWA;AAED,wBAAgB,iCAAiC,CAAC,IAAI,EAAE;IACtD,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,E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