agentplane 0.3.10 → 0.3.12
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 +2 -2
- package/assets/agents/CODER.json +4 -0
- package/assets/agents/CREATOR.json +1 -0
- package/assets/agents/DOCS.json +2 -1
- package/assets/agents/INTEGRATOR.json +2 -1
- package/assets/agents/ORCHESTRATOR.json +2 -0
- package/assets/agents/PLANNER.json +3 -1
- package/assets/agents/REVIEWER.json +1 -0
- package/assets/agents/TESTER.json +2 -2
- package/assets/agents/UPDATER.json +1 -0
- package/assets/agents/UPGRADER.json +1 -1
- package/assets/policy/governance.md +3 -4
- package/assets/policy/incidents.md +20 -88
- package/assets/policy/workflow.branch_pr.md +1 -1
- package/assets/policy/workflow.direct.md +2 -2
- package/bin/agentplane.js +114 -4
- package/bin/runtime-watch.js +1 -0
- package/bin/stale-dist-policy.d.ts +1 -1
- package/bin/stale-dist-policy.js +19 -1
- package/dist/.build-manifest.json +251 -166
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +3 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +2 -1
- package/dist/cli/command-invocations.d.ts.map +1 -1
- package/dist/cli/command-invocations.js +4 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +6 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +3 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +10 -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/commands/core/preflight.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core/preflight.js +44 -1
- package/dist/cli/run-cli.test-helpers.d.ts +1 -0
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +26 -0
- package/dist/commands/branch/cleanup-merged.d.ts +3 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +149 -36
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.js +137 -1
- package/dist/commands/cleanup/merged.command.d.ts +2 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
- package/dist/commands/cleanup/merged.command.js +24 -0
- package/dist/commands/doctor/branch-pr.d.ts +4 -0
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -0
- package/dist/commands/doctor/branch-pr.js +96 -0
- package/dist/commands/doctor/fixes.d.ts +5 -0
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +70 -0
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +6 -1
- package/dist/commands/finish.run.d.ts.map +1 -1
- package/dist/commands/finish.run.js +11 -0
- package/dist/commands/finish.spec.d.ts +11 -0
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +51 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -1
- package/dist/commands/guard/impl/close-message.js +23 -6
- package/dist/commands/guard/impl/commands.d.ts +1 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +94 -2
- package/dist/commands/guard/impl/env.d.ts +1 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +1 -0
- package/dist/commands/hooks/index.d.ts +1 -1
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +139 -6
- package/dist/commands/incidents/collect.command.d.ts.map +1 -1
- package/dist/commands/incidents/collect.command.js +12 -7
- package/dist/commands/incidents/incidents.command.js +1 -1
- package/dist/commands/incidents/shared.d.ts +34 -0
- package/dist/commands/incidents/shared.d.ts.map +1 -1
- package/dist/commands/incidents/shared.js +166 -12
- package/dist/commands/pr/check.d.ts.map +1 -1
- package/dist/commands/pr/check.js +241 -135
- package/dist/commands/pr/close-superseded.d.ts +9 -0
- package/dist/commands/pr/close-superseded.d.ts.map +1 -0
- package/dist/commands/pr/close-superseded.js +129 -0
- package/dist/commands/pr/close.d.ts +11 -0
- package/dist/commands/pr/close.d.ts.map +1 -0
- package/dist/commands/pr/close.js +116 -0
- package/dist/commands/pr/index.d.ts +2 -0
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +2 -0
- package/dist/commands/pr/integrate/artifacts.d.ts +7 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -1
- package/dist/commands/pr/integrate/artifacts.js +66 -1
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +43 -2
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts +8 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.js +59 -0
- package/dist/commands/pr/integrate/internal/cleanup.d.ts +1 -11
- package/dist/commands/pr/integrate/internal/cleanup.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/cleanup.js +1 -46
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/finalize.js +43 -12
- package/dist/commands/pr/integrate/internal/github-protection.d.ts +5 -0
- package/dist/commands/pr/integrate/internal/github-protection.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/github-protection.js +13 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/merge.js +36 -13
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts +13 -0
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.js +25 -0
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.d.ts +15 -0
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.js +35 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +4 -2
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +109 -38
- package/dist/commands/pr/internal/auto-commit.d.ts +7 -0
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -0
- package/dist/commands/pr/internal/auto-commit.js +64 -0
- package/dist/commands/pr/internal/freshness.d.ts +21 -0
- package/dist/commands/pr/internal/freshness.d.ts.map +1 -0
- package/dist/commands/pr/internal/freshness.js +52 -0
- package/dist/commands/pr/internal/gh-api.d.ts +6 -0
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -0
- package/dist/commands/pr/internal/gh-api.js +80 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +10 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
- package/dist/commands/pr/internal/pr-paths.js +10 -0
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -1
- package/dist/commands/pr/internal/review-template.js +37 -4
- package/dist/commands/pr/internal/sync.d.ts +9 -0
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +531 -124
- package/dist/commands/pr/open.d.ts +1 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +24 -2
- package/dist/commands/pr/pr.command.d.ts +15 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +118 -2
- package/dist/commands/pr/update.d.ts.map +1 -1
- package/dist/commands/pr/update.js +71 -2
- package/dist/commands/release/apply.command.d.ts +3 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +356 -34
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +1 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +1 -1
- package/dist/commands/release/apply.reporting.d.ts +1 -0
- package/dist/commands/release/apply.reporting.d.ts.map +1 -1
- package/dist/commands/release/apply.reporting.js +12 -8
- package/dist/commands/release/apply.types.d.ts +13 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release/plan.command.d.ts.map +1 -1
- package/dist/commands/release/plan.command.js +48 -0
- package/dist/commands/shared/gh-transport.d.ts +16 -0
- package/dist/commands/shared/gh-transport.d.ts.map +1 -0
- package/dist/commands/shared/gh-transport.js +71 -0
- package/dist/commands/shared/git-diff.d.ts +3 -1
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +10 -2
- package/dist/commands/shared/git-ops.d.ts +1 -0
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +15 -0
- package/dist/commands/shared/git-worktree.d.ts +2 -0
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +22 -2
- package/dist/commands/shared/merged-branch-cleanup.d.ts +12 -0
- package/dist/commands/shared/merged-branch-cleanup.d.ts.map +1 -0
- package/dist/commands/shared/merged-branch-cleanup.js +46 -0
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts +9 -0
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts.map +1 -0
- package/dist/commands/shared/post-commit-pr-artifacts.js +57 -0
- package/dist/commands/shared/pr-meta.d.ts +20 -0
- package/dist/commands/shared/pr-meta.d.ts.map +1 -1
- package/dist/commands/shared/pr-meta.js +125 -0
- package/dist/commands/shared/task-backend.d.ts +7 -0
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +71 -27
- package/dist/commands/shared/task-local-freshness.d.ts +2 -0
- package/dist/commands/shared/task-local-freshness.d.ts.map +1 -1
- package/dist/commands/shared/task-local-freshness.js +7 -1
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +34 -1
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/doc-template.d.ts.map +1 -1
- package/dist/commands/task/doc-template.js +7 -11
- package/dist/commands/task/findings-add.command.d.ts +20 -0
- package/dist/commands/task/findings-add.command.d.ts.map +1 -0
- package/dist/commands/task/findings-add.command.js +165 -0
- package/dist/commands/task/findings.command.d.ts +7 -0
- package/dist/commands/task/findings.command.d.ts.map +1 -0
- package/dist/commands/task/findings.command.js +20 -0
- package/dist/commands/task/findings.d.ts +63 -0
- package/dist/commands/task/findings.d.ts.map +1 -0
- package/dist/commands/task/findings.js +188 -0
- package/dist/commands/task/finish-shared.d.ts +2 -0
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +56 -1
- package/dist/commands/task/finish.d.ts +10 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +125 -6
- package/dist/commands/task/hosted-close-pr.command.d.ts +11 -0
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.command.js +449 -0
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +234 -19
- package/dist/commands/task/hosted-merge-sync.d.ts +41 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +291 -17
- package/dist/commands/task/index.d.ts +1 -0
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +1 -0
- package/dist/commands/task/new.d.ts +1 -0
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +71 -1
- package/dist/commands/task/new.spec.d.ts.map +1 -1
- package/dist/commands/task/new.spec.js +7 -0
- package/dist/commands/task/normalize.command.d.ts +2 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -1
- package/dist/commands/task/normalize.command.js +45 -0
- package/dist/commands/task/normalize.d.ts +2 -0
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +85 -8
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +7 -10
- package/dist/commands/task/shared/docs.d.ts +6 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +14 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +11 -1
- package/dist/commands/task/shared.d.ts +1 -1
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +1 -1
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +7 -10
- package/dist/commands/task/task.command.d.ts.map +1 -1
- package/dist/commands/task/task.command.js +4 -0
- package/dist/commands/task/verify-command-shared.d.ts +19 -0
- package/dist/commands/task/verify-command-shared.d.ts.map +1 -1
- package/dist/commands/task/verify-command-shared.js +152 -1
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
- package/dist/commands/task/verify-ok.command.js +15 -2
- package/dist/commands/task/verify-record.d.ts +36 -0
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +166 -11
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
- package/dist/commands/task/verify-rework.command.js +15 -2
- package/dist/commands/task/verify-show.command.d.ts +1 -1
- package/dist/commands/task/verify-show.command.d.ts.map +1 -1
- package/dist/commands/task/verify-show.command.js +28 -1
- package/dist/commands/verify.run.d.ts.map +1 -1
- package/dist/commands/verify.run.js +12 -0
- package/dist/commands/verify.spec.d.ts +2 -6
- package/dist/commands/verify.spec.d.ts.map +1 -1
- package/dist/commands/verify.spec.js +30 -3
- package/dist/runtime/incidents/index.d.ts +1 -1
- package/dist/runtime/incidents/index.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.js +319 -73
- package/dist/runtime/incidents/types.d.ts +14 -2
- package/dist/runtime/incidents/types.d.ts.map +1 -1
- package/dist/shared/env.d.ts +1 -0
- package/dist/shared/env.d.ts.map +1 -1
- package/dist/shared/env.js +22 -1
- package/dist/shared/protected-paths.d.ts +1 -1
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +4 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cmdTaskVerifyOk } from "./verify-record.js";
|
|
2
|
-
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyNonEmptyInput, verifyCommonOptions, } from "./verify-command-shared.js";
|
|
2
|
+
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyFindingSource, validateVerifyNonEmptyInput, validateVerifyNoteSource, verifyCommonOptions, } from "./verify-command-shared.js";
|
|
3
3
|
export const taskVerifyOkSpec = {
|
|
4
4
|
id: ["task", "verify", "ok"],
|
|
5
5
|
group: "Task",
|
|
@@ -17,7 +17,8 @@ export const taskVerifyOkSpec = {
|
|
|
17
17
|
message: "Provide at most one of --details or --file.",
|
|
18
18
|
});
|
|
19
19
|
validateVerifyNonEmptyInput(raw, taskVerifyOkSpec, "by");
|
|
20
|
-
|
|
20
|
+
validateVerifyNoteSource(raw, taskVerifyOkSpec);
|
|
21
|
+
validateVerifyFindingSource(raw, taskVerifyOkSpec);
|
|
21
22
|
},
|
|
22
23
|
parse: (raw) => ({
|
|
23
24
|
taskId: String(raw.args["task-id"]),
|
|
@@ -33,9 +34,21 @@ export function makeRunTaskVerifyOkHandler(getCtx) {
|
|
|
33
34
|
taskId: p.taskId,
|
|
34
35
|
by: p.by,
|
|
35
36
|
note: p.note,
|
|
37
|
+
noteFile: p.noteFile,
|
|
36
38
|
details: p.details,
|
|
37
39
|
file: p.file,
|
|
40
|
+
collectIncidents: p.collectIncidents,
|
|
38
41
|
quiet: p.quiet,
|
|
42
|
+
observation: p.observation,
|
|
43
|
+
impact: p.impact,
|
|
44
|
+
resolution: p.resolution,
|
|
45
|
+
localOnly: p.localOnly,
|
|
46
|
+
repoFixable: p.repoFixable,
|
|
47
|
+
incidentScope: p.incidentScope,
|
|
48
|
+
incidentTags: p.incidentTags,
|
|
49
|
+
incidentMatch: p.incidentMatch,
|
|
50
|
+
incidentAdvice: p.incidentAdvice,
|
|
51
|
+
incidentRule: p.incidentRule,
|
|
39
52
|
});
|
|
40
53
|
};
|
|
41
54
|
}
|
|
@@ -7,8 +7,20 @@ export declare function cmdTaskVerifyOk(opts: {
|
|
|
7
7
|
taskId: string;
|
|
8
8
|
by: string;
|
|
9
9
|
note: string;
|
|
10
|
+
noteFile?: string;
|
|
10
11
|
details?: string;
|
|
11
12
|
file?: string;
|
|
13
|
+
collectIncidents?: boolean;
|
|
14
|
+
observation?: string;
|
|
15
|
+
impact?: string;
|
|
16
|
+
resolution?: string;
|
|
17
|
+
localOnly: boolean;
|
|
18
|
+
repoFixable: boolean;
|
|
19
|
+
incidentScope?: string;
|
|
20
|
+
incidentTags: string[];
|
|
21
|
+
incidentMatch: string[];
|
|
22
|
+
incidentAdvice?: string;
|
|
23
|
+
incidentRule?: string;
|
|
12
24
|
quiet: boolean;
|
|
13
25
|
}): Promise<number>;
|
|
14
26
|
export declare function cmdTaskVerifyRework(opts: {
|
|
@@ -18,8 +30,20 @@ export declare function cmdTaskVerifyRework(opts: {
|
|
|
18
30
|
taskId: string;
|
|
19
31
|
by: string;
|
|
20
32
|
note: string;
|
|
33
|
+
noteFile?: string;
|
|
21
34
|
details?: string;
|
|
22
35
|
file?: string;
|
|
36
|
+
collectIncidents?: boolean;
|
|
37
|
+
observation?: string;
|
|
38
|
+
impact?: string;
|
|
39
|
+
resolution?: string;
|
|
40
|
+
localOnly?: boolean;
|
|
41
|
+
repoFixable?: boolean;
|
|
42
|
+
incidentScope?: string;
|
|
43
|
+
incidentTags?: string[];
|
|
44
|
+
incidentMatch?: string[];
|
|
45
|
+
incidentAdvice?: string;
|
|
46
|
+
incidentRule?: string;
|
|
23
47
|
quiet: boolean;
|
|
24
48
|
}): Promise<number>;
|
|
25
49
|
export declare function cmdVerifyParsed(opts: {
|
|
@@ -30,8 +54,20 @@ export declare function cmdVerifyParsed(opts: {
|
|
|
30
54
|
state: VerifyState;
|
|
31
55
|
by: string;
|
|
32
56
|
note: string;
|
|
57
|
+
noteFile?: string;
|
|
33
58
|
details?: string;
|
|
34
59
|
file?: string;
|
|
60
|
+
collectIncidents?: boolean;
|
|
61
|
+
observation?: string;
|
|
62
|
+
impact?: string;
|
|
63
|
+
resolution?: string;
|
|
64
|
+
localOnly?: boolean;
|
|
65
|
+
repoFixable?: boolean;
|
|
66
|
+
incidentScope?: string;
|
|
67
|
+
incidentTags?: string[];
|
|
68
|
+
incidentMatch?: string[];
|
|
69
|
+
incidentAdvice?: string;
|
|
70
|
+
incidentRule?: string;
|
|
35
71
|
quiet: boolean;
|
|
36
72
|
}): Promise<number>;
|
|
37
73
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-record.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-record.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verify-record.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-record.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { mapBackendError, mapCoreError } from "../../cli/error-map.js";
|
|
4
|
-
import { backendNotSupportedMessage, successMessage } from "../../cli/output.js";
|
|
4
|
+
import { backendNotSupportedMessage, infoMessage, successMessage } from "../../cli/output.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
6
|
import { writeJsonStableIfChanged } from "../../shared/write-if-changed.js";
|
|
7
|
+
import { collectTaskIncidents, inspectTaskIncidents, renderIncidentCollectionPlanOutcome, } from "../incidents/shared.js";
|
|
7
8
|
import { ensureReconciledBeforeMutation } from "../shared/reconcile-check.js";
|
|
8
9
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
9
10
|
import { applyTaskMutation } from "../shared/task-mutation.js";
|
|
10
11
|
import { ensurePrArtifactsSynced } from "../pr/internal/sync.js";
|
|
11
12
|
import { resolvePrPaths } from "../pr/internal/pr-paths.js";
|
|
12
13
|
import { buildVerifiedPrMeta, parsePrMeta } from "../shared/pr-meta.js";
|
|
13
|
-
import {
|
|
14
|
+
import { buildStructuredFindingMutationPlan } from "./findings.js";
|
|
15
|
+
import { assertVerifyStepsFilled, decodeEscapedTaskTextNewlines, executeTaskVerificationTransitionRequest, extractDocSection, nowIso, } from "./shared.js";
|
|
16
|
+
function normalizeFileBackedVerifyNote(raw) {
|
|
17
|
+
return decodeEscapedTaskTextNewlines(raw).replaceAll(/\s+/gu, " ").trim();
|
|
18
|
+
}
|
|
14
19
|
async function recordVerificationResult(opts) {
|
|
15
20
|
const ctx = opts.ctx ??
|
|
16
21
|
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
@@ -30,6 +35,14 @@ async function recordVerificationResult(opts) {
|
|
|
30
35
|
ctx,
|
|
31
36
|
taskId: opts.taskId,
|
|
32
37
|
build: async (current) => {
|
|
38
|
+
const doc = (typeof current.doc === "string" ? current.doc : "") ||
|
|
39
|
+
(await backend.getTaskDoc(current.id));
|
|
40
|
+
assertVerifyStepsFilled({
|
|
41
|
+
taskId: current.id,
|
|
42
|
+
sectionText: extractDocSection(doc, "Verify Steps"),
|
|
43
|
+
action: "record verification",
|
|
44
|
+
guidance: "fill it before running `agentplane verify ...`",
|
|
45
|
+
});
|
|
33
46
|
const execution = executeTaskVerificationTransitionRequest({
|
|
34
47
|
task: current,
|
|
35
48
|
at,
|
|
@@ -37,11 +50,30 @@ async function recordVerificationResult(opts) {
|
|
|
37
50
|
note: opts.note,
|
|
38
51
|
state: opts.state,
|
|
39
52
|
details: opts.details ?? null,
|
|
40
|
-
doc
|
|
41
|
-
(await backend.getTaskDoc(current.id)),
|
|
53
|
+
doc,
|
|
42
54
|
requiredSections: config.tasks.doc.required_sections,
|
|
43
55
|
});
|
|
44
|
-
|
|
56
|
+
const intents = [...execution.intents];
|
|
57
|
+
if (opts.finding) {
|
|
58
|
+
const findingPlan = buildStructuredFindingMutationPlan({
|
|
59
|
+
current,
|
|
60
|
+
config,
|
|
61
|
+
observation: opts.finding.observation,
|
|
62
|
+
impact: opts.finding.impact,
|
|
63
|
+
resolution: opts.finding.resolution,
|
|
64
|
+
promote: !opts.finding.localOnly,
|
|
65
|
+
external: !opts.finding.localOnly,
|
|
66
|
+
fixability: opts.finding.repoFixable ? "repo-fixable" : null,
|
|
67
|
+
incidentScope: opts.finding.incidentScope,
|
|
68
|
+
incidentTags: opts.finding.incidentTags ?? [],
|
|
69
|
+
incidentMatch: opts.finding.incidentMatch ?? [],
|
|
70
|
+
incidentAdvice: opts.finding.incidentAdvice,
|
|
71
|
+
incidentRule: opts.finding.incidentRule,
|
|
72
|
+
});
|
|
73
|
+
if (findingPlan)
|
|
74
|
+
intents.push(...findingPlan.intents);
|
|
75
|
+
}
|
|
76
|
+
return { intents };
|
|
45
77
|
},
|
|
46
78
|
});
|
|
47
79
|
if (config.workflow_mode === "branch_pr") {
|
|
@@ -67,20 +99,70 @@ async function recordVerificationResult(opts) {
|
|
|
67
99
|
}));
|
|
68
100
|
}
|
|
69
101
|
}
|
|
102
|
+
let incidentSummary = null;
|
|
103
|
+
if (opts.collectIncidents === true) {
|
|
104
|
+
const collected = await collectTaskIncidents({
|
|
105
|
+
ctx,
|
|
106
|
+
taskId: opts.taskId,
|
|
107
|
+
write: true,
|
|
108
|
+
});
|
|
109
|
+
incidentSummary = renderIncidentCollectionPlanOutcome(collected.plan, {
|
|
110
|
+
wrote: collected.wrote,
|
|
111
|
+
context: "collect",
|
|
112
|
+
promotedIds: collected.plan.promotable.map((item) => item.entry.id),
|
|
113
|
+
registryPaths: collected.registryPaths,
|
|
114
|
+
taskId: opts.taskId,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else if (config.workflow_mode === "branch_pr") {
|
|
118
|
+
const inspected = await inspectTaskIncidents({
|
|
119
|
+
ctx,
|
|
120
|
+
taskId: opts.taskId,
|
|
121
|
+
});
|
|
122
|
+
incidentSummary = renderIncidentCollectionPlanOutcome(inspected.plan, {
|
|
123
|
+
wrote: false,
|
|
124
|
+
context: "verify",
|
|
125
|
+
taskId: opts.taskId,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
70
128
|
if (!opts.quiet) {
|
|
129
|
+
const findingState = opts.finding
|
|
130
|
+
? opts.finding.localOnly
|
|
131
|
+
? "task-local"
|
|
132
|
+
: "incident-candidate"
|
|
133
|
+
: null;
|
|
71
134
|
const readmePath = path.join(resolved.gitRoot, config.paths.workflow_dir, opts.taskId, "README.md");
|
|
72
135
|
const relReadmePath = path.relative(resolved.gitRoot, readmePath);
|
|
73
|
-
|
|
136
|
+
const extra = findingState ? ` finding=${findingState}` : "";
|
|
137
|
+
process.stdout.write(`${successMessage("verified", opts.taskId, `state=${opts.state} readme=${relReadmePath}${extra}`)}\n`);
|
|
138
|
+
if (incidentSummary && config.workflow_mode === "branch_pr") {
|
|
139
|
+
process.stdout.write(`${infoMessage(incidentSummary)}\n`);
|
|
140
|
+
}
|
|
74
141
|
}
|
|
75
142
|
}
|
|
76
143
|
async function resolveVerifyRecordInput(opts) {
|
|
77
144
|
const by = String(opts.by ?? "").trim();
|
|
78
|
-
const
|
|
79
|
-
|
|
145
|
+
const inlineNote = String(opts.note ?? "").trim();
|
|
146
|
+
const noteFile = typeof opts.noteFile === "string" ? opts.noteFile.trim() : "";
|
|
147
|
+
if (!by) {
|
|
148
|
+
throw new CliError({
|
|
149
|
+
exitCode: 2,
|
|
150
|
+
code: "E_USAGE",
|
|
151
|
+
message: "Missing required input: --by.",
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (!inlineNote && !noteFile) {
|
|
80
155
|
throw new CliError({
|
|
81
156
|
exitCode: 2,
|
|
82
157
|
code: "E_USAGE",
|
|
83
|
-
message: "
|
|
158
|
+
message: "Provide exactly one of --note or --note-file.",
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (inlineNote && noteFile) {
|
|
162
|
+
throw new CliError({
|
|
163
|
+
exitCode: 2,
|
|
164
|
+
code: "E_USAGE",
|
|
165
|
+
message: "Options --note and --note-file are mutually exclusive.",
|
|
84
166
|
});
|
|
85
167
|
}
|
|
86
168
|
if (typeof opts.details === "string" && typeof opts.file === "string") {
|
|
@@ -90,6 +172,22 @@ async function resolveVerifyRecordInput(opts) {
|
|
|
90
172
|
message: "Options --details and --file are mutually exclusive.",
|
|
91
173
|
});
|
|
92
174
|
}
|
|
175
|
+
let note = inlineNote;
|
|
176
|
+
if (noteFile) {
|
|
177
|
+
try {
|
|
178
|
+
note = normalizeFileBackedVerifyNote(await readFile(path.resolve(opts.cwd, noteFile), "utf8"));
|
|
179
|
+
}
|
|
180
|
+
catch (err) {
|
|
181
|
+
throw mapCoreError(err, { command: opts.command, filePath: noteFile });
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (!note) {
|
|
185
|
+
throw new CliError({
|
|
186
|
+
exitCode: 2,
|
|
187
|
+
code: "E_USAGE",
|
|
188
|
+
message: "Verification note cannot be empty after normalization.",
|
|
189
|
+
});
|
|
190
|
+
}
|
|
93
191
|
let details = typeof opts.details === "string" ? opts.details : null;
|
|
94
192
|
if (typeof opts.file === "string") {
|
|
95
193
|
try {
|
|
@@ -116,6 +214,8 @@ async function executeVerifyRecordCommand(opts) {
|
|
|
116
214
|
by: input.by,
|
|
117
215
|
note: input.note,
|
|
118
216
|
details: input.details,
|
|
217
|
+
finding: opts.finding,
|
|
218
|
+
collectIncidents: opts.collectIncidents,
|
|
119
219
|
quiet: opts.quiet,
|
|
120
220
|
});
|
|
121
221
|
return 0;
|
|
@@ -127,15 +227,70 @@ async function executeVerifyRecordCommand(opts) {
|
|
|
127
227
|
}
|
|
128
228
|
}
|
|
129
229
|
export async function cmdTaskVerifyOk(opts) {
|
|
130
|
-
return await executeVerifyRecordCommand({
|
|
230
|
+
return await executeVerifyRecordCommand({
|
|
231
|
+
...opts,
|
|
232
|
+
state: "ok",
|
|
233
|
+
command: "task verify ok",
|
|
234
|
+
finding: typeof opts.observation === "string" &&
|
|
235
|
+
typeof opts.impact === "string" &&
|
|
236
|
+
typeof opts.resolution === "string"
|
|
237
|
+
? {
|
|
238
|
+
observation: opts.observation,
|
|
239
|
+
impact: opts.impact,
|
|
240
|
+
resolution: opts.resolution,
|
|
241
|
+
localOnly: opts.localOnly === true,
|
|
242
|
+
repoFixable: opts.repoFixable === true,
|
|
243
|
+
incidentScope: opts.incidentScope,
|
|
244
|
+
incidentTags: opts.incidentTags ?? [],
|
|
245
|
+
incidentMatch: opts.incidentMatch ?? [],
|
|
246
|
+
incidentAdvice: opts.incidentAdvice,
|
|
247
|
+
incidentRule: opts.incidentRule,
|
|
248
|
+
}
|
|
249
|
+
: null,
|
|
250
|
+
});
|
|
131
251
|
}
|
|
132
252
|
export async function cmdTaskVerifyRework(opts) {
|
|
133
253
|
return await executeVerifyRecordCommand({
|
|
134
254
|
...opts,
|
|
135
255
|
state: "needs_rework",
|
|
136
256
|
command: "task verify rework",
|
|
257
|
+
finding: typeof opts.observation === "string" &&
|
|
258
|
+
typeof opts.impact === "string" &&
|
|
259
|
+
typeof opts.resolution === "string"
|
|
260
|
+
? {
|
|
261
|
+
observation: opts.observation,
|
|
262
|
+
impact: opts.impact,
|
|
263
|
+
resolution: opts.resolution,
|
|
264
|
+
localOnly: opts.localOnly === true,
|
|
265
|
+
repoFixable: opts.repoFixable === true,
|
|
266
|
+
incidentScope: opts.incidentScope,
|
|
267
|
+
incidentTags: opts.incidentTags ?? [],
|
|
268
|
+
incidentMatch: opts.incidentMatch ?? [],
|
|
269
|
+
incidentAdvice: opts.incidentAdvice,
|
|
270
|
+
incidentRule: opts.incidentRule,
|
|
271
|
+
}
|
|
272
|
+
: null,
|
|
137
273
|
});
|
|
138
274
|
}
|
|
139
275
|
export async function cmdVerifyParsed(opts) {
|
|
140
|
-
return await executeVerifyRecordCommand({
|
|
276
|
+
return await executeVerifyRecordCommand({
|
|
277
|
+
...opts,
|
|
278
|
+
command: "verify",
|
|
279
|
+
finding: typeof opts.observation === "string" &&
|
|
280
|
+
typeof opts.impact === "string" &&
|
|
281
|
+
typeof opts.resolution === "string"
|
|
282
|
+
? {
|
|
283
|
+
observation: opts.observation,
|
|
284
|
+
impact: opts.impact,
|
|
285
|
+
resolution: opts.resolution,
|
|
286
|
+
localOnly: opts.localOnly === true,
|
|
287
|
+
repoFixable: opts.repoFixable === true,
|
|
288
|
+
incidentScope: opts.incidentScope,
|
|
289
|
+
incidentTags: opts.incidentTags ?? [],
|
|
290
|
+
incidentMatch: opts.incidentMatch ?? [],
|
|
291
|
+
incidentAdvice: opts.incidentAdvice,
|
|
292
|
+
incidentRule: opts.incidentRule,
|
|
293
|
+
}
|
|
294
|
+
: null,
|
|
295
|
+
});
|
|
141
296
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-rework.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-rework.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,
|
|
1
|
+
{"version":3,"file":"verify-rework.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-rework.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;IACxD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,sBAAsB,CAyBpE,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC/E,KAAK,UAAU,EAAE,GAAG,sBAAsB,KAAG,OAAO,CAAC,MAAM,CAAC,CAyB3E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cmdTaskVerifyRework } from "./verify-record.js";
|
|
2
|
-
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyNonEmptyInput, verifyCommonOptions, } from "./verify-command-shared.js";
|
|
2
|
+
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyFindingSource, validateVerifyNonEmptyInput, validateVerifyNoteSource, verifyCommonOptions, } from "./verify-command-shared.js";
|
|
3
3
|
export const taskVerifyReworkSpec = {
|
|
4
4
|
id: ["task", "verify", "rework"],
|
|
5
5
|
group: "Task",
|
|
@@ -17,7 +17,8 @@ export const taskVerifyReworkSpec = {
|
|
|
17
17
|
message: "Provide at most one of --details or --file.",
|
|
18
18
|
});
|
|
19
19
|
validateVerifyNonEmptyInput(raw, taskVerifyReworkSpec, "by");
|
|
20
|
-
|
|
20
|
+
validateVerifyNoteSource(raw, taskVerifyReworkSpec);
|
|
21
|
+
validateVerifyFindingSource(raw, taskVerifyReworkSpec);
|
|
21
22
|
},
|
|
22
23
|
parse: (raw) => ({
|
|
23
24
|
taskId: String(raw.args["task-id"]),
|
|
@@ -33,9 +34,21 @@ export function makeRunTaskVerifyReworkHandler(getCtx) {
|
|
|
33
34
|
taskId: p.taskId,
|
|
34
35
|
by: p.by,
|
|
35
36
|
note: p.note,
|
|
37
|
+
noteFile: p.noteFile,
|
|
36
38
|
details: p.details,
|
|
37
39
|
file: p.file,
|
|
40
|
+
collectIncidents: p.collectIncidents,
|
|
38
41
|
quiet: p.quiet,
|
|
42
|
+
observation: p.observation,
|
|
43
|
+
impact: p.impact,
|
|
44
|
+
resolution: p.resolution,
|
|
45
|
+
localOnly: p.localOnly,
|
|
46
|
+
repoFixable: p.repoFixable,
|
|
47
|
+
incidentScope: p.incidentScope,
|
|
48
|
+
incidentTags: p.incidentTags,
|
|
49
|
+
incidentMatch: p.incidentMatch,
|
|
50
|
+
incidentAdvice: p.incidentAdvice,
|
|
51
|
+
incidentRule: p.incidentRule,
|
|
39
52
|
});
|
|
40
53
|
};
|
|
41
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type CommandContext } from "../shared/task-backend.js";
|
|
3
3
|
export type TaskVerifyShowParsed = {
|
|
4
4
|
taskId: string;
|
|
5
5
|
quiet: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-show.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-show.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"verify-show.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-show.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKrF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CA6BhE,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC7E,KAAK,UAAU,EAAE,GAAG,oBAAoB,KAAG,OAAO,CAAC,MAAM,CAAC,CAkCzE"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { backendNotSupportedMessage } from "../../cli/output.js";
|
|
2
|
+
import { CliError } from "../../shared/errors.js";
|
|
3
|
+
import { loadTaskFromContext } from "../shared/task-backend.js";
|
|
1
4
|
import { cmdTaskDocShow } from "./doc.js";
|
|
5
|
+
import { assertVerifyStepsFilled, extractDocSection, isVerifyStepsFilled } from "./shared.js";
|
|
2
6
|
export const taskVerifyShowSpec = {
|
|
3
7
|
id: ["task", "verify-show"],
|
|
4
8
|
group: "Task",
|
|
@@ -30,8 +34,31 @@ export const taskVerifyShowSpec = {
|
|
|
30
34
|
};
|
|
31
35
|
export function makeRunTaskVerifyShowHandler(getCtx) {
|
|
32
36
|
return async (ctx, p) => {
|
|
37
|
+
const commandCtx = await getCtx("task verify-show");
|
|
38
|
+
const backend = commandCtx.taskBackend;
|
|
39
|
+
if (!backend.getTaskDoc) {
|
|
40
|
+
throw new CliError({
|
|
41
|
+
exitCode: 2,
|
|
42
|
+
code: "E_USAGE",
|
|
43
|
+
message: backendNotSupportedMessage("task docs"),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const task = await loadTaskFromContext({ ctx: commandCtx, taskId: p.taskId });
|
|
47
|
+
const doc = typeof task.doc === "string" ? task.doc : ((await backend.getTaskDoc(p.taskId)) ?? "");
|
|
48
|
+
const verifySteps = extractDocSection(doc, "Verify Steps");
|
|
49
|
+
if (!p.quiet) {
|
|
50
|
+
assertVerifyStepsFilled({
|
|
51
|
+
taskId: p.taskId,
|
|
52
|
+
sectionText: verifySteps,
|
|
53
|
+
action: "show Verify Steps",
|
|
54
|
+
guidance: "fill it before verification",
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
else if (!isVerifyStepsFilled(verifySteps)) {
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
33
60
|
return await cmdTaskDocShow({
|
|
34
|
-
ctx:
|
|
61
|
+
ctx: commandCtx,
|
|
35
62
|
cwd: ctx.cwd,
|
|
36
63
|
rootOverride: ctx.rootOverride,
|
|
37
64
|
taskId: p.taskId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.run.d.ts","sourceRoot":"","sources":["../../src/commands/verify.run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,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":"verify.run.d.ts","sourceRoot":"","sources":["../../src/commands/verify.run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,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,CA0BjE"}
|
|
@@ -9,8 +9,20 @@ export function makeRunVerifyHandler(getCtx) {
|
|
|
9
9
|
state: p.state,
|
|
10
10
|
by: p.by,
|
|
11
11
|
note: p.note,
|
|
12
|
+
noteFile: p.noteFile,
|
|
12
13
|
details: p.details,
|
|
13
14
|
file: p.file,
|
|
15
|
+
collectIncidents: p.collectIncidents,
|
|
16
|
+
observation: p.observation,
|
|
17
|
+
impact: p.impact,
|
|
18
|
+
resolution: p.resolution,
|
|
19
|
+
localOnly: p.localOnly,
|
|
20
|
+
repoFixable: p.repoFixable,
|
|
21
|
+
incidentScope: p.incidentScope,
|
|
22
|
+
incidentTags: p.incidentTags,
|
|
23
|
+
incidentMatch: p.incidentMatch,
|
|
24
|
+
incidentAdvice: p.incidentAdvice,
|
|
25
|
+
incidentRule: p.incidentRule,
|
|
14
26
|
quiet: p.quiet,
|
|
15
27
|
});
|
|
16
28
|
};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import type { CommandSpec } from "../cli/spec/spec.js";
|
|
2
|
+
import { type VerifyCommonParsed } from "./task/verify-command-shared.js";
|
|
2
3
|
type VerifyState = "ok" | "needs_rework";
|
|
3
|
-
export type VerifyParsed = {
|
|
4
|
+
export type VerifyParsed = VerifyCommonParsed & {
|
|
4
5
|
taskId: string;
|
|
5
6
|
state: VerifyState;
|
|
6
|
-
by: string;
|
|
7
|
-
note: string;
|
|
8
|
-
details?: string;
|
|
9
|
-
file?: string;
|
|
10
|
-
quiet: boolean;
|
|
11
7
|
};
|
|
12
8
|
export declare const verifySpec: CommandSpec<VerifyParsed>;
|
|
13
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.spec.d.ts","sourceRoot":"","sources":["../../src/commands/verify.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"verify.spec.d.ts","sourceRoot":"","sources":["../../src/commands/verify.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EACL,KAAK,kBAAkB,EAOxB,MAAM,iCAAiC,CAAC;AAEzC,KAAK,WAAW,GAAG,IAAI,GAAG,cAAc,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAiHhD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { usageError } from "../cli/spec/errors.js";
|
|
2
|
-
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, } from "./task/verify-command-shared.js";
|
|
2
|
+
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyFindingSource, validateVerifyNonEmptyInput, validateVerifyNoteSource, verifyFindingOptions, } from "./task/verify-command-shared.js";
|
|
3
3
|
export const verifySpec = {
|
|
4
4
|
id: ["verify"],
|
|
5
5
|
group: "Lifecycle",
|
|
6
|
-
summary: "Record a verification outcome for a task
|
|
6
|
+
summary: "Record a verification outcome for a task; incident candidates stay task-local unless collected explicitly.",
|
|
7
7
|
args: [
|
|
8
8
|
{
|
|
9
9
|
name: "task-id",
|
|
@@ -36,9 +36,14 @@ export const verifySpec = {
|
|
|
36
36
|
kind: "string",
|
|
37
37
|
name: "note",
|
|
38
38
|
valueHint: "<text>",
|
|
39
|
-
required: true,
|
|
40
39
|
description: "Short note describing the verification outcome.",
|
|
41
40
|
},
|
|
41
|
+
{
|
|
42
|
+
kind: "string",
|
|
43
|
+
name: "note-file",
|
|
44
|
+
valueHint: "<path>",
|
|
45
|
+
description: "Read the verification note from a file path (mutually exclusive with --note).",
|
|
46
|
+
},
|
|
42
47
|
{
|
|
43
48
|
kind: "string",
|
|
44
49
|
name: "details",
|
|
@@ -51,17 +56,36 @@ export const verifySpec = {
|
|
|
51
56
|
valueHint: "<path>",
|
|
52
57
|
description: "Read details from a file path (mutually exclusive with --details).",
|
|
53
58
|
},
|
|
59
|
+
{
|
|
60
|
+
kind: "boolean",
|
|
61
|
+
name: "collect-incidents",
|
|
62
|
+
default: false,
|
|
63
|
+
description: "After recording verification, collect promotable findings into incidents.md immediately.",
|
|
64
|
+
},
|
|
54
65
|
{ kind: "boolean", name: "quiet", default: false, description: "Suppress output." },
|
|
66
|
+
...verifyFindingOptions,
|
|
55
67
|
],
|
|
56
68
|
examples: [
|
|
57
69
|
{
|
|
58
70
|
cmd: 'agentplane verify 202602030608-F1Q8AB --ok --by REVIEWER --note "Looks good" --quiet',
|
|
59
71
|
why: "Record an OK verification outcome.",
|
|
60
72
|
},
|
|
73
|
+
{
|
|
74
|
+
cmd: "agentplane verify 202602030608-F1Q8AB --ok --by REVIEWER --note-file ./verify-note.txt",
|
|
75
|
+
why: "Record an OK verification outcome using a file-backed note.",
|
|
76
|
+
},
|
|
61
77
|
{
|
|
62
78
|
cmd: 'agentplane verify 202602030608-F1Q8AB --rework --by REVIEWER --note "Needs changes" --details "Missing tests"',
|
|
63
79
|
why: "Record a needs-rework outcome with details.",
|
|
64
80
|
},
|
|
81
|
+
{
|
|
82
|
+
cmd: 'agentplane verify 202602030608-F1Q8AB --ok --by REVIEWER --note "Looks good" --observation "Repeated recovery was manual." --impact "Operators needed a second command." --resolution "Append structured findings during verify."',
|
|
83
|
+
why: "Record verification and append a promotable structured finding in one command.",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
cmd: 'agentplane verify 202602030608-F1Q8AB --ok --by REVIEWER --note "Looks good" --collect-incidents',
|
|
87
|
+
why: "Record verification and collect promotable findings into incidents.md immediately.",
|
|
88
|
+
},
|
|
65
89
|
],
|
|
66
90
|
validateRaw: (raw) => {
|
|
67
91
|
const ok = raw.opts.ok === true;
|
|
@@ -74,6 +98,9 @@ export const verifySpec = {
|
|
|
74
98
|
});
|
|
75
99
|
}
|
|
76
100
|
validateVerifyDetailsFileExclusive(raw, verifySpec, { command: "verify" });
|
|
101
|
+
validateVerifyNonEmptyInput(raw, verifySpec, "by");
|
|
102
|
+
validateVerifyNoteSource(raw, verifySpec, { command: "verify" });
|
|
103
|
+
validateVerifyFindingSource(raw, verifySpec, { command: "verify" });
|
|
77
104
|
},
|
|
78
105
|
parse: (raw) => {
|
|
79
106
|
const ok = raw.opts.ok === true;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { IncidentAdviceMatch, IncidentAdviceQuery, IncidentCollectionPlan, IncidentFindingCandidate, IncidentPromotionDraft, IncidentPromotionIssue, IncidentPromotionTaskContext, IncidentRegistry, IncidentRegistryEntry, IncidentRegistryEntryState, } from "./types.js";
|
|
1
|
+
export type { IncidentAdviceMatch, IncidentAdviceQuery, IncidentCollectionPlan, IncidentFindingCandidate, IncidentSkippedFinding, IncidentPromotionDraft, IncidentPromotionIssue, IncidentPromotionTaskContext, IncidentRegistry, IncidentRegistryEntry, IncidentRegistryEntryState, } from "./types.js";
|
|
2
2
|
export { appendIncidentRegistryEntries, buildIncidentAdviceQueryFromTask, createIncidentRegistrySkeleton, extractIncidentCandidatesFromFindings, formatIncidentRegistryEntry, parseIncidentRegistry, planIncidentCollection, renderIncidentAdvice, resolveIncidentAdviceMatches, } from "./resolve.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/incidents/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,8BAA8B,EAC9B,qCAAqC,EACrC,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/incidents/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,EAChC,8BAA8B,EAC9B,qCAAqC,EACrC,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/runtime/incidents/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/runtime/incidents/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EAIxB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,YAAY,CAAC;AAmNpB,wBAAgB,8BAA8B,IAAI,MAAM,CAkCvD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAkFpE;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAEhF;AAiJD,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,qBAAqB,EAAE,GACxC,MAAM,CAOR;AAED,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,MAAM,GACf,wBAAwB,EAAE,CAI5B;AA8KD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,IAAI,EAAE,4BAA4B,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,sBAAsB,CAyDzB;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB,GAAG,mBAAmB,CAQtB;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,KAAK,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,mBAAmB,EAAE,CAgCxB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,GAAG,MAAM,CAcpF"}
|