agentplane 0.3.9 → 0.3.10

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 (244) hide show
  1. package/assets/AGENTS.md +4 -2
  2. package/assets/agents/CODER.json +1 -1
  3. package/assets/policy/dod.core.md +1 -1
  4. package/assets/policy/governance.md +3 -0
  5. package/assets/policy/incidents.md +22 -11
  6. package/assets/policy/workflow.branch_pr.md +2 -0
  7. package/assets/policy/workflow.direct.md +3 -1
  8. package/dist/.build-manifest.json +305 -110
  9. package/dist/cli/bootstrap-guide.d.ts +1 -0
  10. package/dist/cli/bootstrap-guide.d.ts.map +1 -1
  11. package/dist/cli/bootstrap-guide.js +19 -1
  12. package/dist/cli/command-invocations.d.ts.map +1 -1
  13. package/dist/cli/command-invocations.js +2 -0
  14. package/dist/cli/command-snippets.d.ts +2 -0
  15. package/dist/cli/command-snippets.d.ts.map +1 -1
  16. package/dist/cli/command-snippets.js +2 -0
  17. package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
  18. package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
  19. package/dist/cli/run-cli/command-catalog/core.js +10 -0
  20. package/dist/cli/run-cli/command-catalog.d.ts +1 -1
  21. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  22. package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
  23. package/dist/cli/run-cli/commands/config.js +13 -0
  24. package/dist/cli/run-cli.js +2 -2
  25. package/dist/commands/backend.d.ts.map +1 -1
  26. package/dist/commands/backend.js +4 -0
  27. package/dist/commands/incidents/advise.command.d.ts +15 -0
  28. package/dist/commands/incidents/advise.command.d.ts.map +1 -0
  29. package/dist/commands/incidents/advise.command.js +139 -0
  30. package/dist/commands/incidents/collect.command.d.ts +11 -0
  31. package/dist/commands/incidents/collect.command.d.ts.map +1 -0
  32. package/dist/commands/incidents/collect.command.js +67 -0
  33. package/dist/commands/incidents/incidents.command.d.ts +5 -0
  34. package/dist/commands/incidents/incidents.command.d.ts.map +1 -0
  35. package/dist/commands/incidents/incidents.command.js +21 -0
  36. package/dist/commands/incidents/shared.d.ts +42 -0
  37. package/dist/commands/incidents/shared.d.ts.map +1 -0
  38. package/dist/commands/incidents/shared.js +107 -0
  39. package/dist/commands/pr/check.d.ts.map +1 -1
  40. package/dist/commands/pr/check.js +73 -2
  41. package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
  42. package/dist/commands/pr/integrate/cmd.js +4 -0
  43. package/dist/commands/pr/integrate/internal/merge.d.ts +4 -0
  44. package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
  45. package/dist/commands/pr/integrate/internal/merge.js +23 -2
  46. package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
  47. package/dist/commands/pr/integrate/internal/prepare.js +26 -1
  48. package/dist/commands/pr/internal/note-store.d.ts +18 -0
  49. package/dist/commands/pr/internal/note-store.d.ts.map +1 -0
  50. package/dist/commands/pr/internal/note-store.js +66 -0
  51. package/dist/commands/pr/internal/pr-paths.d.ts +3 -0
  52. package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
  53. package/dist/commands/pr/internal/pr-paths.js +3 -0
  54. package/dist/commands/pr/internal/review-template.d.ts +24 -4
  55. package/dist/commands/pr/internal/review-template.d.ts.map +1 -1
  56. package/dist/commands/pr/internal/review-template.js +188 -33
  57. package/dist/commands/pr/internal/sync.d.ts +32 -0
  58. package/dist/commands/pr/internal/sync.d.ts.map +1 -0
  59. package/dist/commands/pr/internal/sync.js +258 -0
  60. package/dist/commands/pr/note.d.ts.map +1 -1
  61. package/dist/commands/pr/note.js +37 -4
  62. package/dist/commands/pr/open.d.ts.map +1 -1
  63. package/dist/commands/pr/open.js +7 -54
  64. package/dist/commands/pr/pr.command.d.ts.map +1 -1
  65. package/dist/commands/pr/pr.command.js +6 -3
  66. package/dist/commands/pr/update.d.ts.map +1 -1
  67. package/dist/commands/pr/update.js +5 -79
  68. package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -1
  69. package/dist/commands/recipes/impl/commands/cache-prune.js +14 -0
  70. package/dist/commands/recipes/impl/commands/install.js +1 -1
  71. package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
  72. package/dist/commands/recipes/impl/commands/list-remote.js +1 -0
  73. package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
  74. package/dist/commands/recipes/impl/commands/remove.js +9 -1
  75. package/dist/commands/release/apply.command.d.ts.map +1 -1
  76. package/dist/commands/release/apply.command.js +9 -0
  77. package/dist/commands/shared/approval-requirements.d.ts +5 -7
  78. package/dist/commands/shared/approval-requirements.d.ts.map +1 -1
  79. package/dist/commands/shared/approval-requirements.js +3 -73
  80. package/dist/commands/shared/network-approval.d.ts +2 -0
  81. package/dist/commands/shared/network-approval.d.ts.map +1 -1
  82. package/dist/commands/shared/network-approval.js +1 -1
  83. package/dist/commands/shared/pr-meta.d.ts +9 -0
  84. package/dist/commands/shared/pr-meta.d.ts.map +1 -1
  85. package/dist/commands/shared/pr-meta.js +27 -3
  86. package/dist/commands/shared/task-backend.d.ts +2 -0
  87. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  88. package/dist/commands/shared/task-local-freshness.d.ts +13 -0
  89. package/dist/commands/shared/task-local-freshness.d.ts.map +1 -0
  90. package/dist/commands/shared/task-local-freshness.js +20 -0
  91. package/dist/commands/shared/task-mutation.d.ts +2 -0
  92. package/dist/commands/shared/task-mutation.d.ts.map +1 -1
  93. package/dist/commands/shared/task-mutation.js +7 -0
  94. package/dist/commands/task/block.d.ts.map +1 -1
  95. package/dist/commands/task/block.js +1 -0
  96. package/dist/commands/task/close-shared.d.ts.map +1 -1
  97. package/dist/commands/task/close-shared.js +1 -0
  98. package/dist/commands/task/finish-shared.d.ts.map +1 -1
  99. package/dist/commands/task/finish-shared.js +5 -2
  100. package/dist/commands/task/finish.d.ts.map +1 -1
  101. package/dist/commands/task/finish.js +24 -0
  102. package/dist/commands/task/new.d.ts.map +1 -1
  103. package/dist/commands/task/new.js +69 -29
  104. package/dist/commands/task/set-status.d.ts.map +1 -1
  105. package/dist/commands/task/set-status.js +1 -0
  106. package/dist/commands/task/shared/transition-command.d.ts +2 -0
  107. package/dist/commands/task/shared/transition-command.d.ts.map +1 -1
  108. package/dist/commands/task/shared/transition-command.js +1 -0
  109. package/dist/commands/task/start-ready.d.ts.map +1 -1
  110. package/dist/commands/task/start-ready.js +12 -1
  111. package/dist/commands/task/start.d.ts.map +1 -1
  112. package/dist/commands/task/start.js +11 -0
  113. package/dist/commands/task/verify-record.d.ts.map +1 -1
  114. package/dist/commands/task/verify-record.js +27 -0
  115. package/dist/commands/upgrade.d.ts.map +1 -1
  116. package/dist/commands/upgrade.js +6 -1
  117. package/dist/policy/engine.d.ts +3 -1
  118. package/dist/policy/engine.d.ts.map +1 -1
  119. package/dist/policy/engine.js +5 -6
  120. package/dist/policy/taxonomy.d.ts +17 -0
  121. package/dist/policy/taxonomy.d.ts.map +1 -0
  122. package/dist/policy/taxonomy.js +302 -0
  123. package/dist/policy/types.d.ts +2 -1
  124. package/dist/policy/types.d.ts.map +1 -1
  125. package/dist/runner/artifacts.d.ts.map +1 -1
  126. package/dist/runner/artifacts.js +2 -0
  127. package/dist/runner/context/base-prompts.d.ts +25 -0
  128. package/dist/runner/context/base-prompts.d.ts.map +1 -1
  129. package/dist/runner/context/base-prompts.js +182 -54
  130. package/dist/runner/context/recipe-context.d.ts.map +1 -1
  131. package/dist/runner/context/recipe-context.js +5 -0
  132. package/dist/runner/types.d.ts +12 -0
  133. package/dist/runner/types.d.ts.map +1 -1
  134. package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -1
  135. package/dist/runner/usecases/scenario-materialize-task.js +81 -11
  136. package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -1
  137. package/dist/runner/usecases/task-run-inspect.js +9 -7
  138. package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -1
  139. package/dist/runner/usecases/task-run-lifecycle-shared.js +8 -6
  140. package/dist/runner/usecases/task-run.d.ts.map +1 -1
  141. package/dist/runner/usecases/task-run.js +59 -12
  142. package/dist/runtime/approvals/index.d.ts +3 -0
  143. package/dist/runtime/approvals/index.d.ts.map +1 -0
  144. package/dist/runtime/approvals/index.js +1 -0
  145. package/dist/runtime/approvals/runtime.d.ts +12 -0
  146. package/dist/runtime/approvals/runtime.d.ts.map +1 -0
  147. package/dist/runtime/approvals/runtime.js +154 -0
  148. package/dist/runtime/approvals/types.d.ts +31 -0
  149. package/dist/runtime/approvals/types.d.ts.map +1 -0
  150. package/dist/runtime/approvals/types.js +1 -0
  151. package/dist/runtime/behavior/index.d.ts +3 -0
  152. package/dist/runtime/behavior/index.d.ts.map +1 -0
  153. package/dist/runtime/behavior/index.js +1 -0
  154. package/dist/runtime/behavior/resolve.d.ts +7 -0
  155. package/dist/runtime/behavior/resolve.d.ts.map +1 -0
  156. package/dist/runtime/behavior/resolve.js +66 -0
  157. package/dist/runtime/behavior/types.d.ts +25 -0
  158. package/dist/runtime/behavior/types.d.ts.map +1 -0
  159. package/dist/runtime/behavior/types.js +1 -0
  160. package/dist/runtime/capabilities/backend.d.ts +7 -0
  161. package/dist/runtime/capabilities/backend.d.ts.map +1 -0
  162. package/dist/runtime/capabilities/backend.js +104 -0
  163. package/dist/runtime/capabilities/index.d.ts +6 -0
  164. package/dist/runtime/capabilities/index.d.ts.map +1 -0
  165. package/dist/runtime/capabilities/index.js +4 -0
  166. package/dist/runtime/capabilities/recipe.d.ts +10 -0
  167. package/dist/runtime/capabilities/recipe.d.ts.map +1 -0
  168. package/dist/runtime/capabilities/recipe.js +123 -0
  169. package/dist/runtime/capabilities/registry.d.ts +6 -0
  170. package/dist/runtime/capabilities/registry.d.ts.map +1 -0
  171. package/dist/runtime/capabilities/registry.js +69 -0
  172. package/dist/runtime/capabilities/runner.d.ts +8 -0
  173. package/dist/runtime/capabilities/runner.d.ts.map +1 -0
  174. package/dist/runtime/capabilities/runner.js +73 -0
  175. package/dist/runtime/capabilities/types.d.ts +28 -0
  176. package/dist/runtime/capabilities/types.d.ts.map +1 -0
  177. package/dist/runtime/capabilities/types.js +1 -0
  178. package/dist/runtime/execution-profile/index.d.ts +3 -0
  179. package/dist/runtime/execution-profile/index.d.ts.map +1 -0
  180. package/dist/runtime/execution-profile/index.js +1 -0
  181. package/dist/runtime/execution-profile/resolve.d.ts +9 -0
  182. package/dist/runtime/execution-profile/resolve.d.ts.map +1 -0
  183. package/dist/runtime/execution-profile/resolve.js +80 -0
  184. package/dist/runtime/execution-profile/types.d.ts +27 -0
  185. package/dist/runtime/execution-profile/types.d.ts.map +1 -0
  186. package/dist/runtime/execution-profile/types.js +1 -0
  187. package/dist/runtime/explain/index.d.ts +3 -0
  188. package/dist/runtime/explain/index.d.ts.map +1 -0
  189. package/dist/runtime/explain/index.js +1 -0
  190. package/dist/runtime/explain/resolve.d.ts +14 -0
  191. package/dist/runtime/explain/resolve.d.ts.map +1 -0
  192. package/dist/runtime/explain/resolve.js +50 -0
  193. package/dist/runtime/explain/types.d.ts +28 -0
  194. package/dist/runtime/explain/types.d.ts.map +1 -0
  195. package/dist/runtime/explain/types.js +1 -0
  196. package/dist/runtime/harness/index.d.ts +4 -0
  197. package/dist/runtime/harness/index.d.ts.map +1 -0
  198. package/dist/runtime/harness/index.js +2 -0
  199. package/dist/runtime/harness/resolve-from-command-context.d.ts +4 -0
  200. package/dist/runtime/harness/resolve-from-command-context.d.ts.map +1 -0
  201. package/dist/runtime/harness/resolve-from-command-context.js +11 -0
  202. package/dist/runtime/harness/resolve.d.ts +13 -0
  203. package/dist/runtime/harness/resolve.d.ts.map +1 -0
  204. package/dist/runtime/harness/resolve.js +146 -0
  205. package/dist/runtime/harness/types.d.ts +65 -0
  206. package/dist/runtime/harness/types.d.ts.map +1 -0
  207. package/dist/runtime/harness/types.js +1 -0
  208. package/dist/runtime/incidents/index.d.ts +3 -0
  209. package/dist/runtime/incidents/index.d.ts.map +1 -0
  210. package/dist/runtime/incidents/index.js +1 -0
  211. package/dist/runtime/incidents/resolve.d.ts +26 -0
  212. package/dist/runtime/incidents/resolve.d.ts.map +1 -0
  213. package/dist/runtime/incidents/resolve.js +437 -0
  214. package/dist/runtime/incidents/types.d.ts +72 -0
  215. package/dist/runtime/incidents/types.d.ts.map +1 -0
  216. package/dist/runtime/incidents/types.js +1 -0
  217. package/dist/runtime/protocol/index.d.ts +3 -0
  218. package/dist/runtime/protocol/index.d.ts.map +1 -0
  219. package/dist/runtime/protocol/index.js +2 -0
  220. package/dist/runtime/protocol/resolve.d.ts +16 -0
  221. package/dist/runtime/protocol/resolve.d.ts.map +1 -0
  222. package/dist/runtime/protocol/resolve.js +36 -0
  223. package/dist/runtime/protocol/types.d.ts +36 -0
  224. package/dist/runtime/protocol/types.d.ts.map +1 -0
  225. package/dist/runtime/protocol/types.js +1 -0
  226. package/dist/runtime/task-intake/index.d.ts +3 -0
  227. package/dist/runtime/task-intake/index.d.ts.map +1 -0
  228. package/dist/runtime/task-intake/index.js +1 -0
  229. package/dist/runtime/task-intake/resolve.d.ts +48 -0
  230. package/dist/runtime/task-intake/resolve.d.ts.map +1 -0
  231. package/dist/runtime/task-intake/resolve.js +316 -0
  232. package/dist/runtime/task-intake/types.d.ts +117 -0
  233. package/dist/runtime/task-intake/types.d.ts.map +1 -0
  234. package/dist/runtime/task-intake/types.js +1 -0
  235. package/dist/shared/protected-paths.d.ts +4 -0
  236. package/dist/shared/protected-paths.d.ts.map +1 -1
  237. package/dist/shared/protected-paths.js +4 -4
  238. package/dist/usecases/context/resolve-context.d.ts +55 -6
  239. package/dist/usecases/context/resolve-context.d.ts.map +1 -1
  240. package/dist/usecases/context/resolve-context.js +96 -6
  241. package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
  242. package/dist/usecases/task/task-list-usecase.js +8 -2
  243. package/dist/usecases/task/task-new-usecase.js +4 -4
  244. package/package.json +2 -2
@@ -1,20 +1,9 @@
1
- import { mkdir, readFile } from "node:fs/promises";
2
1
  import path from "node:path";
3
- import { atomicWriteFile } from "@agentplaneorg/core";
4
2
  import { mapBackendError } from "../../cli/error-map.js";
5
3
  import { exitCodeForError } from "../../cli/exit-codes.js";
6
- import { fileExists } from "../../cli/fs-utils.js";
7
- import { createCliEmitter, workflowModeMessage } from "../../cli/output.js";
4
+ import { createCliEmitter } from "../../cli/output.js";
8
5
  import { CliError } from "../../shared/errors.js";
9
- import { writeJsonStableIfChanged, writeTextIfChanged } from "../../shared/write-if-changed.js";
10
- import { gitCurrentBranch } from "../shared/git-ops.js";
11
- import { buildOpenedPrMeta, parsePrMeta } from "../shared/pr-meta.js";
12
- import { loadBackendTask, loadCommandContext, } from "../shared/task-backend.js";
13
- import { resolvePrPaths } from "./internal/pr-paths.js";
14
- import { renderPrReviewTemplate } from "./internal/review-template.js";
15
- function nowIso() {
16
- return new Date().toISOString();
17
- }
6
+ import { syncPrArtifacts } from "./internal/sync.js";
18
7
  export async function cmdPrOpen(opts) {
19
8
  try {
20
9
  const output = createCliEmitter();
@@ -26,51 +15,15 @@ export async function cmdPrOpen(opts) {
26
15
  message: "Invalid value for --author.",
27
16
  });
28
17
  }
29
- const ctx = opts.ctx ??
30
- (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
31
- const { task } = await loadBackendTask({
32
- ctx,
18
+ const { prDir, resolved } = await syncPrArtifacts({
19
+ ctx: opts.ctx,
33
20
  cwd: opts.cwd,
34
21
  rootOverride: opts.rootOverride,
35
22
  taskId: opts.taskId,
23
+ mode: "open",
24
+ author,
25
+ branch: opts.branch,
36
26
  });
37
- const { resolved, config, prDir, metaPath, diffstatPath, verifyLogPath, reviewPath } = await resolvePrPaths({ ...opts, ctx });
38
- if (config.workflow_mode !== "branch_pr") {
39
- throw new CliError({
40
- exitCode: exitCodeForError("E_USAGE"),
41
- code: "E_USAGE",
42
- message: workflowModeMessage(config.workflow_mode, "branch_pr"),
43
- });
44
- }
45
- const branch = (opts.branch ?? (await gitCurrentBranch(resolved.gitRoot))).trim();
46
- if (!branch) {
47
- throw new CliError({
48
- exitCode: exitCodeForError("E_USAGE"),
49
- code: "E_USAGE",
50
- message: "Branch could not be resolved (use --branch).",
51
- });
52
- }
53
- await mkdir(prDir, { recursive: true });
54
- const now = nowIso();
55
- let meta = null;
56
- if (await fileExists(metaPath)) {
57
- const raw = await readFile(metaPath, "utf8");
58
- meta = parsePrMeta(raw, task.id);
59
- }
60
- const createdAt = meta?.created_at ?? now;
61
- const nextMeta = buildOpenedPrMeta({
62
- taskId: task.id,
63
- branch,
64
- at: now,
65
- previousMeta: meta,
66
- });
67
- await writeJsonStableIfChanged(metaPath, nextMeta);
68
- await writeTextIfChanged(diffstatPath, "");
69
- await writeTextIfChanged(verifyLogPath, "");
70
- if (!(await fileExists(reviewPath))) {
71
- const review = renderPrReviewTemplate({ author, createdAt, branch });
72
- await atomicWriteFile(reviewPath, review, "utf8");
73
- }
74
27
  output.success("pr open", path.relative(resolved.gitRoot, prDir));
75
28
  return 0;
76
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pr.command.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/pr.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,KAAK,aAAa,GAAG,kBAAkB,CAAC;AAExC,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,aAAa,CAgB7C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAErF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAgChD,CAAC;AAEF,MAAM,MAAM,cAAc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C,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACrE,KAAK,UAAU,EAAE,GAAG,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,CAUjE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACvE,KAAK,UAAU,EAAE,GAAG,cAAc,KAAG,OAAO,CAAC,MAAM,CAAC,CAQnE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACtE,KAAK,UAAU,EAAE,GAAG,aAAa,KAAG,OAAO,CAAC,MAAM,CAAC,CAQlE;AAED,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,CAUjE"}
@@ -4,12 +4,15 @@ import { cmdPrCheck, cmdPrNote, cmdPrOpen, cmdPrUpdate } from "./index.js";
4
4
  export const prSpec = {
5
5
  id: ["pr"],
6
6
  group: "PR",
7
- summary: "Manage local PR artifacts for a task (branch_pr workflow).",
7
+ summary: "Manage local PR review and GitHub publication artifacts for a task (branch_pr workflow).",
8
8
  synopsis: ["agentplane pr <open|update|check|note> <task-id> [options]"],
9
9
  args: [{ name: "cmd", required: false, variadic: true, valueHint: "<cmd>" }],
10
10
  examples: [
11
11
  { cmd: "agentplane pr open 202602030608-F1Q8AB --author CODER", why: "Create PR artifacts." },
12
- { cmd: "agentplane pr update 202602030608-F1Q8AB", why: "Refresh diffstat and summary." },
12
+ {
13
+ cmd: "agentplane pr update 202602030608-F1Q8AB",
14
+ why: "Refresh review.md plus github-title/body projections.",
15
+ },
13
16
  { cmd: "agentplane pr check 202602030608-F1Q8AB", why: "Validate PR artifacts." },
14
17
  {
15
18
  cmd: 'agentplane pr note 202602030608-F1Q8AB --author REVIEWER --body "Looks good"',
@@ -54,7 +57,7 @@ export const prOpenSpec = {
54
57
  export const prUpdateSpec = {
55
58
  id: ["pr", "update"],
56
59
  group: "PR",
57
- summary: "Update PR artifacts (diffstat and auto summary).",
60
+ summary: "Update PR artifacts (review packet, diffstat, and GitHub projections).",
58
61
  args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
59
62
  examples: [{ cmd: "agentplane pr update 202602030608-F1Q8AB", why: "Update artifacts." }],
60
63
  parse: (raw) => ({ taskId: String(raw.args["task-id"]) }),
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/update.ts"],"names":[],"mappings":"AAaA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AASnC,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACtC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAwFlB"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/update.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACtC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlB"}
@@ -1,92 +1,18 @@
1
- import { readFile } from "node:fs/promises";
2
1
  import path from "node:path";
3
- import { resolveBaseBranch } from "@agentplaneorg/core";
4
2
  import { mapBackendError } from "../../cli/error-map.js";
5
- import { fileExists } from "../../cli/fs-utils.js";
6
- import { createCliEmitter, workflowModeMessage } from "../../cli/output.js";
3
+ import { createCliEmitter } from "../../cli/output.js";
7
4
  import { CliError } from "../../shared/errors.js";
8
- import { writeJsonStableIfChanged, writeTextIfChanged } from "../../shared/write-if-changed.js";
9
- import { execFileAsync, gitEnv } from "../shared/git.js";
10
- import { gitCurrentBranch } from "../shared/git-ops.js";
11
- import { buildUpdatedPrMeta, parsePrMeta } from "../shared/pr-meta.js";
12
- import { loadBackendTask, loadCommandContext, } from "../shared/task-backend.js";
13
- import { resolvePrPaths } from "./internal/pr-paths.js";
14
- import { updateAutoSummaryBlock } from "./internal/review-template.js";
15
- function nowIso() {
16
- return new Date().toISOString();
17
- }
5
+ import { syncPrArtifacts } from "./internal/sync.js";
18
6
  export async function cmdPrUpdate(opts) {
19
7
  try {
20
8
  const output = createCliEmitter();
21
- const ctx = opts.ctx ??
22
- (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
23
- await loadBackendTask({
24
- ctx,
9
+ const { prDir, resolved } = await syncPrArtifacts({
10
+ ctx: opts.ctx,
25
11
  cwd: opts.cwd,
26
12
  rootOverride: opts.rootOverride,
27
13
  taskId: opts.taskId,
14
+ mode: "update",
28
15
  });
29
- const { resolved, config, prDir, metaPath, diffstatPath, reviewPath } = await resolvePrPaths({
30
- ...opts,
31
- ctx,
32
- });
33
- if (config.workflow_mode !== "branch_pr") {
34
- throw new CliError({
35
- exitCode: 2,
36
- code: "E_USAGE",
37
- message: workflowModeMessage(config.workflow_mode, "branch_pr"),
38
- });
39
- }
40
- if (!(await fileExists(metaPath)) || !(await fileExists(reviewPath))) {
41
- const missing = [];
42
- if (!(await fileExists(metaPath)))
43
- missing.push(path.relative(resolved.gitRoot, metaPath));
44
- if (!(await fileExists(reviewPath)))
45
- missing.push(path.relative(resolved.gitRoot, reviewPath));
46
- throw new CliError({
47
- exitCode: 3,
48
- code: "E_VALIDATION",
49
- message: `PR artifacts missing: ${missing.join(", ")} (run \`agentplane pr open\`)`,
50
- });
51
- }
52
- const baseBranch = await resolveBaseBranch({
53
- cwd: opts.cwd,
54
- rootOverride: opts.rootOverride ?? null,
55
- cliBaseOpt: null,
56
- mode: config.workflow_mode,
57
- });
58
- if (!baseBranch) {
59
- throw new CliError({
60
- exitCode: 2,
61
- code: "E_USAGE",
62
- message: "Base branch could not be resolved (use `agentplane branch base set`).",
63
- });
64
- }
65
- const branch = await gitCurrentBranch(resolved.gitRoot);
66
- const { stdout: diffStatOut } = await execFileAsync("git", ["diff", "--stat", `${baseBranch}...HEAD`], { cwd: resolved.gitRoot, env: gitEnv() });
67
- const diffstat = diffStatOut.trimEnd();
68
- await writeTextIfChanged(diffstatPath, diffstat ? `${diffstat}\n` : "");
69
- const { stdout: headOut } = await execFileAsync("git", ["rev-parse", "HEAD"], {
70
- cwd: resolved.gitRoot,
71
- env: gitEnv(),
72
- });
73
- const headSha = headOut.trim();
74
- const summaryLines = [
75
- `- Updated: ${nowIso()}`,
76
- `- Branch: ${branch}`,
77
- `- Head: ${headSha.slice(0, 12)}`,
78
- "- Diffstat:",
79
- "```",
80
- diffstat || "No changes detected.",
81
- "```",
82
- ];
83
- const reviewText = await readFile(reviewPath, "utf8");
84
- const nextReview = updateAutoSummaryBlock(reviewText, summaryLines.join("\n"));
85
- await writeTextIfChanged(reviewPath, nextReview);
86
- const rawMeta = await readFile(metaPath, "utf8");
87
- const meta = parsePrMeta(rawMeta, opts.taskId);
88
- const nextMeta = buildUpdatedPrMeta({ meta, branch, at: nowIso() });
89
- await writeJsonStableIfChanged(metaPath, nextMeta);
90
16
  output.success("pr update", path.relative(resolved.gitRoot, prDir));
91
17
  return 0;
92
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cache-prune.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/cache-prune.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AA6BzD,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,qBAAqB,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAkFlB"}
1
+ {"version":3,"file":"cache-prune.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/cache-prune.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AA6BzD,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,qBAAqB,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CA8FlB"}
@@ -1,9 +1,11 @@
1
1
  import { readdir, rm } from "node:fs/promises";
2
2
  import path from "node:path";
3
+ import { defaultConfig } from "@agentplaneorg/core";
3
4
  import { mapCoreError } from "../../../../cli/error-map.js";
4
5
  import { fileExists } from "../../../../cli/fs-utils.js";
5
6
  import { infoMessage, successMessage } from "../../../../cli/output.js";
6
7
  import { CliError } from "../../../../shared/errors.js";
8
+ import { ensureActionApproved } from "../../../shared/approval-requirements.js";
7
9
  import { readInstalledRecipesFile, writeInstalledRecipesFile } from "../installed-recipes.js";
8
10
  import { resolveGlobalRecipesDir, resolveInstalledRecipesPath } from "../paths.js";
9
11
  async function listRecipeCacheEntries(cacheDir) {
@@ -49,6 +51,12 @@ export async function cmdRecipeCachePruneParsed(opts) {
49
51
  process.stdout.write(`${infoMessage(`dry-run: would remove ${cacheEntries.length} cached recipes`)}\n`);
50
52
  return 0;
51
53
  }
54
+ await ensureActionApproved({
55
+ action: "dangerous_fs",
56
+ config: defaultConfig(),
57
+ yes: false,
58
+ reason: `recipes cache prune --all (${cacheEntries.length} cached recipes)`,
59
+ });
52
60
  await rm(cacheDir, { recursive: true, force: true });
53
61
  await writeInstalledRecipesFile(resolveInstalledRecipesPath(), {
54
62
  schema_version: 1,
@@ -72,6 +80,12 @@ export async function cmdRecipeCachePruneParsed(opts) {
72
80
  process.stdout.write(`${infoMessage(`dry-run: would remove ${prune.length} cached recipes`)}\n`);
73
81
  return 0;
74
82
  }
83
+ await ensureActionApproved({
84
+ action: "dangerous_fs",
85
+ config: defaultConfig(),
86
+ yes: false,
87
+ reason: `recipes cache prune (${prune.length} cached recipes)`,
88
+ });
75
89
  const recipeDirs = new Set();
76
90
  for (const entry of prune) {
77
91
  recipeDirs.add(path.dirname(entry.path));
@@ -37,7 +37,7 @@ export async function cmdRecipeInstall(opts) {
37
37
  const ensureApproved = async (reason) => {
38
38
  if (networkApproved)
39
39
  return;
40
- await ensureNetworkApproved({ config, yes: opts.yes, reason });
40
+ await ensureNetworkApproved({ action: "recipe_install", config, yes: opts.yes, reason });
41
41
  networkApproved = true;
42
42
  };
43
43
  const tempRoot = await mkdtemp(path.join(os.tmpdir(), "agentplane-recipe-"));
@@ -1 +1 @@
1
- {"version":3,"file":"list-remote.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/list-remote.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,qBAAqB,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAwClB"}
1
+ {"version":3,"file":"list-remote.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/list-remote.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,qBAAqB,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAyClB"}
@@ -25,6 +25,7 @@ export async function cmdRecipeListRemoteParsed(opts) {
25
25
  });
26
26
  if (willFetchRemote) {
27
27
  await ensureNetworkApproved({
28
+ action: "recipe_list_remote",
28
29
  config,
29
30
  yes: flags.yes,
30
31
  reason: "recipes list-remote fetches the remote recipes index",
@@ -1 +1 @@
1
- {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/remove.ts"],"names":[],"mappings":"AAYA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBlB"}
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/remove.ts"],"names":[],"mappings":"AAaA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BlB"}
@@ -1,9 +1,10 @@
1
- import { resolveProject } from "@agentplaneorg/core";
1
+ import { loadConfig, resolveProject } from "@agentplaneorg/core";
2
2
  import { rm } from "node:fs/promises";
3
3
  import { mapCoreError } from "../../../../cli/error-map.js";
4
4
  import { exitCodeForError } from "../../../../cli/exit-codes.js";
5
5
  import { successMessage } from "../../../../cli/output.js";
6
6
  import { CliError } from "../../../../shared/errors.js";
7
+ import { ensureActionApproved } from "../../../shared/approval-requirements.js";
7
8
  import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
8
9
  import { resolveProjectInstalledRecipeDir } from "../paths.js";
9
10
  export async function cmdRecipeRemoveParsed(opts) {
@@ -12,6 +13,7 @@ export async function cmdRecipeRemoveParsed(opts) {
12
13
  cwd: opts.cwd,
13
14
  rootOverride: opts.rootOverride ?? null,
14
15
  });
16
+ const loaded = await loadConfig(resolved.agentplaneDir);
15
17
  const installed = await readProjectInstalledRecipes(resolved);
16
18
  const entry = installed.recipes.find((recipe) => recipe.id === opts.id);
17
19
  if (!entry) {
@@ -22,6 +24,12 @@ export async function cmdRecipeRemoveParsed(opts) {
22
24
  });
23
25
  }
24
26
  const recipeDir = resolveProjectInstalledRecipeDir(resolved, entry.id);
27
+ await ensureActionApproved({
28
+ action: "dangerous_fs",
29
+ config: loaded.config,
30
+ yes: false,
31
+ reason: `recipes remove ${entry.id}@${entry.version}`,
32
+ });
25
33
  await rm(recipeDir, { recursive: true, force: true });
26
34
  process.stdout.write(`${successMessage("removed recipe", `${entry.id}@${entry.version}`)}\n`);
27
35
  return 0;
@@ -1 +1 @@
1
- {"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.command.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA6B1E,OAAO,KAAK,EAAE,kBAAkB,EAA0C,MAAM,kBAAkB,CAAC;AA0NnG,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAiF5D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAmF9D,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.command.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA8B1E,OAAO,KAAK,EAAE,kBAAkB,EAA0C,MAAM,kBAAkB,CAAC;AAkOnG,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAiF5D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAmF9D,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -7,6 +7,7 @@ import { withDiagnosticContext } from "../../shared/diagnostics.js";
7
7
  import { CliError } from "../../shared/errors.js";
8
8
  import { execFileAsync, gitEnv } from "../shared/git.js";
9
9
  import { GitContext } from "../shared/git-context.js";
10
+ import { ensureActionApproved } from "../shared/approval-requirements.js";
10
11
  import { ensureNetworkApproved } from "../shared/network-approval.js";
11
12
  import { runOperatorPipeline } from "../shared/operator-pipeline.js";
12
13
  import { cleanHookEnv, maybePersistExpectedCliVersion, maybeRefreshGeneratedReference, maybeUpdateBunLockfile, replaceAgentplanePackageMetadata, replacePackageVersionInFile, } from "./apply.mutation.js";
@@ -84,11 +85,19 @@ async function ensureReleasePlanMatchesRepoState(opts) {
84
85
  async function runPushPreflight(opts) {
85
86
  const loaded = await loadConfig(opts.agentplaneDir);
86
87
  await ensureNetworkApproved({
88
+ action: "release_apply",
87
89
  config: loaded.config,
88
90
  yes: opts.yes,
89
91
  reason: "release apply --push validates npm version availability and pushes over network",
90
92
  interactive: Boolean(process.stdin.isTTY),
91
93
  });
94
+ await ensureActionApproved({
95
+ action: "git_push",
96
+ config: loaded.config,
97
+ yes: opts.yes,
98
+ reason: `release apply --push will push HEAD and ${opts.nextTag} to ${opts.remote}`,
99
+ interactive: Boolean(process.stdin.isTTY),
100
+ });
92
101
  await ensureRemoteExists(opts.gitRoot, opts.remote);
93
102
  await ensureRemoteTagDoesNotExist(opts.gitRoot, opts.remote, opts.nextTag);
94
103
  await ensureNpmVersionsAvailable(opts.gitRoot, opts.nextVersion);
@@ -1,15 +1,13 @@
1
1
  import type { AgentplaneConfig } from "@agentplaneorg/core";
2
- export type ApprovalAction = "network_access" | "force_action" | "policy_write" | "config_write" | "dangerous_fs" | "git_push";
3
- export type ApprovalRequirement = {
4
- required: boolean;
5
- reason: string;
6
- };
2
+ import type { PolicyActionId, PolicyApprovalKind } from "../../policy/taxonomy.js";
3
+ import { type ApprovalRequirement } from "../../runtime/approvals/index.js";
4
+ export type ApprovalAction = PolicyApprovalKind;
7
5
  export declare function getApprovalRequirements(opts: {
8
6
  config: AgentplaneConfig;
9
- action: ApprovalAction;
7
+ action: PolicyActionId;
10
8
  }): ApprovalRequirement;
11
9
  export declare function ensureActionApproved(opts: {
12
- action: ApprovalAction;
10
+ action: PolicyActionId;
13
11
  config: AgentplaneConfig;
14
12
  yes: boolean;
15
13
  reason: string;
@@ -1 +1 @@
1
- {"version":3,"file":"approval-requirements.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/approval-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAK5D,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,cAAc,GACd,cAAc,GACd,UAAU,CAAC;AAEf,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmCF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,mBAAmB,CAkCtB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB"}
1
+ {"version":3,"file":"approval-requirements.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/approval-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEnG,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEhD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,mBAAmB,CAEtB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhB"}
@@ -1,77 +1,7 @@
1
- import { promptYesNo } from "../../cli/prompts.js";
2
- import { CliError } from "../../shared/errors.js";
3
- function resolveEffectiveApprovals(config) {
4
- const approvals = config.agents?.approvals;
5
- const base = {
6
- require_plan: approvals?.require_plan === true,
7
- require_network: approvals?.require_network === true,
8
- require_verify: approvals?.require_verify === true,
9
- // Backward-compatible with older @agentplaneorg/core typings where require_force is absent.
10
- require_force: approvals?.require_force === true,
11
- };
12
- if (config.execution.profile === "conservative") {
13
- return {
14
- ...base,
15
- require_network: true,
16
- require_force: true,
17
- };
18
- }
19
- return base;
20
- }
1
+ import { createApprovalRuntime } from "../../runtime/approvals/index.js";
21
2
  export function getApprovalRequirements(opts) {
22
- const effectiveApprovals = resolveEffectiveApprovals(opts.config);
23
- switch (opts.action) {
24
- case "network_access": {
25
- const required = effectiveApprovals.require_network === true;
26
- return {
27
- required,
28
- reason: "Network access requires explicit approval",
29
- };
30
- }
31
- case "force_action": {
32
- return {
33
- required: effectiveApprovals.require_force === true,
34
- reason: "Force action requires explicit approval",
35
- };
36
- }
37
- case "policy_write": {
38
- return { required: false, reason: "Policy writes require explicit approval" };
39
- }
40
- case "config_write": {
41
- return { required: false, reason: "Config writes require explicit approval" };
42
- }
43
- case "dangerous_fs": {
44
- return { required: false, reason: "Potentially dangerous file operations require approval" };
45
- }
46
- case "git_push": {
47
- return { required: false, reason: "Git push requires explicit approval" };
48
- }
49
- default: {
50
- const exhaustive = opts.action;
51
- return exhaustive;
52
- }
53
- }
3
+ return createApprovalRuntime({ config: opts.config }).resolve({ action: opts.action });
54
4
  }
55
5
  export async function ensureActionApproved(opts) {
56
- const req = getApprovalRequirements({ config: opts.config, action: opts.action });
57
- if (!req.required)
58
- return;
59
- if (opts.yes)
60
- return;
61
- const interactive = opts.interactive ?? Boolean(process.stdin.isTTY);
62
- if (!interactive) {
63
- throw new CliError({
64
- exitCode: 3,
65
- code: "E_VALIDATION",
66
- message: `${req.reason} (pass --yes): ${opts.reason}`,
67
- });
68
- }
69
- const approved = await promptYesNo(`Allow ${opts.action}? ${opts.reason}`, false);
70
- if (!approved) {
71
- throw new CliError({
72
- exitCode: 3,
73
- code: "E_VALIDATION",
74
- message: `${req.reason} denied: ${opts.reason}`,
75
- });
76
- }
6
+ await createApprovalRuntime({ config: opts.config }).ensure(opts);
77
7
  }
@@ -1,5 +1,7 @@
1
1
  import type { AgentplaneConfig } from "@agentplaneorg/core";
2
+ import type { PolicyActionId } from "../../policy/taxonomy.js";
2
3
  export declare function ensureNetworkApproved(opts: {
4
+ action?: PolicyActionId;
3
5
  config: AgentplaneConfig;
4
6
  yes: boolean;
5
7
  reason: string;
@@ -1 +1 @@
1
- {"version":3,"file":"network-approval.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/network-approval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI5D,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhB"}
1
+ {"version":3,"file":"network-approval.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/network-approval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhB"}
@@ -1,7 +1,7 @@
1
1
  import { ensureActionApproved } from "./approval-requirements.js";
2
2
  export async function ensureNetworkApproved(opts) {
3
3
  await ensureActionApproved({
4
- action: "network_access",
4
+ action: opts.action ?? "network_access",
5
5
  config: opts.config,
6
6
  yes: opts.yes,
7
7
  reason: opts.reason,
@@ -13,11 +13,20 @@ export declare function buildOpenedPrMeta(opts: {
13
13
  branch: string;
14
14
  at: string;
15
15
  previousMeta: PrMeta | null;
16
+ base?: string | null;
17
+ headSha?: string | null;
16
18
  }): PrMeta;
17
19
  export declare function buildUpdatedPrMeta(opts: {
18
20
  meta: PrMeta;
19
21
  branch: string;
20
22
  at: string;
23
+ base?: string | null;
24
+ headSha?: string | null;
25
+ }): PrMeta;
26
+ export declare function buildVerifiedPrMeta(opts: {
27
+ meta: PrMeta;
28
+ at: string;
29
+ state: "pass" | "fail";
21
30
  }): PrMeta;
22
31
  export declare function buildIntegratedPrMeta(opts: {
23
32
  meta: PrMeta;
@@ -1 +1 @@
1
- {"version":3,"file":"pr-meta.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/pr-meta.ts"],"names":[],"mappings":"A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EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAqBD"}
@@ -8,27 +8,51 @@ function nowOrExisting(value, fallback) {
8
8
  return trimmed || fallback;
9
9
  }
10
10
  export function buildOpenedPrMeta(opts) {
11
+ const nextBase = opts.base ?? opts.previousMeta?.base;
12
+ const nextHeadSha = opts.headSha ?? opts.previousMeta?.head_sha;
13
+ const changed = opts.previousMeta === null ||
14
+ (opts.previousMeta.branch ?? null) !== opts.branch ||
15
+ (opts.previousMeta.base ?? null) !== (nextBase ?? null) ||
16
+ (opts.previousMeta.head_sha ?? null) !== (nextHeadSha ?? null);
11
17
  return {
12
18
  schema_version: 1,
13
19
  task_id: opts.taskId,
14
20
  branch: opts.branch,
15
21
  created_at: opts.previousMeta?.created_at ?? opts.at,
16
- updated_at: opts.at,
22
+ updated_at: changed ? opts.at : (opts.previousMeta?.updated_at ?? opts.at),
17
23
  last_verified_sha: opts.previousMeta?.last_verified_sha ?? null,
18
24
  last_verified_at: opts.previousMeta?.last_verified_at ?? null,
19
25
  verify: opts.previousMeta?.verify ?? { status: "skipped" },
20
- base: opts.previousMeta?.base,
26
+ base: nextBase,
27
+ head_sha: nextHeadSha,
21
28
  };
22
29
  }
23
30
  export function buildUpdatedPrMeta(opts) {
31
+ const nextBase = opts.base ?? opts.meta.base;
32
+ const nextHeadSha = opts.headSha ?? opts.meta.head_sha;
33
+ const changed = (opts.meta.branch ?? null) !== opts.branch ||
34
+ (opts.meta.base ?? null) !== (nextBase ?? null) ||
35
+ (opts.meta.head_sha ?? null) !== (nextHeadSha ?? null);
24
36
  return {
25
37
  ...opts.meta,
26
38
  branch: opts.branch,
27
- updated_at: opts.at,
39
+ base: nextBase,
40
+ head_sha: nextHeadSha,
41
+ updated_at: changed ? opts.at : opts.meta.updated_at,
28
42
  last_verified_sha: opts.meta.last_verified_sha ?? null,
29
43
  last_verified_at: opts.meta.last_verified_at ?? null,
30
44
  };
31
45
  }
46
+ export function buildVerifiedPrMeta(opts) {
47
+ const verifiedSha = opts.meta.head_sha ?? null;
48
+ return {
49
+ ...opts.meta,
50
+ updated_at: opts.meta.updated_at,
51
+ last_verified_sha: verifiedSha,
52
+ last_verified_at: opts.at,
53
+ verify: opts.meta.verify ? { ...opts.meta.verify, status: opts.state } : { status: opts.state },
54
+ };
55
+ }
32
56
  export function buildIntegratedPrMeta(opts) {
33
57
  const nextMeta = {
34
58
  ...opts.meta,
@@ -1,4 +1,5 @@
1
1
  import { type AgentplaneConfig, type ResolvedProject } from "@agentplaneorg/core";
2
+ import type { ResolvedHarnessContract } from "../../runtime/harness/index.js";
2
3
  import { loadTaskBackend, type TaskBackend, type TaskData, type TaskSummary } from "../../backends/task-backend.js";
3
4
  import { GitContext } from "./git-context.js";
4
5
  export type CommandMemo = {
@@ -6,6 +7,7 @@ export type CommandMemo = {
6
7
  changedPaths?: Promise<string[]>;
7
8
  headCommit?: Promise<string>;
8
9
  agentIds?: Promise<string[]>;
10
+ harness?: Promise<ResolvedHarnessContract>;
9
11
  };
10
12
  export type CommandContext = {
11
13
  resolvedProject: Awaited<ReturnType<typeof loadTaskBackend>>["resolved"];
@@ -1 +1 @@
1
- {"version":3,"file":"task-backend.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-backend.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EAEf,KAAK,WAAW,EAEhB,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,MAAM,WAAW,GAAG;I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,SAAS,QAAQ,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAgBvF;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,CAQ3F;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACvD,GAAG,EAAE,cAAc,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAchB"}
@@ -0,0 +1,13 @@
1
+ export declare function isTaskLocalAdvancePath(opts: {
2
+ workflowDir: string;
3
+ taskId: string;
4
+ relPath: string;
5
+ }): boolean;
6
+ export declare function isTaskLocalOnlyAdvance(opts: {
7
+ gitRoot: string;
8
+ workflowDir: string;
9
+ taskId: string;
10
+ fromRef: string | null;
11
+ toRef: string;
12
+ }): Promise<boolean>;
13
+ //# sourceMappingURL=task-local-freshness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-local-freshness.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/task-local-freshness.ts"],"names":[],"mappings":"AAQA,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAEV;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,OAAO,CAAC,CAenB"}