agentplane 0.3.10 → 0.3.11

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.
Files changed (228) hide show
  1. package/assets/policy/governance.md +3 -4
  2. package/assets/policy/incidents.md +19 -88
  3. package/assets/policy/workflow.branch_pr.md +1 -1
  4. package/assets/policy/workflow.direct.md +2 -2
  5. package/bin/agentplane.js +56 -1
  6. package/bin/runtime-watch.js +1 -0
  7. package/bin/stale-dist-policy.d.ts +1 -1
  8. package/bin/stale-dist-policy.js +13 -0
  9. package/dist/.build-manifest.json +219 -154
  10. package/dist/cli/bootstrap-guide.d.ts.map +1 -1
  11. package/dist/cli/bootstrap-guide.js +3 -2
  12. package/dist/cli/command-guide.d.ts.map +1 -1
  13. package/dist/cli/command-guide.js +2 -1
  14. package/dist/cli/command-invocations.d.ts.map +1 -1
  15. package/dist/cli/command-invocations.js +4 -1
  16. package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
  17. package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
  18. package/dist/cli/run-cli/command-catalog/project.js +3 -1
  19. package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
  20. package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
  21. package/dist/cli/run-cli/command-catalog/task.js +10 -0
  22. package/dist/cli/run-cli/command-catalog.d.ts +1 -1
  23. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  24. package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -1
  25. package/dist/cli/run-cli/commands/core/preflight.js +44 -1
  26. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  27. package/dist/cli/run-cli.test-helpers.js +12 -0
  28. package/dist/commands/branch/cleanup-merged.d.ts +2 -0
  29. package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
  30. package/dist/commands/branch/cleanup-merged.js +132 -28
  31. package/dist/commands/branch/work-start.d.ts.map +1 -1
  32. package/dist/commands/branch/work-start.js +60 -1
  33. package/dist/commands/cleanup/merged.command.d.ts +2 -0
  34. package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
  35. package/dist/commands/cleanup/merged.command.js +24 -0
  36. package/dist/commands/doctor/branch-pr.d.ts +4 -0
  37. package/dist/commands/doctor/branch-pr.d.ts.map +1 -0
  38. package/dist/commands/doctor/branch-pr.js +96 -0
  39. package/dist/commands/doctor/fixes.d.ts +5 -0
  40. package/dist/commands/doctor/fixes.d.ts.map +1 -1
  41. package/dist/commands/doctor/fixes.js +70 -0
  42. package/dist/commands/doctor.run.d.ts.map +1 -1
  43. package/dist/commands/doctor.run.js +6 -1
  44. package/dist/commands/finish.run.d.ts.map +1 -1
  45. package/dist/commands/finish.run.js +11 -0
  46. package/dist/commands/finish.spec.d.ts +11 -0
  47. package/dist/commands/finish.spec.d.ts.map +1 -1
  48. package/dist/commands/finish.spec.js +51 -0
  49. package/dist/commands/guard/impl/close-message.d.ts.map +1 -1
  50. package/dist/commands/guard/impl/close-message.js +23 -6
  51. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  52. package/dist/commands/guard/impl/commands.js +24 -2
  53. package/dist/commands/guard/impl/env.d.ts +1 -0
  54. package/dist/commands/guard/impl/env.d.ts.map +1 -1
  55. package/dist/commands/guard/impl/env.js +1 -0
  56. package/dist/commands/hooks/index.d.ts.map +1 -1
  57. package/dist/commands/hooks/index.js +98 -1
  58. package/dist/commands/incidents/collect.command.d.ts.map +1 -1
  59. package/dist/commands/incidents/collect.command.js +12 -7
  60. package/dist/commands/incidents/incidents.command.js +1 -1
  61. package/dist/commands/incidents/shared.d.ts +34 -0
  62. package/dist/commands/incidents/shared.d.ts.map +1 -1
  63. package/dist/commands/incidents/shared.js +166 -12
  64. package/dist/commands/pr/check.d.ts.map +1 -1
  65. package/dist/commands/pr/check.js +238 -135
  66. package/dist/commands/pr/close-superseded.d.ts +9 -0
  67. package/dist/commands/pr/close-superseded.d.ts.map +1 -0
  68. package/dist/commands/pr/close-superseded.js +129 -0
  69. package/dist/commands/pr/close.d.ts +11 -0
  70. package/dist/commands/pr/close.d.ts.map +1 -0
  71. package/dist/commands/pr/close.js +116 -0
  72. package/dist/commands/pr/index.d.ts +2 -0
  73. package/dist/commands/pr/index.d.ts.map +1 -1
  74. package/dist/commands/pr/index.js +2 -0
  75. package/dist/commands/pr/integrate/artifacts.d.ts +7 -0
  76. package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -1
  77. package/dist/commands/pr/integrate/artifacts.js +66 -1
  78. package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
  79. package/dist/commands/pr/integrate/cmd.js +16 -0
  80. package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts +8 -0
  81. package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts.map +1 -0
  82. package/dist/commands/pr/integrate/internal/bootstrap-guidance.js +59 -0
  83. package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
  84. package/dist/commands/pr/integrate/internal/finalize.js +40 -12
  85. package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
  86. package/dist/commands/pr/integrate/internal/merge.js +36 -13
  87. package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts +13 -0
  88. package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts.map +1 -0
  89. package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.js +25 -0
  90. package/dist/commands/pr/integrate/internal/prepare.d.ts +3 -2
  91. package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
  92. package/dist/commands/pr/integrate/internal/prepare.js +101 -38
  93. package/dist/commands/pr/internal/freshness.d.ts +20 -0
  94. package/dist/commands/pr/internal/freshness.d.ts.map +1 -0
  95. package/dist/commands/pr/internal/freshness.js +50 -0
  96. package/dist/commands/pr/internal/gh-api.d.ts +6 -0
  97. package/dist/commands/pr/internal/gh-api.d.ts.map +1 -0
  98. package/dist/commands/pr/internal/gh-api.js +80 -0
  99. package/dist/commands/pr/internal/pr-paths.d.ts +10 -0
  100. package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
  101. package/dist/commands/pr/internal/pr-paths.js +10 -0
  102. package/dist/commands/pr/internal/review-template.d.ts.map +1 -1
  103. package/dist/commands/pr/internal/review-template.js +37 -4
  104. package/dist/commands/pr/internal/sync.d.ts +9 -0
  105. package/dist/commands/pr/internal/sync.d.ts.map +1 -1
  106. package/dist/commands/pr/internal/sync.js +462 -122
  107. package/dist/commands/pr/open.d.ts +1 -0
  108. package/dist/commands/pr/open.d.ts.map +1 -1
  109. package/dist/commands/pr/open.js +13 -2
  110. package/dist/commands/pr/pr.command.d.ts +15 -0
  111. package/dist/commands/pr/pr.command.d.ts.map +1 -1
  112. package/dist/commands/pr/pr.command.js +118 -2
  113. package/dist/commands/pr/update.d.ts.map +1 -1
  114. package/dist/commands/pr/update.js +59 -1
  115. package/dist/commands/release/apply.command.d.ts.map +1 -1
  116. package/dist/commands/release/apply.command.js +3 -17
  117. package/dist/commands/release/apply.preflight.d.ts.map +1 -1
  118. package/dist/commands/release/apply.preflight.js +1 -1
  119. package/dist/commands/shared/gh-transport.d.ts +16 -0
  120. package/dist/commands/shared/gh-transport.d.ts.map +1 -0
  121. package/dist/commands/shared/gh-transport.js +71 -0
  122. package/dist/commands/shared/git-diff.d.ts +3 -1
  123. package/dist/commands/shared/git-diff.d.ts.map +1 -1
  124. package/dist/commands/shared/git-diff.js +10 -2
  125. package/dist/commands/shared/git-ops.d.ts +1 -0
  126. package/dist/commands/shared/git-ops.d.ts.map +1 -1
  127. package/dist/commands/shared/git-ops.js +15 -0
  128. package/dist/commands/shared/git-worktree.d.ts +2 -0
  129. package/dist/commands/shared/git-worktree.d.ts.map +1 -1
  130. package/dist/commands/shared/git-worktree.js +22 -2
  131. package/dist/commands/shared/post-commit-pr-artifacts.d.ts +9 -0
  132. package/dist/commands/shared/post-commit-pr-artifacts.d.ts.map +1 -0
  133. package/dist/commands/shared/post-commit-pr-artifacts.js +22 -0
  134. package/dist/commands/shared/pr-meta.d.ts +20 -0
  135. package/dist/commands/shared/pr-meta.d.ts.map +1 -1
  136. package/dist/commands/shared/pr-meta.js +125 -0
  137. package/dist/commands/shared/task-backend.d.ts +7 -0
  138. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  139. package/dist/commands/shared/task-backend.js +34 -22
  140. package/dist/commands/task/close-duplicate.d.ts.map +1 -1
  141. package/dist/commands/task/close-duplicate.js +34 -1
  142. package/dist/commands/task/derive.js +1 -1
  143. package/dist/commands/task/doc-template.d.ts.map +1 -1
  144. package/dist/commands/task/doc-template.js +7 -11
  145. package/dist/commands/task/findings-add.command.d.ts +20 -0
  146. package/dist/commands/task/findings-add.command.d.ts.map +1 -0
  147. package/dist/commands/task/findings-add.command.js +165 -0
  148. package/dist/commands/task/findings.command.d.ts +7 -0
  149. package/dist/commands/task/findings.command.d.ts.map +1 -0
  150. package/dist/commands/task/findings.command.js +20 -0
  151. package/dist/commands/task/findings.d.ts +63 -0
  152. package/dist/commands/task/findings.d.ts.map +1 -0
  153. package/dist/commands/task/findings.js +188 -0
  154. package/dist/commands/task/finish-shared.d.ts +1 -0
  155. package/dist/commands/task/finish-shared.d.ts.map +1 -1
  156. package/dist/commands/task/finish-shared.js +55 -1
  157. package/dist/commands/task/finish.d.ts +10 -0
  158. package/dist/commands/task/finish.d.ts.map +1 -1
  159. package/dist/commands/task/finish.js +125 -6
  160. package/dist/commands/task/hosted-close-pr.command.d.ts +11 -0
  161. package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -0
  162. package/dist/commands/task/hosted-close-pr.command.js +414 -0
  163. package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
  164. package/dist/commands/task/hosted-close.command.js +49 -1
  165. package/dist/commands/task/hosted-merge-sync.d.ts +38 -0
  166. package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
  167. package/dist/commands/task/hosted-merge-sync.js +249 -17
  168. package/dist/commands/task/index.d.ts +1 -0
  169. package/dist/commands/task/index.d.ts.map +1 -1
  170. package/dist/commands/task/index.js +1 -0
  171. package/dist/commands/task/new.d.ts +1 -0
  172. package/dist/commands/task/new.d.ts.map +1 -1
  173. package/dist/commands/task/new.js +71 -1
  174. package/dist/commands/task/new.spec.d.ts.map +1 -1
  175. package/dist/commands/task/new.spec.js +7 -0
  176. package/dist/commands/task/normalize.command.d.ts +2 -0
  177. package/dist/commands/task/normalize.command.d.ts.map +1 -1
  178. package/dist/commands/task/normalize.command.js +45 -0
  179. package/dist/commands/task/normalize.d.ts +2 -0
  180. package/dist/commands/task/normalize.d.ts.map +1 -1
  181. package/dist/commands/task/normalize.js +85 -8
  182. package/dist/commands/task/plan.d.ts.map +1 -1
  183. package/dist/commands/task/plan.js +7 -10
  184. package/dist/commands/task/shared/docs.d.ts +6 -0
  185. package/dist/commands/task/shared/docs.d.ts.map +1 -1
  186. package/dist/commands/task/shared/docs.js +14 -0
  187. package/dist/commands/task/shared/transitions.d.ts.map +1 -1
  188. package/dist/commands/task/shared/transitions.js +11 -1
  189. package/dist/commands/task/shared.d.ts +1 -1
  190. package/dist/commands/task/shared.d.ts.map +1 -1
  191. package/dist/commands/task/shared.js +1 -1
  192. package/dist/commands/task/start-ready.d.ts.map +1 -1
  193. package/dist/commands/task/start-ready.js +86 -0
  194. package/dist/commands/task/start.d.ts.map +1 -1
  195. package/dist/commands/task/start.js +7 -10
  196. package/dist/commands/task/task.command.d.ts.map +1 -1
  197. package/dist/commands/task/task.command.js +4 -0
  198. package/dist/commands/task/verify-command-shared.d.ts +19 -0
  199. package/dist/commands/task/verify-command-shared.d.ts.map +1 -1
  200. package/dist/commands/task/verify-command-shared.js +152 -1
  201. package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
  202. package/dist/commands/task/verify-ok.command.js +15 -2
  203. package/dist/commands/task/verify-record.d.ts +36 -0
  204. package/dist/commands/task/verify-record.d.ts.map +1 -1
  205. package/dist/commands/task/verify-record.js +166 -11
  206. package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
  207. package/dist/commands/task/verify-rework.command.js +15 -2
  208. package/dist/commands/task/verify-show.command.d.ts +1 -1
  209. package/dist/commands/task/verify-show.command.d.ts.map +1 -1
  210. package/dist/commands/task/verify-show.command.js +28 -1
  211. package/dist/commands/verify.run.d.ts.map +1 -1
  212. package/dist/commands/verify.run.js +12 -0
  213. package/dist/commands/verify.spec.d.ts +2 -6
  214. package/dist/commands/verify.spec.d.ts.map +1 -1
  215. package/dist/commands/verify.spec.js +30 -3
  216. package/dist/runtime/incidents/index.d.ts +1 -1
  217. package/dist/runtime/incidents/index.d.ts.map +1 -1
  218. package/dist/runtime/incidents/resolve.d.ts.map +1 -1
  219. package/dist/runtime/incidents/resolve.js +319 -73
  220. package/dist/runtime/incidents/types.d.ts +14 -2
  221. package/dist/runtime/incidents/types.d.ts.map +1 -1
  222. package/dist/shared/env.d.ts +1 -0
  223. package/dist/shared/env.d.ts.map +1 -1
  224. package/dist/shared/env.js +22 -1
  225. package/dist/shared/protected-paths.d.ts +1 -1
  226. package/dist/shared/protected-paths.d.ts.map +1 -1
  227. package/dist/shared/protected-paths.js +4 -0
  228. package/package.json +2 -2
@@ -1,13 +1,55 @@
1
1
  import { mapBackendError } from "../../cli/error-map.js";
2
2
  import { successMessage } from "../../cli/output.js";
3
+ import { CliError } from "../../shared/errors.js";
3
4
  import { ensureActionApproved } from "../shared/approval-requirements.js";
4
5
  import { loadCommandContext } from "../shared/task-backend.js";
5
6
  import { applyTaskCollectionMutation } from "../shared/task-mutation.js";
6
- import { syncHostedMergedTasks } from "./hosted-merge-sync.js";
7
+ import { collectTaskIncidents } from "../incidents/shared.js";
8
+ import { syncHostedMergedTasks, syncLocallyShippedBranchPrTasks } from "./hosted-merge-sync.js";
9
+ function dedupeTaskIds(taskIds) {
10
+ const seen = new Set();
11
+ const result = [];
12
+ for (const rawTaskId of taskIds) {
13
+ const taskId = rawTaskId.trim();
14
+ if (!taskId || seen.has(taskId))
15
+ continue;
16
+ seen.add(taskId);
17
+ result.push(taskId);
18
+ }
19
+ return result;
20
+ }
21
+ function selectTasksForNormalize(current, taskIds) {
22
+ if (taskIds.length === 0)
23
+ return current.map((task) => ({ ...task }));
24
+ const byId = new Map(current.map((task) => [task.id, task]));
25
+ const missing = [];
26
+ const selected = [];
27
+ for (const taskId of taskIds) {
28
+ const task = byId.get(taskId);
29
+ if (!task) {
30
+ missing.push(taskId);
31
+ continue;
32
+ }
33
+ selected.push({ ...task });
34
+ }
35
+ if (missing.length > 0) {
36
+ throw new CliError({
37
+ exitCode: 2,
38
+ code: "E_USAGE",
39
+ message: `Unknown task${missing.length === 1 ? "" : "s"}: ${missing.join(", ")}`,
40
+ });
41
+ }
42
+ return selected;
43
+ }
44
+ function diffTasksToWrite(current, next) {
45
+ const previousById = new Map(current.map((task) => [task.id, JSON.stringify(task)]));
46
+ return next.filter((task) => previousById.get(task.id) !== JSON.stringify(task));
47
+ }
7
48
  export async function cmdTaskNormalize(opts) {
8
49
  try {
9
50
  const ctx = opts.ctx ??
10
51
  (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
52
+ const selectedTaskIds = dedupeTaskIds(opts.taskIds ?? []);
11
53
  if (opts.force) {
12
54
  await ensureActionApproved({
13
55
  action: "force_action",
@@ -16,7 +58,9 @@ export async function cmdTaskNormalize(opts) {
16
58
  reason: "task normalize --force",
17
59
  });
18
60
  }
19
- if (ctx.taskBackend.normalizeTasks && opts.syncHostedMerges !== true) {
61
+ if (ctx.taskBackend.normalizeTasks &&
62
+ opts.syncHostedMerges !== true &&
63
+ opts.syncBranchPrState !== true) {
20
64
  const result = await ctx.taskBackend.normalizeTasks();
21
65
  if (!opts.quiet) {
22
66
  process.stdout.write(`${successMessage("normalized tasks", undefined, `scanned=${result.scanned} changed=${result.changed}`)}\n`);
@@ -24,24 +68,57 @@ export async function cmdTaskNormalize(opts) {
24
68
  return 0;
25
69
  }
26
70
  let syncedHostedMerges = 0;
71
+ let syncedBranchPrState = 0;
72
+ let promotedIncidents = 0;
73
+ const passThroughNormalizeWrite = opts.syncHostedMerges !== true && opts.syncBranchPrState !== true;
27
74
  const { result, tasksToWrite } = await applyTaskCollectionMutation({
28
75
  ctx,
29
76
  build: async (tasks) => {
30
- let nextTasks = tasks;
77
+ const scopedTasks = selectTasksForNormalize(tasks, selectedTaskIds);
78
+ let nextTasks = scopedTasks;
31
79
  if (opts.syncHostedMerges === true) {
32
- const synced = await syncHostedMergedTasks({ ctx, tasks });
80
+ const synced = await syncHostedMergedTasks({ ctx, tasks: nextTasks });
33
81
  nextTasks = synced.tasks;
34
82
  syncedHostedMerges = synced.synced;
35
83
  }
84
+ if (opts.syncBranchPrState === true) {
85
+ const synced = await syncLocallyShippedBranchPrTasks({ ctx, tasks: nextTasks });
86
+ nextTasks = synced.tasks;
87
+ syncedBranchPrState = synced.synced;
88
+ }
89
+ const nextTasksToWrite = passThroughNormalizeWrite
90
+ ? nextTasks
91
+ : diffTasksToWrite(scopedTasks, nextTasks);
92
+ const incidentCandidates = opts.syncHostedMerges === true || opts.syncBranchPrState === true
93
+ ? nextTasksToWrite.filter((task) => String(task.status || "TODO").toUpperCase() === "DONE")
94
+ : [];
95
+ for (const task of incidentCandidates) {
96
+ await collectTaskIncidents({
97
+ ctx,
98
+ taskId: task.id,
99
+ task,
100
+ write: false,
101
+ });
102
+ }
36
103
  return {
37
- result: null,
38
- tasksToWrite: nextTasks,
104
+ result: { incidentCandidates },
105
+ tasksToWrite: nextTasksToWrite,
39
106
  };
40
107
  },
41
108
  });
42
- void result;
109
+ for (const task of result.incidentCandidates) {
110
+ const collected = await collectTaskIncidents({
111
+ ctx,
112
+ taskId: task.id,
113
+ task,
114
+ write: true,
115
+ });
116
+ promotedIncidents += collected.plan.promotable.length;
117
+ }
43
118
  if (!opts.quiet) {
44
- process.stdout.write(`${successMessage("normalized tasks", undefined, `count=${tasksToWrite.length}${opts.syncHostedMerges === true ? ` synced_hosted_merges=${syncedHostedMerges}` : ""}`)}\n`);
119
+ process.stdout.write(`${successMessage("normalized tasks", undefined, `count=${tasksToWrite.length}${opts.syncHostedMerges === true ? ` synced_hosted_merges=${syncedHostedMerges}` : ""}${opts.syncBranchPrState === true ? ` synced_branch_pr_state=${syncedBranchPrState}` : ""}${opts.syncHostedMerges === true || opts.syncBranchPrState === true
120
+ ? ` promoted_incidents=${promotedIncidents}`
121
+ : ""}`)}\n`);
45
122
  }
46
123
  return 0;
47
124
  }
@@ -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;AA8InC,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,CAuHlB;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,CAgElB;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,CAuElB"}
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;AA0InC,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,CAuHlB;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,CAgElB;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,CAuElB"}
@@ -7,7 +7,7 @@ import { CliError } from "../../shared/errors.js";
7
7
  import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
8
8
  import { applyTaskMutation, withTaskMutationStorage } from "../shared/task-mutation.js";
9
9
  import { setTaskFieldsIntent, setTaskSectionIntent, touchTaskDocMetaIntent, } from "../shared/task-store.js";
10
- import { decodeEscapedTaskTextNewlines, ensureAgentFilledRequiredDocSections, extractDocSection, extractTaskObservationSection, isVerifyStepsFilled, nowIso, normalizeTaskDocVersion, taskObservationSectionName, requiresVerifyStepsByPrimary, toStringArray, } from "./shared.js";
10
+ import { assertVerifyStepsFilled, decodeEscapedTaskTextNewlines, ensureAgentFilledRequiredDocSections, extractDocSection, extractTaskObservationSection, nowIso, normalizeTaskDocVersion, taskObservationSectionName, requiresVerifyStepsByPrimary, toStringArray, } from "./shared.js";
11
11
  async function loadPlanBackend(opts) {
12
12
  const ctx = opts.ctx ??
13
13
  (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
@@ -63,15 +63,12 @@ function assertPlanCanBeApproved(opts) {
63
63
  const verifyRequired = requiresVerifyStepsByPrimary(tags, opts.config);
64
64
  const isSpike = tags.some((tag) => tag.trim().toLowerCase() === spikeTag);
65
65
  if (verifyRequired || isSpike) {
66
- const verifySteps = extractDocSection(opts.doc, "Verify Steps");
67
- if (!isVerifyStepsFilled(verifySteps)) {
68
- throw new CliError({
69
- exitCode: 3,
70
- code: "E_VALIDATION",
71
- message: `${opts.task.id}: cannot approve plan: ## Verify Steps section is missing/empty/unfilled ` +
72
- "(fill it before approving plan)",
73
- });
74
- }
66
+ assertVerifyStepsFilled({
67
+ taskId: opts.task.id,
68
+ sectionText: extractDocSection(opts.doc, "Verify Steps"),
69
+ action: "approve plan",
70
+ guidance: "fill it before approving plan",
71
+ });
75
72
  }
76
73
  if (!isSpike)
77
74
  return;
@@ -8,6 +8,12 @@ export type TaskDocVersion = 2 | 3;
8
8
  export declare function decodeEscapedTaskTextNewlines(text: string): string;
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 assertVerifyStepsFilled(opts: {
12
+ taskId: string;
13
+ sectionText: string | null;
14
+ action: string;
15
+ guidance?: string;
16
+ }): void;
11
17
  export declare function normalizeTaskDocVersion(value: unknown, fallback?: TaskDocVersion): TaskDocVersion;
12
18
  export declare function normalizeVerificationSectionLayout(sectionText: string | null, version: TaskDocVersion): string;
13
19
  export declare function taskObservationSectionName(version: TaskDocVersion): "Notes" | "Findings";
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAElE,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAED,eAAO,MAAM,wBAAwB,+DACyB,CAAC;AAC/D,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAChF,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAC5E,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;AAEnC,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMlE;AAED,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,CACrC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,cAAkB,GAC3B,cAAc,CAEhB;AAED,wBAAgB,kCAAkC,CAChD,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,OAAO,EAAE,cAAc,GACtB,MAAM,CAyCR;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,GAAG,UAAU,CAExF;AAED,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAIjG;AAED,wBAAgB,0BAA0B,CAAC,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AC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,IAAI,CAUP;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,cAAkB,GAC3B,cAAc,CAEhB;AAED,wBAAgB,kCAAkC,CAChD,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,OAAO,EAAE,cAAc,GACtB,MAAM,CAyCR;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,GAAG,UAAU,CAExF;AAED,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAIjG;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,EAAE,CAaX;AAMD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAKtE;AAED,wBAAgB,oCAAoC,CAAC,IAAI,EAAE;IACzD,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CA6BP"}
@@ -7,6 +7,7 @@ export function nowIso() {
7
7
  export const VERIFY_STEPS_PLACEHOLDER = "<!-- TODO: REPLACE WITH TASK-SPECIFIC ACCEPTANCE STEPS -->";
8
8
  export const VERIFICATION_RESULTS_BEGIN = "<!-- BEGIN VERIFICATION RESULTS -->";
9
9
  export const VERIFICATION_RESULTS_END = "<!-- END VERIFICATION RESULTS -->";
10
+ const VERIFY_STEPS_TEMPLATE_LINE_RE = /^\d+\.\s*<[^>\n]+>\.\s*Expected:\s*<[^>\n]+>\.?$/m;
10
11
  export function decodeEscapedTaskTextNewlines(text) {
11
12
  const normalized = text.replaceAll("\r\n", "\n");
12
13
  if (!normalized.includes(String.raw `\n`) && !normalized.includes(String.raw `\r\n`)) {
@@ -39,8 +40,21 @@ export function isVerifyStepsFilled(sectionText) {
39
40
  return false;
40
41
  if (normalized.includes(VERIFY_STEPS_PLACEHOLDER))
41
42
  return false;
43
+ if (VERIFY_STEPS_TEMPLATE_LINE_RE.test(normalized))
44
+ return false;
42
45
  return true;
43
46
  }
47
+ export function assertVerifyStepsFilled(opts) {
48
+ if (isVerifyStepsFilled(opts.sectionText))
49
+ return;
50
+ const guidance = opts.guidance ? ` (${opts.guidance})` : "";
51
+ throw new CliError({
52
+ exitCode: 3,
53
+ code: "E_VALIDATION",
54
+ message: `${opts.taskId}: cannot ${opts.action}: ## Verify Steps section is missing/empty/unfilled` +
55
+ guidance,
56
+ });
57
+ }
44
58
  export function normalizeTaskDocVersion(value, fallback = 3) {
45
59
  return value === 3 ? 3 : value === 2 ? 2 : fallback;
46
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/transitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAO5D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,CAW7E;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAc3F;AAED,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,gB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AuC/D;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAI5F;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,MAAM,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAKP;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,MAAM,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,GAAG,IAAI,CA2BhB;AAUD,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3F;AAED,wBAAsB,cAAc,CAClC,GAAG,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"}
@@ -6,6 +6,7 @@ import { readDirectWorkLock } from "../../../shared/direct-work-lock.js";
6
6
  import { CliError } from "../../../shared/errors.js";
7
7
  import { parseGitLogHashSubject } from "../../../shared/git-log.js";
8
8
  import { commitFromComment } from "../../guard/index.js";
9
+ import { refreshBranchPrArtifactsAfterTaskCommit } from "../../shared/post-commit-pr-artifacts.js";
9
10
  import { requiresVerificationByPrimary, toStringArray } from "./tags.js";
10
11
  const execFileAsync = promisify(execFile);
11
12
  export function appendTaskEvent(task, event) {
@@ -40,6 +41,7 @@ export function ensureVerificationSatisfiedIfRequired(task, config) {
40
41
  if (state === "ok")
41
42
  return;
42
43
  const hint = `use \`agentplane verify ${task.id} --ok|--rework --by <ID> --note <TEXT>\` ` +
44
+ `and add \`--observation <TEXT> --impact <TEXT> --resolution <TEXT>\` when you want a structured finding ` +
43
45
  `or \`agentplane task verify ok|rework ${task.id} --by <ID> --note <TEXT>\``;
44
46
  throw new CliError({
45
47
  exitCode: 3,
@@ -153,7 +155,7 @@ export async function runTaskTransitionCommentCommit(opts) {
153
155
  author: opts.author,
154
156
  })
155
157
  : undefined;
156
- return await commitFromComment({
158
+ const result = await commitFromComment({
157
159
  ctx: opts.ctx,
158
160
  cwd: opts.cwd,
159
161
  rootOverride: opts.rootOverride,
@@ -173,6 +175,14 @@ export async function runTaskTransitionCommentCommit(opts) {
173
175
  quiet: opts.quiet,
174
176
  config: opts.ctx.config,
175
177
  });
178
+ await refreshBranchPrArtifactsAfterTaskCommit({
179
+ ctx: opts.ctx,
180
+ cwd: opts.cwd,
181
+ rootOverride: opts.rootOverride,
182
+ taskId: opts.taskId,
183
+ quiet: opts.quiet,
184
+ });
185
+ return result;
176
186
  }
177
187
  export async function readHeadCommit(cwd) {
178
188
  const { stdout } = await execFileAsync("git", ["log", "-1", "--pretty=%H%x00%s"], { cwd });
@@ -1,5 +1,5 @@
1
1
  export { dedupeStrings } from "../../shared/strings.js";
2
- export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
2
+ export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, assertVerifyStepsFilled, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
3
3
  export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, type PrimaryTagResolution, type TaskTagPolicy, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
4
4
  export { type DependencyState, dependencyWarningMessages, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
5
5
  export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, emitTransitionWarnings, resolveCommentCommitWarning, requireStructuredComment, prepareTaskTransitionComment, resolveTaskTransitionExecutorAgent, runTaskTransitionCommentCommit, enforceStatusCommitPolicy, resolveStatusCommitPolicyWarning, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,6BAA6B,EAC7B,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,EAClC,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,+BAA+B,EAC/B,wCAAwC,EACxC,kCAAkC,EAClC,KAAK,mBAAmB,EACxB,KAAK,oCAAoC,EACzC,KAAK,uCAAuC,EAC5C,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,wCAAwC,EAC7C,KAAK,mCAAmC,GACzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EACL,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,YAAY,GACb,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAC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B,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,YAAY,GACb,MAAM,qBAAqB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export { dedupeStrings } from "../../shared/strings.js";
2
- export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
2
+ export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, assertVerifyStepsFilled, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
3
3
  export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
4
4
  export { dependencyWarningMessages, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
5
5
  export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, emitTransitionWarnings, resolveCommentCommitWarning, requireStructuredComment, prepareTaskTransitionComment, resolveTaskTransitionExecutorAgent, runTaskTransitionCommentCommit, enforceStatusCommitPolicy, resolveStatusCommitPolicyWarning, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"start-ready.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start-ready.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKpF,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,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuClB"}
1
+ {"version":3,"file":"start-ready.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start-ready.ts"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAkGpF,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,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ClB"}
@@ -1,10 +1,90 @@
1
+ import { mkdir, readFile, realpath } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { resolveBaseBranch } from "@agentplaneorg/core";
1
4
  import { mapBackendError } from "../../cli/error-map.js";
2
5
  import { infoMessage, successMessage } from "../../cli/output.js";
3
6
  import { CliError } from "../../shared/errors.js";
4
7
  import { renderIncidentAdvice } from "../../runtime/incidents/index.js";
8
+ import { writeTextIfChanged } from "../../shared/write-if-changed.js";
5
9
  import { loadCommandContext } from "../shared/task-backend.js";
6
10
  import { adviseTaskIncidents } from "../incidents/shared.js";
11
+ import { findWorktreeForBranch, listWorktrees, parseTaskIdFromBranch, parseTaskIdFromCloseBranch, } from "../shared/git-worktree.js";
7
12
  import { cmdStart } from "./start.js";
13
+ async function syncTaskReadmeAcrossRelevantWorktrees(opts) {
14
+ const canonicalizeWorktreePath = async (value) => {
15
+ try {
16
+ return await realpath(value);
17
+ }
18
+ catch {
19
+ return path.resolve(value);
20
+ }
21
+ };
22
+ const currentRoot = path.resolve(opts.rootOverride ?? opts.ctx.resolvedProject.gitRoot);
23
+ const currentCanonicalRoot = await canonicalizeWorktreePath(currentRoot);
24
+ const workflowDir = opts.ctx.config.paths.workflow_dir;
25
+ const sourceReadmePath = path.join(currentRoot, workflowDir, opts.taskId, "README.md");
26
+ let sourceText = "";
27
+ try {
28
+ sourceText = await readFile(sourceReadmePath, "utf8");
29
+ }
30
+ catch {
31
+ return;
32
+ }
33
+ const worktrees = await listWorktrees(currentRoot).catch(() => []);
34
+ const normalizedWorktrees = await Promise.all(worktrees.map(async (entry) => ({
35
+ ...entry,
36
+ canonicalPath: await canonicalizeWorktreePath(entry.path),
37
+ })));
38
+ const targetRoots = new Set();
39
+ const baseBranch = await resolveBaseBranch({
40
+ cwd: opts.cwd,
41
+ rootOverride: opts.rootOverride ?? null,
42
+ cliBaseOpt: null,
43
+ mode: opts.ctx.config.workflow_mode,
44
+ });
45
+ if (baseBranch) {
46
+ const baseWorktree = await findWorktreeForBranch(currentRoot, baseBranch);
47
+ if (baseWorktree) {
48
+ const canonicalBaseWorktree = await canonicalizeWorktreePath(baseWorktree);
49
+ if (canonicalBaseWorktree !== currentCanonicalRoot) {
50
+ targetRoots.add(canonicalBaseWorktree);
51
+ }
52
+ }
53
+ }
54
+ if (targetRoots.size === 0) {
55
+ const mainWorktree = normalizedWorktrees.find((entry) => entry.branch === "main" || entry.branch === "refs/heads/main");
56
+ if (mainWorktree && mainWorktree.canonicalPath !== currentCanonicalRoot) {
57
+ targetRoots.add(mainWorktree.canonicalPath);
58
+ }
59
+ }
60
+ if (targetRoots.size === 0) {
61
+ const nonTaskWorktrees = normalizedWorktrees.filter((entry) => {
62
+ if (!entry.branch)
63
+ return false;
64
+ if (entry.canonicalPath === currentCanonicalRoot)
65
+ return false;
66
+ if (parseTaskIdFromBranch(opts.ctx.config.branch.task_prefix, entry.branch))
67
+ return false;
68
+ if (parseTaskIdFromCloseBranch(entry.branch))
69
+ return false;
70
+ return true;
71
+ });
72
+ if (nonTaskWorktrees.length === 1) {
73
+ targetRoots.add(nonTaskWorktrees[0].canonicalPath);
74
+ }
75
+ }
76
+ const matchingTaskWorktrees = normalizedWorktrees.filter((entry) => typeof entry.branch === "string" &&
77
+ parseTaskIdFromBranch(opts.ctx.config.branch.task_prefix, entry.branch) === opts.taskId &&
78
+ entry.canonicalPath !== currentCanonicalRoot);
79
+ if (matchingTaskWorktrees.length === 1) {
80
+ targetRoots.add(matchingTaskWorktrees[0].canonicalPath);
81
+ }
82
+ for (const targetRoot of targetRoots) {
83
+ const targetReadmePath = path.join(targetRoot, workflowDir, opts.taskId, "README.md");
84
+ await mkdir(path.dirname(targetReadmePath), { recursive: true });
85
+ await writeTextIfChanged(targetReadmePath, sourceText);
86
+ }
87
+ }
8
88
  export async function cmdTaskStartReady(opts) {
9
89
  try {
10
90
  const ctx = opts.ctx ??
@@ -26,6 +106,12 @@ export async function cmdTaskStartReady(opts) {
26
106
  yes: opts.yes,
27
107
  quiet: true,
28
108
  });
109
+ await syncTaskReadmeAcrossRelevantWorktrees({
110
+ ctx,
111
+ cwd: opts.cwd,
112
+ rootOverride: opts.rootOverride,
113
+ taskId: opts.taskId,
114
+ });
29
115
  if (!opts.quiet) {
30
116
  process.stdout.write(`${successMessage("ready", opts.taskId)}\n`);
31
117
  const advice = await adviseTaskIncidents({
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AA6DpF,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,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,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+FlB"}
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAyDpF,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,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,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+FlB"}
@@ -4,7 +4,7 @@ import { CliError } from "../../shared/errors.js";
4
4
  import { ensureActionApproved } from "../shared/approval-requirements.js";
5
5
  import { loadCommandContext } from "../shared/task-backend.js";
6
6
  import { ensurePrArtifactsSynced } from "../pr/internal/sync.js";
7
- import { applyTaskStatusTransitionCommand, ensurePlanApprovedIfRequired, extractTaskObservationSection, defaultCommitEmojiForStatus, extractDocSection, isVerifyStepsFilled, normalizeTaskDocVersion, nowIso, prepareTaskTransitionComment, requiresVerifyStepsByPrimary, requireStructuredComment, runTaskTransitionCommentCommit, taskObservationSectionName, toStringArray, } from "./shared.js";
7
+ import { applyTaskStatusTransitionCommand, assertVerifyStepsFilled, ensurePlanApprovedIfRequired, extractTaskObservationSection, defaultCommitEmojiForStatus, extractDocSection, normalizeTaskDocVersion, nowIso, prepareTaskTransitionComment, requiresVerifyStepsByPrimary, requireStructuredComment, runTaskTransitionCommentCommit, taskObservationSectionName, toStringArray, } from "./shared.js";
8
8
  function assertStartDocRequirements(task, config) {
9
9
  if (config.agents?.approvals?.require_plan === true)
10
10
  return;
@@ -17,15 +17,12 @@ function assertStartDocRequirements(task, config) {
17
17
  const isSpike = tags.some((tag) => tag.trim().toLowerCase() === spikeTag);
18
18
  const doc = typeof task.doc === "string" ? task.doc : "";
19
19
  if (verifyRequired || isSpike) {
20
- const verifySteps = extractDocSection(doc, "Verify Steps");
21
- if (!isVerifyStepsFilled(verifySteps)) {
22
- throw new CliError({
23
- exitCode: 3,
24
- code: "E_VALIDATION",
25
- message: `${task.id}: cannot start work: ## Verify Steps section is missing/empty/unfilled ` +
26
- "(fill it before starting work when plan approval is disabled)",
27
- });
28
- }
20
+ assertVerifyStepsFilled({
21
+ taskId: task.id,
22
+ sectionText: extractDocSection(doc, "Verify Steps"),
23
+ action: "start work",
24
+ guidance: "fill it before starting work when plan approval is disabled",
25
+ });
29
26
  }
30
27
  if (!isSpike)
31
28
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"task.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/task.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,KAAK,eAAe,GAAG,kBAAkB,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,eAAe,CA8CjD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,kBAAkB,CAOtD,CAAC"}
1
+ {"version":3,"file":"task.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/task.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,KAAK,eAAe,GAAG,kBAAkB,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,eAAe,CAkDjD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,kBAAkB,CAOtD,CAAC"}
@@ -39,6 +39,10 @@ export const taskSpec = {
39
39
  cmd: 'agentplane task hosted-close --event-json "$GITHUB_EVENT_PATH"',
40
40
  why: "Apply deterministic task closure from a merged hosted PR event on an automation branch.",
41
41
  },
42
+ {
43
+ cmd: "agentplane task hosted-close-pr 202604091218-JREJ4K",
44
+ why: "Open the hosted closure PR after a manual handoff comment leaves only the remote task-close branch.",
45
+ },
42
46
  {
43
47
  cmd: "agentplane task resume-context <task-id>",
44
48
  why: "Inspect deterministic recovery context before resuming or retrying a run.",
@@ -2,15 +2,34 @@ import type { CommandSpec, OptionSpec, ParsedRaw } from "../../cli/spec/spec.js"
2
2
  export type VerifyCommonParsed = {
3
3
  by: string;
4
4
  note: string;
5
+ noteFile?: string;
5
6
  details?: string;
6
7
  file?: string;
7
8
  quiet: boolean;
9
+ collectIncidents: boolean;
10
+ observation?: string;
11
+ impact?: string;
12
+ resolution?: string;
13
+ localOnly: boolean;
14
+ repoFixable: boolean;
15
+ incidentScope?: string;
16
+ incidentTags: string[];
17
+ incidentMatch: string[];
18
+ incidentAdvice?: string;
19
+ incidentRule?: string;
8
20
  };
21
+ export declare const verifyFindingOptions: readonly OptionSpec[];
9
22
  export declare const verifyCommonOptions: readonly OptionSpec[];
10
23
  export declare function validateVerifyDetailsFileExclusive<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
11
24
  command?: string;
12
25
  message?: string;
13
26
  }): void;
14
27
  export declare function validateVerifyNonEmptyInput<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, name: "by" | "note"): void;
28
+ export declare function validateVerifyNoteSource<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
29
+ command?: string;
30
+ }): void;
31
+ export declare function validateVerifyFindingSource<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
32
+ command?: string;
33
+ }): void;
15
34
  export declare function parseVerifyCommonOptions(raw: ParsedRaw): VerifyCommonParsed;
16
35
  //# sourceMappingURL=verify-command-shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify-command-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-command-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,SAAS,UAAU,EA2B3C,CAAC;AAEX,wBAAgB,kCAAkC,CAAC,OAAO,EACxD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,IAAI,CAQN;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EACjD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,EAAE,IAAI,GAAG,MAAM,GAClB,IAAI,CAKN;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,SAAS,GAAG,kBAAkB,CAQ3E"}
1
+ {"version":3,"file":"verify-command-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-command-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAA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