@intentius/chant 0.124.56 → 0.124.58

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 (199) hide show
  1. package/dist/ci-audit/index.d.ts.map +1 -1
  2. package/dist/ci-audit/index.js +1 -2
  3. package/dist/ci-product-words.d.ts +47 -2
  4. package/dist/ci-product-words.d.ts.map +1 -1
  5. package/dist/ci-product-words.js +59 -1
  6. package/dist/ci-product.d.ts +26 -2
  7. package/dist/ci-product.d.ts.map +1 -1
  8. package/dist/ci-product.js +30 -7
  9. package/dist/cli/commands/init.d.ts +2 -0
  10. package/dist/cli/commands/init.d.ts.map +1 -1
  11. package/dist/cli/commands/init.js +1 -1
  12. package/dist/cli/handlers/build.d.ts.map +1 -1
  13. package/dist/cli/handlers/build.js +5 -1
  14. package/dist/cli/handlers/init.d.ts.map +1 -1
  15. package/dist/cli/handlers/init.js +16 -0
  16. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  17. package/dist/cli/handlers/lifecycle.js +14 -0
  18. package/dist/cli/handlers/pr.d.ts.map +1 -1
  19. package/dist/cli/handlers/pr.js +90 -35
  20. package/dist/cli/handlers/serve.d.ts.map +1 -1
  21. package/dist/cli/handlers/serve.js +9 -0
  22. package/dist/cli/main.d.ts.map +1 -1
  23. package/dist/cli/main.js +6 -2
  24. package/dist/cli/mcp/product-tools.d.ts +40 -7
  25. package/dist/cli/mcp/product-tools.d.ts.map +1 -1
  26. package/dist/cli/mcp/product-tools.js +59 -15
  27. package/dist/cli/mcp/read-only.d.ts +2 -1
  28. package/dist/cli/mcp/read-only.d.ts.map +1 -1
  29. package/dist/cli/mcp/read-only.js +2 -1
  30. package/dist/cli/mcp/server.d.ts +11 -0
  31. package/dist/cli/mcp/server.d.ts.map +1 -1
  32. package/dist/cli/mcp/server.js +15 -3
  33. package/dist/cli/mcp-config.d.ts +4 -1
  34. package/dist/cli/mcp-config.d.ts.map +1 -1
  35. package/dist/cli/mcp-config.js +6 -2
  36. package/dist/cli/parse-args.d.ts.map +1 -1
  37. package/dist/cli/parse-args.js +9 -0
  38. package/dist/cli/registry.d.ts +8 -0
  39. package/dist/cli/registry.d.ts.map +1 -1
  40. package/dist/components/auto-release.d.ts +5 -2
  41. package/dist/components/auto-release.d.ts.map +1 -1
  42. package/dist/components/auto-release.js +9 -4
  43. package/dist/components/capability.d.ts +10 -0
  44. package/dist/components/capability.d.ts.map +1 -1
  45. package/dist/components/deploy-units.d.ts +12 -0
  46. package/dist/components/deploy-units.d.ts.map +1 -1
  47. package/dist/components/deploy-units.js +20 -1
  48. package/dist/components/pr-pipeline.d.ts +64 -2
  49. package/dist/components/pr-pipeline.d.ts.map +1 -1
  50. package/dist/components/pr-pipeline.js +66 -5
  51. package/dist/components/product-pipeline.d.ts +18 -1
  52. package/dist/components/product-pipeline.d.ts.map +1 -1
  53. package/dist/components/product-pipeline.js +8 -2
  54. package/dist/components/row-lease.d.ts +22 -1
  55. package/dist/components/row-lease.d.ts.map +1 -1
  56. package/dist/components/row-lease.js +32 -6
  57. package/dist/e2e-harness/driver.d.ts.map +1 -1
  58. package/dist/e2e-harness/driver.js +97 -0
  59. package/dist/e2e-harness/forgejo.d.ts +5 -1
  60. package/dist/e2e-harness/forgejo.d.ts.map +1 -1
  61. package/dist/e2e-harness/forgejo.js +35 -0
  62. package/dist/e2e-harness/index.d.ts +7 -0
  63. package/dist/e2e-harness/index.d.ts.map +1 -1
  64. package/dist/e2e-harness/index.js +11 -2
  65. package/dist/e2e-harness/ports.d.ts +31 -0
  66. package/dist/e2e-harness/ports.d.ts.map +1 -1
  67. package/dist/e2e-harness/scenario.d.ts.map +1 -1
  68. package/dist/e2e-harness/scenario.js +9 -5
  69. package/dist/e2e-harness/schemas/e2e-scenario.schema.json +43 -3
  70. package/dist/e2e-harness/schemas/index.d.ts +22 -1
  71. package/dist/e2e-harness/schemas/index.d.ts.map +1 -1
  72. package/dist/e2e-harness/schemas/index.js +1 -1
  73. package/dist/e2e-harness/steps.d.ts.map +1 -1
  74. package/dist/e2e-harness/steps.js +4 -0
  75. package/dist/lexicon.d.ts +9 -0
  76. package/dist/lexicon.d.ts.map +1 -1
  77. package/dist/lifecycle/git.d.ts +39 -3
  78. package/dist/lifecycle/git.d.ts.map +1 -1
  79. package/dist/lifecycle/git.js +223 -15
  80. package/dist/lifecycle/lock-rows.d.ts +23 -0
  81. package/dist/lifecycle/lock-rows.d.ts.map +1 -1
  82. package/dist/lifecycle/lock-rows.js +47 -8
  83. package/dist/lifecycle/resource-lock.d.ts +70 -0
  84. package/dist/lifecycle/resource-lock.d.ts.map +1 -1
  85. package/dist/lifecycle/resource-lock.js +241 -5
  86. package/dist/mcp/types.d.ts +9 -0
  87. package/dist/mcp/types.d.ts.map +1 -1
  88. package/dist/op/gate.js +21 -4
  89. package/dist/op/op-waves-release-port.js +1 -1
  90. package/dist/op/op-waves-release.d.ts +2 -1
  91. package/dist/op/op-waves-release.d.ts.map +1 -1
  92. package/dist/op/op-waves-run.d.ts +8 -0
  93. package/dist/op/op-waves-run.d.ts.map +1 -1
  94. package/dist/op/op-waves-run.js +101 -29
  95. package/dist/op/op-waves.d.ts +18 -0
  96. package/dist/op/op-waves.d.ts.map +1 -1
  97. package/dist/op/op-waves.js +16 -0
  98. package/dist/pr-loop.d.ts.map +1 -1
  99. package/dist/pr-loop.js +1 -2
  100. package/dist/release-floors.d.ts +1 -1
  101. package/dist/release-floors.js +1 -1
  102. package/dist/template-request/index.d.ts +9 -0
  103. package/dist/template-request/index.d.ts.map +1 -0
  104. package/dist/template-request/index.js +8 -0
  105. package/dist/template-request/request-body.d.ts +21 -0
  106. package/dist/template-request/request-body.d.ts.map +1 -0
  107. package/dist/template-request/request-body.js +86 -0
  108. package/dist/template-request/template-request.d.ts +100 -0
  109. package/dist/template-request/template-request.d.ts.map +1 -0
  110. package/dist/template-request/template-request.js +150 -0
  111. package/dist/template-request/template-request.schema.json +100 -0
  112. package/dist/template-request/template-spec.d.ts +83 -0
  113. package/dist/template-request/template-spec.d.ts.map +1 -0
  114. package/dist/template-request/template-spec.js +146 -0
  115. package/dist/template-request/template.schema.json +114 -0
  116. package/dist/template-request/validate.d.ts +4 -0
  117. package/dist/template-request/validate.d.ts.map +1 -0
  118. package/dist/template-request/validate.js +21 -0
  119. package/dist/wave-runtime.mjs +310 -300
  120. package/package.json +8 -1
  121. package/src/ci-audit/index.ts +1 -2
  122. package/src/ci-product-words.test.ts +23 -0
  123. package/src/ci-product-words.ts +68 -3
  124. package/src/ci-product.ts +36 -6
  125. package/src/cli/commands/init.ts +3 -1
  126. package/src/cli/handlers/build.ts +5 -1
  127. package/src/cli/handlers/init.ts +18 -0
  128. package/src/cli/handlers/lifecycle.ts +13 -0
  129. package/src/cli/handlers/pr-before-merge.test.ts +1 -1
  130. package/src/cli/handlers/pr-deploy-inputs.test.ts +1 -1
  131. package/src/cli/handlers/pr-endpoint.test.ts +1 -1
  132. package/src/cli/handlers/pr-green.test.ts +1 -1
  133. package/src/cli/handlers/pr-plan-comment-targets.test.ts +1 -1
  134. package/src/cli/handlers/pr-plan-flags.test.ts +1 -1
  135. package/src/cli/handlers/pr-plan-targets.test.ts +1 -1
  136. package/src/cli/handlers/pr-record.test.ts +34 -2
  137. package/src/cli/handlers/pr-waves-blocked.test.ts +1 -1
  138. package/src/cli/handlers/pr-waves.test.ts +1 -1
  139. package/src/cli/handlers/pr.test.ts +1 -1
  140. package/src/cli/handlers/pr.ts +86 -31
  141. package/src/cli/handlers/serve.ts +9 -0
  142. package/src/cli/main.ts +6 -2
  143. package/src/cli/mcp/product-tools.test.ts +57 -1
  144. package/src/cli/mcp/product-tools.ts +67 -15
  145. package/src/cli/mcp/read-only.ts +2 -1
  146. package/src/cli/mcp/server.ts +20 -5
  147. package/src/cli/mcp-config.test.ts +52 -2
  148. package/src/cli/mcp-config.ts +6 -3
  149. package/src/cli/parse-args.ts +7 -0
  150. package/src/cli/registry.ts +8 -0
  151. package/src/components/auto-release.test.ts +4 -2
  152. package/src/components/auto-release.ts +9 -5
  153. package/src/components/capability.ts +10 -0
  154. package/src/components/deploy-units.test.ts +18 -1
  155. package/src/components/deploy-units.ts +26 -1
  156. package/src/components/pr-pipeline.ts +99 -5
  157. package/src/components/product-actions.test.ts +76 -0
  158. package/src/components/product-pipeline.ts +21 -2
  159. package/src/components/row-lease.test.ts +61 -1
  160. package/src/components/row-lease.ts +48 -7
  161. package/src/e2e-harness/driver.test.ts +163 -0
  162. package/src/e2e-harness/driver.ts +86 -1
  163. package/src/e2e-harness/forgejo.ts +42 -1
  164. package/src/e2e-harness/index.ts +12 -2
  165. package/src/e2e-harness/ports.ts +33 -0
  166. package/src/e2e-harness/scenario.ts +8 -6
  167. package/src/e2e-harness/schemas/README.md +11 -2
  168. package/src/e2e-harness/schemas/e2e-scenario.schema.json +43 -3
  169. package/src/e2e-harness/schemas/index.ts +5 -1
  170. package/src/e2e-harness/schemas.test.ts +44 -1
  171. package/src/e2e-harness/steps.ts +4 -0
  172. package/src/lexicon.ts +9 -0
  173. package/src/lifecycle/git.test.ts +155 -0
  174. package/src/lifecycle/git.ts +213 -17
  175. package/src/lifecycle/lock-rows.test.ts +6 -1
  176. package/src/lifecycle/lock-rows.ts +58 -7
  177. package/src/lifecycle/resource-lock-wait.test.ts +292 -0
  178. package/src/lifecycle/resource-lock.ts +261 -7
  179. package/src/mcp/types.ts +9 -0
  180. package/src/op/gate.test.ts +7 -5
  181. package/src/op/gate.ts +20 -4
  182. package/src/op/op-waves-after-plan.test.ts +1 -2
  183. package/src/op/op-waves-ledger-lock.test.ts +208 -0
  184. package/src/op/op-waves-release-port.ts +1 -1
  185. package/src/op/op-waves-release.ts +1 -1
  186. package/src/op/op-waves-run.ts +104 -29
  187. package/src/op/op-waves.ts +18 -0
  188. package/src/pr-loop-bundle.test.ts +0 -2
  189. package/src/pr-loop.ts +1 -2
  190. package/src/release-floors.ts +1 -1
  191. package/src/template-request/__fixtures__/request-body.md +41 -0
  192. package/src/template-request/index.ts +8 -0
  193. package/src/template-request/request-body.ts +91 -0
  194. package/src/template-request/template-request.schema.json +100 -0
  195. package/src/template-request/template-request.test.ts +316 -0
  196. package/src/template-request/template-request.ts +235 -0
  197. package/src/template-request/template-spec.ts +176 -0
  198. package/src/template-request/template.schema.json +114 -0
  199. package/src/template-request/validate.ts +28 -0
@@ -92,7 +92,8 @@ import { OIDC_REQUEST_VARS } from "../ci-identity.js";
92
92
  import { parallelismProblem } from "../parallelism.js";
93
93
  import { EMPTY_TREE_SHA } from "./changed-files.js";
94
94
  import { layerWaves } from "../gated-waves.js";
95
- import { commentLine, resolveProductWords } from "../ci-product-words.js";
95
+ import { commandWord, commentLine, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, resolveProductWords } from "../ci-product-words.js";
96
+ import { CHANT_EXIT } from "../exit-codes.js";
96
97
  import { CI_RESPOND_ENV, respondList } from "../ci-respond.js";
97
98
  /** The variable `chant ci run` reads its runner key from (`RUNNER_KEY_ENV` in ../workspace/ci-green.ts). */
98
99
  const RUNNER_KEY_ENV = "CHANT_RUNNER_KEY";
@@ -165,7 +166,7 @@ export function prLoopJobStage(name, member) {
165
166
  const bare = member && name.startsWith(`${member}-`) ? name.slice(member.length + 1) : name;
166
167
  if (bare === "plan" || bare === PR_COMMENT_PREVIEW_JOB)
167
168
  return "plan";
168
- if (bare === "apply" || bare === "record" || /^apply-wave-\d+$/.test(bare) || bare === "env-up" || bare === "env-down" || bare === "env-sweep")
169
+ if (bare === "apply" || bare === "record" || bare === PR_ACTION_JOB || /^apply-wave-\d+$/.test(bare) || bare === "env-up" || bare === "env-down" || bare === "env-sweep")
169
170
  return "apply";
170
171
  return "default";
171
172
  }
@@ -204,12 +205,20 @@ export function prLoopPassedEnv(forge, options) {
204
205
  /** The lock job's step names and commands (#4327), shared by the GitHub-shaped generators. */
205
206
  export const PR_LOCK_JOB = "lock";
206
207
  export const PR_UNLOCK_JOB = "unlock";
207
- /** `chant lock --from-report` for the plan's report in {@link PR_LOOP_REPORT_DIR}; reads `PR_NUMBER` and `HEAD_SHA`. */
208
- export function prLockCommand(forge) {
209
- return ["chant", "lock", "--from-report", `${PR_LOOP_REPORT_DIR}/pr-plan.json`, "--pr", '"$PR_NUMBER"', "--head", '"$HEAD_SHA"', "--stage", "plan", "--forge", forge].join(" ");
208
+ /**
209
+ * `chant lock --from-report` for the plan's report in {@link PR_LOOP_REPORT_DIR}; reads `PR_NUMBER` and `HEAD_SHA`.
210
+ * With a product's `bin` (its words), the line runs through it, as the comment lock jobs do
211
+ * (INTENTIUS/plywood#22): a product's job image need not carry `chant` on PATH.
212
+ */
213
+ export function prLockCommand(forge, bin) {
214
+ return withProductBin(["chant", "lock", "--from-report", `${PR_LOOP_REPORT_DIR}/pr-plan.json`, "--pr", '"$PR_NUMBER"', "--head", '"$HEAD_SHA"', "--stage", "plan", "--forge", forge].join(" "), bin);
210
215
  }
211
216
  /** `chant unlock` for the pull request that closed; reads `PR_NUMBER`. */
212
217
  export const PR_UNLOCK_COMMAND = 'chant unlock --pr "$PR_NUMBER"';
218
+ /** {@link PR_UNLOCK_COMMAND} through a product's `bin`, as {@link prLockCommand} takes it. */
219
+ export function prUnlockCommand(bin) {
220
+ return withProductBin(PR_UNLOCK_COMMAND, bin);
221
+ }
213
222
  /** The job answering `/<product> lock` (#4588). */
214
223
  export const PR_COMMENT_LOCK_JOB = "comment-lock";
215
224
  /** The job answering `/<product> unlock` (#4588). */
@@ -251,6 +260,58 @@ export function prCommentLockJobs(forge, options = {}) {
251
260
  }
252
261
  return out;
253
262
  }
263
+ /** The job answering the action comment and the action dispatch (#4654). */
264
+ export const PR_ACTION_JOB = "action";
265
+ const INPUT_NAME = /^[A-Za-z_][A-Za-z0-9_-]{0,63}$/;
266
+ /**
267
+ * The action job (#4654), with `actionJob`: one job that answers the
268
+ * product's action comment and a dispatch of the workflow with a member and
269
+ * an action. It runs at the target branch's commit (an `issue_comment` run's
270
+ * checkout) or the dispatched ref, never a pull request's head, and runs the
271
+ * product's own action verb, which asks for the gated request and runs the
272
+ * action once an approval counts. The comment and the inputs reach the verb
273
+ * as variables ({@link PRODUCT_ACTION_ENV}), never as shell text.
274
+ *
275
+ * Undefined without `actionJob`. Throws on GitLab, which starts no pipeline
276
+ * on a note; for words that name no `action` command or no `bin`, since
277
+ * chant has no action verb of its own; and for input names that are not
278
+ * plain names or are the same.
279
+ */
280
+ export function prActionJob(forge, options = {}) {
281
+ if (!options.actionJob)
282
+ return undefined;
283
+ if (forge === "gitlab")
284
+ throw new Error("the action job runs on GitHub and Forgejo, whose workflows start on a comment and on a dispatch with inputs; on GitLab, run the product's action verb from a pipeline of its own");
285
+ const words = resolveProductWords(options.words);
286
+ const typed = commandWord(words, "action");
287
+ if (typed === undefined)
288
+ throw new Error(`--action-job answers /${words.product} <action command>, and the words name no action command; name one in the words' commands, or drop --action-job`);
289
+ if (!words.bin)
290
+ throw new Error("--action-job runs the product's action verb, and the words name no bin; chant has no action verb of its own");
291
+ const given = options.actionJob === true ? {} : options.actionJob.inputs ?? {};
292
+ const inputs = { member: given.member ?? words.noun[0], action: given.action ?? "action" };
293
+ for (const [role, name] of Object.entries(inputs)) {
294
+ if (!INPUT_NAME.test(name))
295
+ throw new Error(`the action job's ${role} input is a plain name, not ${JSON.stringify(name)}`);
296
+ }
297
+ if (inputs.member === inputs.action)
298
+ throw new Error(`the action job's two inputs need two names, and both are ${inputs.action}`);
299
+ const command = withProductBin(["chant", typed, PRODUCT_ACTION_EVENT_FLAG].join(" "), words.bin);
300
+ return {
301
+ jobName: PR_ACTION_JOB,
302
+ comment: `/${words.product} ${typed}`,
303
+ inputs,
304
+ command,
305
+ script: ["set +e", command, 'code="$?"', `if [ "$code" -eq ${CHANT_EXIT.waiting} ]; then echo "The action waits for an approval."; exit 0; fi`, 'exit "$code"'].join("\n"),
306
+ env: {
307
+ [PRODUCT_ACTION_ENV.comment]: "${{ github.event.comment.body }}",
308
+ [PRODUCT_ACTION_ENV.member]: `\${{ github.event.inputs.${inputs.member} }}`,
309
+ [PRODUCT_ACTION_ENV.action]: `\${{ github.event.inputs.${inputs.action} }}`,
310
+ PR_NUMBER: "${{ github.event.issue.number }}",
311
+ GITHUB_TOKEN: GITHUB_JOB_TOKEN,
312
+ },
313
+ };
314
+ }
254
315
  /** The job answering `/<product> <plan word>` (#4620). */
255
316
  export const PR_COMMENT_PREVIEW_JOB = "comment-preview";
256
317
  /** The job that posts the comment preview's note and status (#4620). */
@@ -24,7 +24,7 @@ import type { ForgeKind } from "../pr-forge.js";
24
24
  import { type OpWaveJob, type OpWavesSpec } from "../op/op-waves.js";
25
25
  import { type ControlNoteCheckout } from "../control/dispatch.js";
26
26
  import { type CiProductCommand, type CiProductWords, type CiProductWordsInput } from "../ci-product-words.js";
27
- import { type PrCommentLockJob, type PrCommentPreviewJob, type PrLoopJob, type PrLoopPipelineOptions } from "./pr-pipeline.js";
27
+ import { type PrActionJob, type PrCommentLockJob, type PrCommentPreviewJob, type PrLoopJob, type PrLoopPipelineOptions } from "./pr-pipeline.js";
28
28
  import type { DriverComponent } from "./driver.js";
29
29
  import type { ScheduledOpSpec } from "../lexicon.js";
30
30
  import type { CiRunner } from "../ci-jobs.js";
@@ -55,6 +55,15 @@ export interface ProductPipelineOptions extends Omit<PrLoopPipelineOptions, "wor
55
55
  * scheduled Ops.
56
56
  */
57
57
  agent?: boolean | ProductAgentOptions;
58
+ /**
59
+ * The product answers its `action` command (#4654) from a workflow of its
60
+ * own, such as terragucci's action workflow: `true` counts the command as
61
+ * answered, so words that map a word onto `action` are not refused, and
62
+ * `comments.action` names the comment. The pipeline writes no job for it.
63
+ * A product with no workflow of its own sets `actionJob` instead, and the
64
+ * pipeline writes the job ({@link ProductPipelineJobs.action}).
65
+ */
66
+ actions?: boolean;
58
67
  /**
59
68
  * The apply on merge from the component graph (#4588), when `waves` is
60
69
  * absent: the spec `pr-apply --wave-gate` runs, a wave per layer of
@@ -155,6 +164,14 @@ export interface ProductPipelineJobs {
155
164
  name: string;
156
165
  spec: ScheduledOpSpec;
157
166
  };
167
+ /**
168
+ * The action job (#4654), with `actionJob`: the comment and the dispatch
169
+ * inputs it answers, and the product's action verb it runs. The GitHub and
170
+ * Forgejo lexicons render the same job.
171
+ */
172
+ action?: PrActionJob & {
173
+ runner?: CiRunner;
174
+ };
158
175
  }
159
176
  /** An agent's settings as a product passes them (#4616): {@link OpAgentSpec} without the trigger, which the pipeline names. */
160
177
  export interface ProductAgentOptions extends Omit<OpAgentSpec, "on" | "comment" | "branch"> {
@@ -1 +1 @@
1
- {"version":3,"file":"product-pipeline.d.ts","sourceRoot":"","sources":["../../src/components/product-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAgE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChI,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA+G,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACzO,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,4FAA4F;AAC5F,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AAExD,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAA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;IAChB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,kBAAkB,CAaxF;AAED,uFAAuF;AACvF,MAAM,WAAW,yBAAyB;IACxC,4HAA4H;IAC5H,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yHAAyH;IACzH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gHAAgH;IAChH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,SAAS,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,CAAC,EAAE,EAClE,OAAO,EAAE,mBAAmB,GAAG,cAAc,EAC7C,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,yBAA8B,GACtC,WAAW,CAuBb;AAED,sGAAsG;AACtG,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1E"}
@@ -24,7 +24,7 @@ import { layerWaves } from "../gated-waves.js";
24
24
  import { opWaveBinArgv, opWaveJobs, opWavesControlTarget } from "../op/op-waves.js";
25
25
  import { controlNoteCheckout } from "../control/dispatch.js";
26
26
  import { assertProductWords, CHANT_WORDS, commentLine, } from "../ci-product-words.js";
27
- import { prCommentLockJobs, prCommentPreviewJob, prLoopJobs, prLoopPostJob, prLoopRunner, prStaleJob, withProductBin } from "./pr-pipeline.js";
27
+ import { prActionJob, prCommentLockJobs, prCommentPreviewJob, prLoopJobs, prLoopPostJob, prLoopRunner, prStaleJob, withProductBin } from "./pr-pipeline.js";
28
28
  import { resolveAgentSpec } from "../ci-agent.js";
29
29
  /** Where the generator writes a product's waves spec, which chant reads at base (#4550). */
30
30
  export const PRODUCT_WAVES_SPEC_DIR = ".chant/op-waves";
@@ -83,12 +83,15 @@ export function productPipelineJobs(forge, env, options) {
83
83
  jobs.push("lock", "unlock");
84
84
  if (options.agent)
85
85
  jobs.push("agent");
86
+ // #4654: the action command, answered by the product's own workflow (`actions`) or by the pipeline's action job.
87
+ if (options.actions || options.actionJob)
88
+ jobs.push("action");
86
89
  // #4601: the note's merge sentence follows the jobs built here: waves on merge, an apply before merge, else a record for a release.
87
90
  // Words that ask for before-merge keep it when the pipeline has that job beside its waves.
88
91
  const built = options.waves || options.componentWaves ? "on-merge" : options.applyBeforeMerge ? "before-merge" : "release";
89
92
  const applyMode = options.words.applyMode === "before-merge" && options.applyBeforeMerge ? "before-merge" : built;
90
93
  const words = assertProductWords({ ...options.words, applyMode }, { jobs });
91
- const { waves: given, wavesSpecFile, member, agent: _agent, componentWaves, ...loop } = options;
94
+ const { waves: given, wavesSpecFile, member, agent: _agent, actions: _actions, componentWaves, ...loop } = options;
92
95
  const { respond } = options;
93
96
  // #4629: the pull request loop puts the responses on the apply and note jobs, as `chant build --pr-loop --respond` does.
94
97
  const prLoop = { ...loop, words, gate: options.gate ?? words.prGate };
@@ -115,6 +118,9 @@ export function productPipelineJobs(forge, env, options) {
115
118
  const locks = prCommentLockJobs(forge, { locks: options.locks, words });
116
119
  if (locks.length > 0)
117
120
  out.locks = locks.map((job) => ({ ...job, ...defaultRunner }));
121
+ const action = prActionJob(forge, prLoop);
122
+ if (action)
123
+ out.action = { ...action, ...(prLoopRunner(options, "apply") !== undefined ? { runner: prLoopRunner(options, "apply") } : {}) };
118
124
  const stale = prStaleJob(forge, env, prLoop, member);
119
125
  if (stale)
120
126
  out.stale = { ...stale, ...defaultRunner };
@@ -15,6 +15,13 @@
15
15
  * - A held row fails the step, or every member of the group, with a record
16
16
  * marked `held`, so the command exits 5 (`CHANT_EXIT.held`) and nothing of
17
17
  * that step applied.
18
+ * - A step on the `target` grain whose lexicon names its target's row
19
+ * (`targetLockRow`: a stock Pulumi stack, a Terraform root), or on the
20
+ * `repo` grain, waits for that row in the ledger's queue, oldest commit
21
+ * first, up to `CHANT_LOCK_WAIT` seconds (ruling for ci-products
22
+ * 2026-10-28, "Ledger lock"), and at the deadline fails with
23
+ * {@link LockWaitTimeoutError}, held, exit 5. A step on the resource grain
24
+ * never waits.
18
25
  *
19
26
  * The port ({@link ledgerRowLease}) writes `_locks/rows/<gate>.json` through
20
27
  * ../lifecycle/resource-lock.ts with one holder for the whole run, and
@@ -35,14 +42,22 @@ export interface RowLeasePort {
35
42
  * Lease `rows` for `label` (a component, or a group's components), all or
36
43
  * nothing. Throws {@link LockRowsHeldError} when another live run holds
37
44
  * one, and any other error when the rows file cannot be read or written.
45
+ * With `wait`, waits in the queue for them instead, and throws
46
+ * {@link LockWaitTimeoutError} at the deadline.
38
47
  */
39
- take(rows: readonly LockRow[], label: string): Promise<RowLease>;
48
+ take(rows: readonly LockRow[], label: string, opts?: {
49
+ wait?: boolean;
50
+ }): Promise<RowLease>;
40
51
  }
41
52
  /** Another live run holds a row this apply changes (#4594), so nothing of it applied. Exit 5. */
42
53
  export declare class LockRowsHeldError extends Error {
43
54
  readonly lockRowsHeld = true;
44
55
  constructor(message: string);
45
56
  }
57
+ /** A wait for a target's row reached its deadline (ruling for ci-products 2026-10-28): nothing of the step applied. Exit 5, as a held row is. */
58
+ export declare class LockWaitTimeoutError extends LockRowsHeldError {
59
+ constructor(message: string);
60
+ }
46
61
  /** Whether `err` is a held row ({@link LockRowsHeldError}), by its mark, so a copy from another bundle counts too. */
47
62
  export declare function isLockRowsHeldError(err: unknown): err is LockRowsHeldError;
48
63
  export interface LedgerRowLeaseOptions {
@@ -53,6 +68,12 @@ export interface LedgerRowLeaseOptions {
53
68
  holder?: LockRowHolder;
54
69
  /** Where the lease's info lines go. Default stderr. */
55
70
  log?: (line: string) => void;
71
+ /** How long a waiting take waits, in seconds. Default `CHANT_LOCK_WAIT`. */
72
+ waitSeconds?: number;
73
+ /** How often a waiting take reads the rows file again, in ms. Default `CHANT_LOCK_POLL` seconds, else 10 s. */
74
+ pollMs?: number;
75
+ /** The commit time that orders this run in the queue. Default: HEAD's in `cwd`. */
76
+ commitAt?: string;
56
77
  }
57
78
  /**
58
79
  * The port over `gate`'s rows file on `chant/lifecycle` (#4594), one holder
@@ -1 +1 @@
1
- {"version":3,"file":"row-lease.d.ts","sourceRoot":"","sources":["../../src/components/row-lease.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE9E,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACvB,8IAA8I;IAC9I,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7B;AAED,8CAA8C;AAC9C,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAClE;AAED,iGAAiG;AACjG,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,YAAY,QAAQ;IAC7B,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,sHAAsH;AACtH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iBAAiB,CAE1E;AAID,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IAC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mB,CACvC,UAAU,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,EACtC,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAAC,CAgBlD;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,EACtC,OAAO,EAAE,aAAa,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,aAAa,CAAA;CAAE,CAAC,EAClF,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EAC/C,QAAQ,EAAE,SAAS,GAAG,SAAS,GAC9B,OAAO,CAAC,OAAO,EAAE,CAAC,CASpB"}
@@ -1,4 +1,4 @@
1
- import { lockGrainBeforePlan, resolvePlannedLock, sortedLockRows } from "../lifecycle/lock-rows.js";
1
+ import { lockGrainBeforePlan, queueRowsOf, resolvePlannedLock, sortedLockRows } from "../lifecycle/lock-rows.js";
2
2
  /** Another live run holds a row this apply changes (#4594), so nothing of it applied. Exit 5. */
3
3
  export class LockRowsHeldError extends Error {
4
4
  constructor(message) {
@@ -7,6 +7,13 @@ export class LockRowsHeldError extends Error {
7
7
  this.name = "LockRowsHeldError";
8
8
  }
9
9
  }
10
+ /** A wait for a target's row reached its deadline (ruling for ci-products 2026-10-28): nothing of the step applied. Exit 5, as a held row is. */
11
+ export class LockWaitTimeoutError extends LockRowsHeldError {
12
+ constructor(message) {
13
+ super(message);
14
+ this.name = "LockWaitTimeoutError";
15
+ }
16
+ }
10
17
  /** Whether `err` is a held row ({@link LockRowsHeldError}), by its mark, so a copy from another bundle counts too. */
11
18
  export function isLockRowsHeldError(err) {
12
19
  return typeof err === "object" && err !== null && err.lockRowsHeld === true;
@@ -24,15 +31,28 @@ export function ledgerRowLease(gate, opts = {}) {
24
31
  let holder = opts.holder;
25
32
  const lock = () => import("../lifecycle/resource-lock.js");
26
33
  return {
27
- async take(rows, label) {
34
+ async take(rows, label, takeOpts) {
28
35
  const wanted = sortedLockRows(rows);
29
36
  if (wanted.length === 0)
30
37
  return NO_LEASE;
31
- const { leaseLockRows, lockRowHolder, releaseLockRows } = await lock();
38
+ const { commitTimeOf, leaseLockRows, lockPollMs, lockRowHolder, lockWaitSeconds, releaseLockRows } = await lock();
32
39
  holder ?? (holder = lockRowHolder(process.env));
33
40
  const fresh = wanted.filter((r) => (counts.get(r.key) ?? 0) === 0);
34
41
  if (fresh.length > 0) {
35
- const leased = await leaseLockRows(gate, fresh, { holder, ...(opts.cwd ? { cwd: opts.cwd } : {}), ...(opts.alive ? { alive: opts.alive } : {}) });
42
+ const commitAt = takeOpts?.wait ? (opts.commitAt ?? (await commitTimeOf(holder.sha ?? "HEAD", opts.cwd))) : undefined;
43
+ const wait = takeOpts?.wait
44
+ ? {
45
+ wait: {
46
+ deadline: Date.now() + (opts.waitSeconds ?? lockWaitSeconds(process.env)) * 1000,
47
+ pollMs: opts.pollMs ?? lockPollMs(process.env),
48
+ log: (line) => log(`${label}: ${line}`),
49
+ ...(commitAt ? { commitAt } : {}),
50
+ },
51
+ }
52
+ : {};
53
+ const leased = await leaseLockRows(gate, fresh, { holder, ...(opts.cwd ? { cwd: opts.cwd } : {}), ...(opts.alive ? { alive: opts.alive } : {}), ...wait });
54
+ if (!leased.ok && leased.timedOut)
55
+ throw new LockWaitTimeoutError(`${label}: LockWaitTimeoutError: ${leased.message}, so nothing of it was applied.`);
36
56
  if (!leased.ok) {
37
57
  throw new LockRowsHeldError(`${label}: ${leased.message}, so nothing of it was applied. Apply again once that run ends; a run that is gone, or whose lease is older than CHANT_LOCK_STALE seconds, is taken over.`);
38
58
  }
@@ -80,9 +100,15 @@ export function ledgerRowLease(gate, opts = {}) {
80
100
  */
81
101
  export async function leaseCapabilityStep(capability, ctx, input) {
82
102
  const port = ctx.rowLease;
83
- if (!port || ctx.plans !== undefined || !capability.plan)
103
+ if (!port)
84
104
  return { ctx, lease: NO_LEASE };
85
- if ((await lockGrainBeforePlan(capability, input, ctx.lockGrain)) !== "resource")
105
+ const grain = await lockGrainBeforePlan(capability, input, ctx.lockGrain);
106
+ if (grain !== "resource") {
107
+ // The ruling for ci-products (2026-10-28): the target's row (or the repo row), waited for, whether or not a plan was handed in.
108
+ const queue = await queueRowsOf(capability, input, ctx.component, grain);
109
+ return { ctx, lease: queue.length > 0 ? await port.take(queue, ctx.component, { wait: true }) : NO_LEASE };
110
+ }
111
+ if (ctx.plans !== undefined || !capability.plan)
86
112
  return { ctx, lease: NO_LEASE };
87
113
  const planned = await capability.plan(ctx, input);
88
114
  const lock = await resolvePlannedLock(capability, input, planned, ctx.lockGrain);
@@ -1 +1 @@
1
- {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/e2e-harness/driver.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzG,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAiC,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAG7H,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,yDAAyD;IACzD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,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AC,MAAM,CAAC,CAgMxG;AAED,4CAA4C;AAC5C,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CAKrI;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,KAAK,EAAE,YAAY,CAAC;QAAC,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;CACxD;AAED,6DAA6D;AAC7D,wBAAsB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAIlG"}
@@ -5,6 +5,10 @@
5
5
  * the BREAK run, and checks each step's outcomes against chant's own reports
6
6
  * and run ledger, never the runner's status or logs.
7
7
  *
8
+ * A pull request comes from the driver's own open step or from a product:
9
+ * an await-pull step waits for the one a product opened from its branch
10
+ * (chant#4650), and later steps name it as they name an open step's.
11
+ *
8
12
  * A run ends one of three ways. Every outcome held: the plain run passes, and
9
13
  * a BREAK run that ends so was missed. An outcome did not hold: the run stops
10
14
  * there, the plain run fails, and the BREAK run was caught. A step did not
@@ -20,6 +24,12 @@ class Stall extends Error {
20
24
  class Broke extends Error {
21
25
  }
22
26
  const iso = (ms) => new Date(ms).toISOString();
27
+ /** How a gated request stands: gated until a finished line names it, then ok or failed. */
28
+ function gatedStatus(r) {
29
+ if (!r.finished)
30
+ return "gated";
31
+ return r.finished.result === "applied" ? "ok" : "failed";
32
+ }
23
33
  /** The check of one outcome, or null when it holds. */
24
34
  async function checkOutcome(o, ctx, p) {
25
35
  if ("report" in o) {
@@ -52,6 +62,44 @@ async function checkOutcome(o, ctx, p) {
52
62
  }
53
63
  return matching.length > 0 ? null : `no ${o.ledger.op} run${o.ledger.status ? ` ${o.ledger.status}` : ""} on the ledger since the run started`;
54
64
  }
65
+ if ("gated" in o) {
66
+ if (!p.ledger?.gatedRequests)
67
+ throw new Stall("a gated outcome needs the ledger's gated requests");
68
+ const asked = (await p.ledger.gatedRequests(o.gated.op)).filter((r) => r.pending.timestamp >= ctx.since);
69
+ const matching = o.gated.status ? asked.filter((r) => gatedStatus(r) === o.gated.status) : asked;
70
+ const status = o.gated.status ? ` ${o.gated.status}` : "";
71
+ if (o.gated.count !== undefined) {
72
+ return matching.length === o.gated.count ? null : `${matching.length} gated ${o.gated.op} requests${status} on the ledger, not ${o.gated.count}`;
73
+ }
74
+ return matching.length > 0 ? null : `no gated ${o.gated.op} request${status} on the ledger since the run started`;
75
+ }
76
+ if ("pull" in o) {
77
+ if (ctx.pull === undefined)
78
+ return "no pull request to read";
79
+ if (o.pull.title !== undefined) {
80
+ if (!p.forge.pullInfo)
81
+ throw new Stall("a pull outcome with a title needs the forge's pull requests");
82
+ const info = await p.forge.pullInfo(ctx.pull);
83
+ if (!info)
84
+ return `the forge does not know pull request ${ctx.pull}`;
85
+ if (!info.title.includes(o.pull.title))
86
+ return `pull request ${ctx.pull} is titled "${info.title}", which does not hold "${o.pull.title}"`;
87
+ }
88
+ if (o.pull.files !== undefined) {
89
+ if (!p.forge.changedFiles)
90
+ throw new Stall("a pull outcome with files needs the forge's changed files");
91
+ const changed = await p.forge.changedFiles(ctx.pull);
92
+ const missing = o.pull.files.filter((f) => !changed.includes(f));
93
+ if (missing.length > 0)
94
+ return `pull request ${ctx.pull} does not change ${missing.join(", ")}`;
95
+ if (o.pull.only) {
96
+ const extra = changed.filter((f) => !o.pull.files.includes(f));
97
+ if (extra.length > 0)
98
+ return `pull request ${ctx.pull} also changes ${extra.join(", ")} beyond the files named`;
99
+ }
100
+ }
101
+ return null;
102
+ }
55
103
  if ("comment" in o) {
56
104
  if (!p.forge.comments)
57
105
  throw new Stall("a comment outcome needs the forge's comments");
@@ -125,9 +173,42 @@ export async function runArm(s, arm, p, opts) {
125
173
  throw new Stall(`no pull request from ${id}`);
126
174
  return o;
127
175
  };
176
+ // The pull requests open when the run started. await-pull never binds one
177
+ // of these, so the BREAK run cannot pick up the plain run's pull request
178
+ // when the reset left it open.
179
+ let before = new Set();
180
+ const awaitPull = async (step) => {
181
+ const find = p.forge.findPull;
182
+ if (!find)
183
+ throw new Stall("an await-pull step needs the forge's findPull");
184
+ // The product picks the branch, so it is the same on both runs.
185
+ const deadline = deadlineOf("await-pull");
186
+ let seen;
187
+ for (;;) {
188
+ const found = await find.call(p.forge, step.branch);
189
+ if (found && !before.has(found.number) && (step.title === undefined || found.title.includes(step.title))) {
190
+ opened.set(step.id, { pull: found.number, head: found.head });
191
+ log(`${s.id} ${arm}: ${step.id} found pull request ${found.number} at ${found.head.slice(0, 8)}`);
192
+ return { id: step.id, do: step.do, pull: found.number, commit: found.head };
193
+ }
194
+ if (found)
195
+ seen = found;
196
+ if (p.clock.now() >= deadline)
197
+ break;
198
+ await p.clock.sleep(opts.pollMs ?? 2000);
199
+ }
200
+ const why = !seen
201
+ ? `no open pull request from ${step.branch} within ${limits["await-pull"]}s`
202
+ : before.has(seen.number)
203
+ ? `pull request ${seen.number} from ${step.branch} was open before the run started, and no new one came within ${limits["await-pull"]}s`
204
+ : `pull request ${seen.number} from ${step.branch} is titled "${seen.title}", which does not hold "${step.title}", after ${limits["await-pull"]}s`;
205
+ throw new Stall(why);
206
+ };
128
207
  try {
129
208
  await p.reset?.();
130
209
  await p.arm?.(arm, arm === "break" ? { ...s.break.env } : {});
210
+ if (s.steps.some((x) => x.do === "await-pull"))
211
+ before = new Set(await p.forge.openPulls());
131
212
  for (let i = 0; i < s.steps.length; i++) {
132
213
  const step = s.steps[i];
133
214
  let result;
@@ -154,6 +235,11 @@ export async function runArm(s, arm, p, opts) {
154
235
  }
155
236
  continue;
156
237
  }
238
+ case "await-pull": {
239
+ result = await awaitPull(step);
240
+ ctx.pull = result.pull;
241
+ break;
242
+ }
157
243
  case "plan": {
158
244
  const o = pullOf(step.pull);
159
245
  const r = await report("plan", o.pull, o.head, "plan");
@@ -180,6 +266,17 @@ export async function runArm(s, arm, p, opts) {
180
266
  result = { id: step.id, do: step.do, pull: o.pull, commit };
181
267
  break;
182
268
  }
269
+ case "comment": {
270
+ const o = pullOf(step.pull);
271
+ const post = p.forge.postComment;
272
+ if (!post)
273
+ throw new Stall("a comment step needs the forge's postComment");
274
+ await within("comment", post.call(p.forge, o.pull, step.body, step.as ?? "author"));
275
+ log(`${s.id} ${arm}: ${step.id} commented on pull request ${o.pull} as ${step.as ?? "author"}`);
276
+ ctx.pull = o.pull;
277
+ result = { id: step.id, do: step.do, pull: o.pull };
278
+ break;
279
+ }
183
280
  case "apply": {
184
281
  const m = merged.get(step.merge);
185
282
  if (!m)
@@ -1,4 +1,4 @@
1
- import type { Clock, ForgeIssue, ForgeRun, HarnessForge } from "./ports.js";
1
+ import type { Clock, ForgeIssue, ForgePerson, ForgePull, ForgeRun, HarnessForge } from "./ports.js";
2
2
  import { type RunnerConfigOptions } from "./stack.js";
3
3
  export interface Person {
4
4
  login: string;
@@ -48,6 +48,10 @@ export declare class ForgejoForge implements HarnessForge {
48
48
  deleteBranch(name: string): Promise<void>;
49
49
  comments(pull: number): Promise<string[]>;
50
50
  issues(): Promise<ForgeIssue[]>;
51
+ findPull(branch: string): Promise<ForgePull | undefined>;
52
+ pullInfo(pull: number): Promise<ForgePull | undefined>;
53
+ changedFiles(pull: number): Promise<string[]>;
54
+ postComment(pull: number, body: string, as: ForgePerson): Promise<void>;
51
55
  applyAgain(sha: string, workflow: string): Promise<ForgeRun>;
52
56
  watch(sha: string, workflow: string): Promise<ForgeRun>;
53
57
  /** Start `workflow` on main by hand and wait for the run it started at `sha`. */
@@ -1 +1 @@
1
- {"version":3,"file":"forgejo.d.ts","sourceRoot":"","sources":["../../src/e2e-harness/forgejo.ts"],"names":[],"mappings":"AAaA,OAAO,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rE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAa/F"}
@@ -35,6 +35,8 @@ export async function forgejoApi(url, token, method, path, body, opts = {}) {
35
35
  throw new Error(`Forgejo ${method} ${path} answered ${res.status}: ${text.slice(0, 200)}`);
36
36
  return (text ? JSON.parse(text) : {});
37
37
  }
38
+ const pullOf = (p) => ({ number: p.number, title: p.title, branch: p.head?.ref ?? "", head: p.head?.sha ?? "" });
39
+ const sameRepo = (a, b) => a !== undefined && a.toLowerCase() === b.toLowerCase();
38
40
  const DONE = new Set(["success", "failure", "cancelled", "skipped"]);
39
41
  export class ForgejoForge {
40
42
  constructor(o) {
@@ -153,6 +155,39 @@ export class ForgejoForge {
153
155
  }
154
156
  return out;
155
157
  }
158
+ async findPull(branch) {
159
+ const found = [];
160
+ for (let page = 1; page < 50; page++) {
161
+ const list = await this.api(this.o.admin, "GET", `${this.r}/pulls?state=open&sort=oldest&page=${page}&limit=50`);
162
+ if (!list || list.length === 0)
163
+ break;
164
+ for (const p of list)
165
+ if (p.head?.ref === branch && sameRepo(p.head.repo?.full_name, this.o.repo))
166
+ found.push(pullOf(p));
167
+ if (list.length < 50)
168
+ break;
169
+ }
170
+ return found.sort((a, b) => a.number - b.number)[0];
171
+ }
172
+ async pullInfo(pull) {
173
+ const p = await this.api(this.o.admin, "GET", `${this.r}/pulls/${pull}`, undefined, true);
174
+ return p ? pullOf(p) : undefined;
175
+ }
176
+ async changedFiles(pull) {
177
+ const out = [];
178
+ for (let page = 1; page < 50; page++) {
179
+ const list = await this.api(this.o.admin, "GET", `${this.r}/pulls/${pull}/files?page=${page}&limit=50`);
180
+ if (!list || list.length === 0)
181
+ break;
182
+ out.push(...list.map((f) => f.filename));
183
+ if (list.length < 50)
184
+ break;
185
+ }
186
+ return out;
187
+ }
188
+ async postComment(pull, body, as) {
189
+ await this.api(this.o[as], "POST", `${this.r}/issues/${pull}/comments`, { body });
190
+ }
156
191
  applyAgain(sha, workflow) {
157
192
  return this.dispatch(sha, workflow);
158
193
  }
@@ -1,5 +1,12 @@
1
1
  /** The first chant with the e2e harness. */
2
2
  export declare const E2E_HARNESS_FLOOR = "0.124.56";
3
+ /**
4
+ * The first chant whose harness follows a pull request a product opened
5
+ * (chant#4650): the await-pull and comment steps, the pull and gated
6
+ * outcomes, and the forge reads under them. A scenario that uses one needs
7
+ * this chant or newer.
8
+ */
9
+ export declare const E2E_HARNESS_PULL_STEPS_FLOOR = "0.124.58";
3
10
  /**
4
11
  * The harness's chant docker-lexicon project, to `chant build <dir>/src
5
12
  * --lexicon docker`. It ships as source in the package's src/.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/e2e-harness/index.ts"],"names":[],"mappings":"AAqBA,4CAA4C;AAC5C,eAAO,MAAM,iBAAiB,aAAe,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAM1C;AAED,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/e2e-harness/index.ts"],"names":[],"mappings":"AAuBA,4CAA4C;AAC5C,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,aAAe,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAM1C;AAED,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
@@ -13,13 +13,22 @@
13
13
  * - the no-real-cloud wrapper: ./safe-run.ts
14
14
  *
15
15
  * A product on a published chant without this subpath feature-detects:
16
- * import it lazily, and use it when `E2E_HARNESS_FLOOR` is there.
16
+ * import it lazily, and use it when `E2E_HARNESS_FLOOR` is there. A scenario
17
+ * with await-pull or comment steps, or a pull or gated outcome, needs
18
+ * `E2E_HARNESS_PULL_STEPS_FLOOR` as well.
17
19
  */
18
20
  import { existsSync } from "node:fs";
19
21
  import { join } from "node:path";
20
22
  import { NEXT_RELEASE } from "../release-floors.js";
21
23
  /** The first chant with the e2e harness. */
22
- export const E2E_HARNESS_FLOOR = NEXT_RELEASE;
24
+ export const E2E_HARNESS_FLOOR = "0.124.56";
25
+ /**
26
+ * The first chant whose harness follows a pull request a product opened
27
+ * (chant#4650): the await-pull and comment steps, the pull and gated
28
+ * outcomes, and the forge reads under them. A scenario that uses one needs
29
+ * this chant or newer.
30
+ */
31
+ export const E2E_HARNESS_PULL_STEPS_FLOOR = NEXT_RELEASE;
23
32
  /**
24
33
  * The harness's chant docker-lexicon project, to `chant build <dir>/src
25
34
  * --lexicon docker`. It ships as source in the package's src/.