@intentius/chant 0.124.89 → 0.124.91

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 (185) hide show
  1. package/dist/actor.d.ts +5 -3
  2. package/dist/actor.d.ts.map +1 -1
  3. package/dist/actor.js +7 -5
  4. package/dist/audit/core.d.ts.map +1 -1
  5. package/dist/audit/core.js +11 -1
  6. package/dist/ci-comment-commands.d.ts +18 -2
  7. package/dist/ci-comment-commands.d.ts.map +1 -1
  8. package/dist/ci-comment-commands.js +30 -2
  9. package/dist/ci-job-guard.d.ts +42 -45
  10. package/dist/ci-job-guard.d.ts.map +1 -1
  11. package/dist/ci-job-guard.js +206 -3
  12. package/dist/ci-note-commands.d.ts +41 -1
  13. package/dist/ci-note-commands.d.ts.map +1 -1
  14. package/dist/ci-note-commands.js +64 -5
  15. package/dist/ci-product.d.ts +50 -1
  16. package/dist/ci-product.d.ts.map +1 -1
  17. package/dist/ci-product.js +52 -6
  18. package/dist/cli/handlers/pr-comment.d.ts +13 -1
  19. package/dist/cli/handlers/pr-comment.d.ts.map +1 -1
  20. package/dist/cli/handlers/pr-comment.js +90 -1
  21. package/dist/cli/handlers/pr-notes.d.ts.map +1 -1
  22. package/dist/cli/handlers/pr-notes.js +23 -1
  23. package/dist/cli/handlers/pr.d.ts +2 -2
  24. package/dist/cli/handlers/pr.d.ts.map +1 -1
  25. package/dist/cli/handlers/pr.js +41 -20
  26. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  27. package/dist/cli/handlers/run-wave.js +154 -4
  28. package/dist/cli/main.d.ts.map +1 -1
  29. package/dist/cli/main.js +17 -0
  30. package/dist/cli/parse-args.d.ts.map +1 -1
  31. package/dist/cli/parse-args.js +28 -0
  32. package/dist/cli/registry.d.ts +12 -1
  33. package/dist/cli/registry.d.ts.map +1 -1
  34. package/dist/components/pr-checks.d.ts +39 -1
  35. package/dist/components/pr-checks.d.ts.map +1 -1
  36. package/dist/components/pr-checks.js +45 -2
  37. package/dist/components/pr-pipeline.d.ts +11 -3
  38. package/dist/components/pr-pipeline.d.ts.map +1 -1
  39. package/dist/components/pr-pipeline.js +20 -7
  40. package/dist/components/product-pipeline.d.ts +54 -2
  41. package/dist/components/product-pipeline.d.ts.map +1 -1
  42. package/dist/components/product-pipeline.js +63 -6
  43. package/dist/components/product-plan.d.ts +92 -2
  44. package/dist/components/product-plan.d.ts.map +1 -1
  45. package/dist/components/product-plan.js +172 -22
  46. package/dist/floor-table.data.d.ts.map +1 -1
  47. package/dist/floor-table.data.js +37 -23
  48. package/dist/lexicon-module.d.ts +2 -0
  49. package/dist/lexicon-module.d.ts.map +1 -1
  50. package/dist/lexicon-module.js +6 -2
  51. package/dist/lexicon.d.ts +82 -4
  52. package/dist/lexicon.d.ts.map +1 -1
  53. package/dist/lifecycle/gate-applied.d.ts +9 -0
  54. package/dist/lifecycle/gate-applied.d.ts.map +1 -1
  55. package/dist/op/apply-status.d.ts +84 -0
  56. package/dist/op/apply-status.d.ts.map +1 -0
  57. package/dist/op/apply-status.js +106 -0
  58. package/dist/op/before-merge-decide.d.ts +102 -0
  59. package/dist/op/before-merge-decide.d.ts.map +1 -0
  60. package/dist/op/before-merge-decide.js +142 -0
  61. package/dist/op/before-merge-done.d.ts +56 -0
  62. package/dist/op/before-merge-done.d.ts.map +1 -0
  63. package/dist/op/before-merge-done.js +69 -0
  64. package/dist/op/before-merge-store.d.ts +20 -0
  65. package/dist/op/before-merge-store.d.ts.map +1 -0
  66. package/dist/op/before-merge-store.js +48 -0
  67. package/dist/op/before-merge.d.ts +150 -0
  68. package/dist/op/before-merge.d.ts.map +1 -0
  69. package/dist/op/before-merge.js +207 -0
  70. package/dist/op/follow-on-run.d.ts +117 -0
  71. package/dist/op/follow-on-run.d.ts.map +1 -0
  72. package/dist/op/follow-on-run.js +154 -0
  73. package/dist/op/follow-on-store.d.ts +17 -0
  74. package/dist/op/follow-on-store.d.ts.map +1 -0
  75. package/dist/op/follow-on-store.js +54 -0
  76. package/dist/op/gate.d.ts +6 -0
  77. package/dist/op/gate.d.ts.map +1 -1
  78. package/dist/op/gate.js +10 -1
  79. package/dist/op/index.d.ts +3 -1
  80. package/dist/op/index.d.ts.map +1 -1
  81. package/dist/op/index.js +1 -0
  82. package/dist/op/op-waves-after-plan.d.ts +13 -0
  83. package/dist/op/op-waves-after-plan.d.ts.map +1 -1
  84. package/dist/op/op-waves-evidence-jobs.d.ts +4 -1
  85. package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
  86. package/dist/op/op-waves-evidence-jobs.js +10 -2
  87. package/dist/op/op-waves-follow-on.d.ts +162 -0
  88. package/dist/op/op-waves-follow-on.d.ts.map +1 -0
  89. package/dist/op/op-waves-follow-on.js +355 -0
  90. package/dist/op/op-waves-run.d.ts +146 -6
  91. package/dist/op/op-waves-run.d.ts.map +1 -1
  92. package/dist/op/op-waves-run.js +871 -99
  93. package/dist/op/op-waves-split.d.ts +122 -0
  94. package/dist/op/op-waves-split.d.ts.map +1 -0
  95. package/dist/op/op-waves-split.js +166 -0
  96. package/dist/op/op-waves.d.ts +20 -0
  97. package/dist/op/op-waves.d.ts.map +1 -1
  98. package/dist/op/op-waves.js +15 -1
  99. package/dist/op/schedule-overdue.d.ts +15 -1
  100. package/dist/op/schedule-overdue.d.ts.map +1 -1
  101. package/dist/op/schedule-overdue.js +18 -2
  102. package/dist/op/stage-hooks.d.ts +36 -1
  103. package/dist/op/stage-hooks.d.ts.map +1 -1
  104. package/dist/op/stage-hooks.js +17 -3
  105. package/dist/op/wave-stop.d.ts +4 -1
  106. package/dist/op/wave-stop.d.ts.map +1 -1
  107. package/dist/op/wave-stop.js +4 -2
  108. package/dist/planned-files.d.ts +16 -8
  109. package/dist/planned-files.d.ts.map +1 -1
  110. package/dist/planned-files.js +12 -8
  111. package/dist/pr-post.d.ts +6 -0
  112. package/dist/pr-post.d.ts.map +1 -1
  113. package/dist/pr-post.js +7 -5
  114. package/dist/release-floors.d.ts +9 -1
  115. package/dist/release-floors.d.ts.map +1 -1
  116. package/dist/release-floors.js +27 -19
  117. package/dist/wave-blocked.d.ts +7 -1
  118. package/dist/wave-blocked.d.ts.map +1 -1
  119. package/dist/wave-blocked.js +7 -2
  120. package/dist/wave-runtime.mjs +364 -351
  121. package/package.json +1 -1
  122. package/src/actor.test.ts +14 -1
  123. package/src/actor.ts +8 -6
  124. package/src/audit/core.ts +13 -1
  125. package/src/audit/first-load.test.ts +101 -0
  126. package/src/ci-comment-commands.test.ts +63 -0
  127. package/src/ci-comment-commands.ts +43 -4
  128. package/src/ci-image.test.ts +1 -2
  129. package/src/ci-job-guard.before-merge.test.ts +148 -0
  130. package/src/ci-job-guard.follow-on-record.test.ts +137 -0
  131. package/src/ci-job-guard.follow-on.test.ts +144 -0
  132. package/src/ci-job-guard.ts +221 -3
  133. package/src/ci-note-commands.test.ts +76 -1
  134. package/src/ci-note-commands.ts +96 -7
  135. package/src/ci-product.ts +65 -6
  136. package/src/cli/handlers/pr-comment.ts +85 -2
  137. package/src/cli/handlers/pr-notes.ts +30 -6
  138. package/src/cli/handlers/pr.ts +34 -17
  139. package/src/cli/handlers/run-wave.ts +144 -4
  140. package/src/cli/main.ts +17 -0
  141. package/src/cli/parse-args.ts +20 -0
  142. package/src/cli/registry.ts +12 -1
  143. package/src/components/pr-checks.ts +66 -2
  144. package/src/components/pr-pipeline.ts +21 -9
  145. package/src/components/product-pipeline.apply-status.test.ts +50 -0
  146. package/src/components/product-pipeline.ts +117 -9
  147. package/src/components/product-plan-names.test.ts +135 -0
  148. package/src/components/product-plan.test.ts +23 -5
  149. package/src/components/product-plan.ts +248 -25
  150. package/src/floor-table.data.ts +37 -23
  151. package/src/lexicon-module.ts +6 -2
  152. package/src/lexicon.ts +78 -1
  153. package/src/lifecycle/gate-applied.ts +7 -0
  154. package/src/op/apply-status.test.ts +83 -0
  155. package/src/op/apply-status.ts +132 -0
  156. package/src/op/before-merge-decide.ts +190 -0
  157. package/src/op/before-merge-done.ts +99 -0
  158. package/src/op/before-merge-store.ts +44 -0
  159. package/src/op/before-merge.test.ts +201 -0
  160. package/src/op/before-merge.ts +266 -0
  161. package/src/op/follow-on-run.ts +206 -0
  162. package/src/op/follow-on-store.ts +54 -0
  163. package/src/op/gate.ts +16 -1
  164. package/src/op/index.ts +5 -0
  165. package/src/op/op-waves-after-plan.ts +13 -0
  166. package/src/op/op-waves-evidence-jobs.ts +11 -3
  167. package/src/op/op-waves-follow-on-record.test.ts +152 -0
  168. package/src/op/op-waves-follow-on.test.ts +247 -0
  169. package/src/op/op-waves-follow-on.ts +385 -0
  170. package/src/op/op-waves-render-spec.test.ts +1 -2
  171. package/src/op/op-waves-run.ts +971 -93
  172. package/src/op/op-waves-split-product.test.ts +288 -0
  173. package/src/op/op-waves-split-step.test.ts +298 -0
  174. package/src/op/op-waves-split.test.ts +196 -0
  175. package/src/op/op-waves-split.ts +189 -0
  176. package/src/op/op-waves.ts +28 -3
  177. package/src/op/schedule-overdue.test.ts +29 -1
  178. package/src/op/schedule-overdue.ts +27 -3
  179. package/src/op/stage-hooks.ts +52 -4
  180. package/src/op/wave-stop.ts +5 -3
  181. package/src/planned-files.test.ts +33 -0
  182. package/src/planned-files.ts +26 -10
  183. package/src/pr-post.ts +13 -5
  184. package/src/release-floors.ts +31 -19
  185. package/src/wave-blocked.ts +9 -4
@@ -45,8 +45,22 @@ import { PLAN_RUN_OP, PLAN_RUN_RECORD_FILE } from "../pr-plan-record.js";
45
45
  import { idTokenVar, tradedClouds } from "../ci-identity.js";
46
46
  import { prNoteMarker } from "../pr-loop.js";
47
47
  import { PRODUCT_MARKER_NAME } from "../pr-plan-note.js";
48
+ import { gitlabJobArtifacts } from "./pr-checks.js";
48
49
  /** The variable the plan-note job reads the product's note words from (#4799), as JSON. Set from the pipeline, never from the report. */
49
50
  export const PR_PLAN_NOTE_WORDS_ENV = "CHANT_PLAN_NOTE_WORDS";
51
+ /**
52
+ * The one word a comment re-plan takes after the command (#4899): letters,
53
+ * digits and `_./@+=,:-`, and (#4984) never starting with `-`, so a flag
54
+ * such as `--target=x` is refused rather than read as a root. The source
55
+ * of a regular expression, without anchors.
56
+ */
57
+ export const REPLAN_WORD_SOURCE = "[A-Za-z0-9_.\\/@+=,:][A-Za-z0-9_.\\/@+=,:-]*";
58
+ /** {@link REPLAN_WORD_SOURCE} anchored, as the re-plan's `node -e` program writes it between slashes. */
59
+ const REPLAN_WORD_JS = `^${REPLAN_WORD_SOURCE}$`;
60
+ /** Whether `word` is one a re-plan takes (#4984). */
61
+ export function isReplanWord(word) {
62
+ return new RegExp(`^${REPLAN_WORD_SOURCE}$`).test(word);
63
+ }
50
64
  /** The variable a comment re-plan's one argument reaches the plan verb in (#4899). Empty on a pull request's own plan. */
51
65
  export const PLAN_ARGUMENT_ENV = "CHANT_PLAN_ARGUMENT";
52
66
  /** The file the note job's own lines write extra notices to, one a line (#4931): `pr-post` adds them under the note's counts. */
@@ -87,14 +101,46 @@ export function productPlanReachLock(forge, loop, words) {
87
101
  export { PLAN_RUN_OP, PLAN_RUN_RECORD_FILE } from "../pr-plan-record.js";
88
102
  /** The variable the plan step reads the record's op, environment and labels from (#4899), as JSON. */
89
103
  export const PLAN_RUN_RECORD_ENV = "CHANT_PLAN_RECORD";
104
+ /** The plan status's context of one plan job (#5003): its own, else the words'. */
105
+ export function productPlanContext(p, words) {
106
+ return p.context ?? productStatusContext(words, "plan", p.target);
107
+ }
108
+ /** The directory one plan job hands on (#5003): its own, else {@link PR_LOOP_REPORT_DIR}. */
109
+ export function productPlanReportDir(p) {
110
+ return p.reportDir ?? PR_LOOP_REPORT_DIR;
111
+ }
112
+ /** The workflow's default name (#4799): `chant-pr-<env>`. */
113
+ function defaultWorkflowName(env) {
114
+ return `chant-pr-${env}`;
115
+ }
116
+ /**
117
+ * The file a product plan's workflow is written to (#5003),
118
+ * {@link ProductPlanOptions.workflowFile}: the product's, checked for the
119
+ * forge, else the workflow's name in the forge's workflow directory
120
+ * (`.gitlab/<name>.gitlab-ci.yml` on GitLab).
121
+ */
122
+ export function productPlanWorkflowFile(forge, env, plan) {
123
+ const name = plan.workflow ?? defaultWorkflowName(env);
124
+ const dir = forge === "github" ? ".github/workflows" : forge === "forgejo" ? ".forgejo/workflows" : ".gitlab";
125
+ const file = plan.workflowFile;
126
+ if (file === undefined)
127
+ return forge === "gitlab" ? `${dir}/${name}.gitlab-ci.yml` : `${dir}/${name}.yml`;
128
+ if (!/\.ya?ml$/.test(file))
129
+ throw new Error(`the product plan's workflowFile ${JSON.stringify(file)} is not a .yml or .yaml file`);
130
+ if (file.startsWith("/") || file.split("/").some((part) => part === "" || part === "." || part === "..") || !/^[A-Za-z0-9_.\/-]+$/.test(file)) {
131
+ throw new Error(`the product plan's workflowFile ${JSON.stringify(file)} is not a path from the repository root of letters, digits and _.-, inside it`);
132
+ }
133
+ if (forge !== "gitlab" && (!file.startsWith(`${dir}/`) || file.slice(dir.length + 1).includes("/")))
134
+ throw new Error(`the product plan's workflowFile ${JSON.stringify(file)} is not directly under ${dir}/, where ${forge === "github" ? "GitHub" : "Forgejo"} reads workflows`);
135
+ return file;
136
+ }
90
137
  const TARGET_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
91
138
  /** The pull request loop's options the product plan's jobs do not carry, and what each needs. Each is refused with `plan` (#4799). */
92
139
  const NOT_WITH_PLAN = [
93
- ["applyBeforeMerge", "the apply before merge runs pr-apply on pr-plan's report"],
140
+ ["applyBeforeMerge", "the apply before merge runs pr-apply on pr-plan's report; give wavesBeforeMerge to run the waves on an open pull request's head (#4984)"],
94
141
  ["applyOnMerge", "the apply on merge runs on op waves, from the waves spec"],
95
142
  ["waveGate", "the apply on merge runs on op waves, from the waves spec"],
96
143
  ["previewComment", "the comment preview re-runs pr-plan"],
97
- ["staleNotes", "the stale marking names one note per pipeline"],
98
144
  ["identity", "the identity trade runs before pr-plan's checkout; give the product plan's trade or login (or a target's) instead"],
99
145
  ["build", "the plan verb builds what it plans"],
100
146
  ["buildCommand", "the plan verb builds what it plans"],
@@ -142,6 +188,21 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
142
188
  seen.add(t.name);
143
189
  }
144
190
  const github = forge !== "gitlab";
191
+ // #5003: the product's own names, checked before any job is written.
192
+ if (plan.workflowFile !== undefined)
193
+ productPlanWorkflowFile(forge, env, plan);
194
+ const reportDir = plan.reportDir;
195
+ if (reportDir !== undefined && !isReportDir(reportDir))
196
+ throw new Error(`the product plan's reportDir ${JSON.stringify(reportDir)} is not a directory from the checkout's root that stays inside it: letters, digits and _.-, parts joined by /, with no . or .. part and no / at either end`);
197
+ const outputDir = reportDir ?? PR_LOOP_REPORT_DIR;
198
+ const statusContext = plan.statusContext;
199
+ if (statusContext !== undefined) {
200
+ if (!/^[A-Za-z0-9][A-Za-z0-9_.\/:{}-]*$/.test(statusContext) || /[{}]/.test(statusContext.replaceAll("{target}", "")))
201
+ throw new Error(`the product plan's statusContext ${JSON.stringify(statusContext)} is not a status context of letters, digits and _./:-${targets ? ", with {target}" : ""}`);
202
+ if (Boolean(targets) !== statusContext.includes("{target}"))
203
+ throw new Error(targets ? `the product plan's statusContext ${JSON.stringify(statusContext)} is every target's, so it holds {target}` : `the product plan's statusContext ${JSON.stringify(statusContext)} holds {target}, and the plan has no targets`);
204
+ }
205
+ const namesOf = productPlanJobNames(forge, plan, targets?.map((t) => t.name));
145
206
  const shared = prLoopPassedEnv(forge, loop);
146
207
  const jobEnv = plan.env ? prLoopPassedEnv(forge, { variables: plan.env }) : {};
147
208
  for (const key of Object.keys(jobEnv)) {
@@ -186,6 +247,11 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
186
247
  const problem = scheduledWatchProblem(w);
187
248
  if (problem)
188
249
  throw new Error(`the product plan's watches: ${problem}`);
250
+ // #4988: a watch scoped to targets names the plan's own.
251
+ for (const t of w.targets ?? []) {
252
+ if (!seen.has(t))
253
+ throw new Error(`the product plan's watch ${w.op} names target ${t}, which the plan ${targets?.length ? "does not have" : "cannot scope to: it has no targets"}`);
254
+ }
189
255
  }
190
256
  if (new Set((plan.watches ?? []).map((w) => w.op)).size !== (plan.watches ?? []).length)
191
257
  throw new Error("the product plan's watches name an Op twice");
@@ -194,12 +260,17 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
194
260
  ...(plan.noteWords ? { [PR_PLAN_NOTE_WORDS_ENV]: JSON.stringify(plan.noteWords) } : {}),
195
261
  ...(plan.watches?.length ? { [PLAN_WATCHES_ENV]: JSON.stringify(plan.watches) } : {}),
196
262
  };
197
- const fill = (line, name) => line.replaceAll("{target}", name ?? env).replaceAll("{output}", PR_LOOP_REPORT_DIR);
263
+ const fill = (line, name) => line.replaceAll("{target}", name ?? env).replaceAll("{output}", outputDir);
198
264
  const control = plan.controlRead ? controlNoteCheckout(forge, plan.controlRead, words) : undefined;
199
265
  const one = (target) => {
200
266
  const name = target?.name;
201
- const jobName = github ? (name ? `plan-${name}` : "plan") : gitlabPlanJobName(name);
202
- const noteJobName = github ? (name ? `${PR_PLAN_NOTE_JOB}-${name}` : PR_PLAN_NOTE_JOB) : name ? `${name}-${PR_PLAN_NOTE_JOB}` : PR_PLAN_NOTE_JOB;
267
+ const names = namesOf(name);
268
+ const jobName = names.plan;
269
+ const noteJobName = names.note;
270
+ // #5003: the product's status context, and on GitLab its plan job's name for `pr-post --open` to find.
271
+ const context = statusContext?.replaceAll("{target}", name ?? "");
272
+ const named = [...(context !== undefined ? ["--context", context] : []), ...(!github && jobName !== gitlabPlanJobName(name) ? ["--plan-job", jobName] : [])];
273
+ const withNames = (p) => (named.length > 0 ? { ...p, command: `${p.command} ${named.join(" ")}` } : p);
203
274
  const own = target ? prLoopPassedEnv(forge, { ...(target.variables ? { variables: target.variables } : {}), ...(target.secrets ? { secrets: target.secrets } : {}) }) : {};
204
275
  for (const key of Object.keys(own)) {
205
276
  if (key in shared)
@@ -207,7 +278,8 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
207
278
  if (key in jobEnv)
208
279
  throw new Error(`target ${name}'s ${key} is the product plan's env too; give it once`);
209
280
  }
210
- const post0 = prLoopPostJob(forge, env, name, words);
281
+ // #4987: with staleNotes each target's note carries the target branch's commit, so the waves' push can mark it stale.
282
+ const post0 = withNames(prLoopPostJob(forge, env, name, words, { ...(loop.staleNotes ? { staleNotes: true } : {}), ...(reportDir !== undefined ? { output: reportDir } : {}) }));
211
283
  // #4899: the note job records the plan job's run, named by that job.
212
284
  const post1 = plan.record ? { ...post0, command: `${post0.command} --record-run ${jobName}` } : post0;
213
285
  // #4914: on GitLab the signing job of the same pipeline keeps each merge request's evidence, which the note's checks line reads.
@@ -238,11 +310,26 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
238
310
  }
239
311
  const idTokens = { ...(login?.idTokens ?? {}), ...tradeTokens, ...(ownTokens ?? {}) };
240
312
  const artifact = plan.artifact ? (name ? `${plan.artifact}-${name}` : plan.artifact) : name ? `chant-pr-plan-${name}` : "chant-pr-plan";
313
+ // #5004: on GitLab the plan job's own paths and reports beside the report directory, such as terragucci's terraform report.
314
+ const given = plan.artifacts;
315
+ const artifacts = given
316
+ ? gitlabJobArtifacts(forge, {
317
+ ...(given.paths ? { paths: given.paths.map((p) => fill(p, name)) } : {}),
318
+ ...(given.reports ? { reports: Object.fromEntries(Object.entries(given.reports).map(([type, p]) => [type, Array.isArray(p) ? p.map((q) => fill(q, name)) : fill(p, name)])) } : {}),
319
+ }, { job: "the product plan", last: "the plan verb is the plan job's last step" })
320
+ : undefined;
241
321
  // #4963: on GitHub and Forgejo the first re-plan job replies to the comments no other job takes.
242
322
  const replies = github && Boolean(replanOpts.reply) && (targets === undefined || target === targets[0]);
243
323
  const replan0 = replanComments
244
324
  ? {
245
- ...replanJobOf(forge, env, words, name, artifact, noteWords, { notAffected: replanOpts.notAffected === true }),
325
+ ...replanJobOf(forge, env, words, name, artifact, noteWords, {
326
+ notAffected: replanOpts.notAffected === true,
327
+ ...(loop.staleNotes ? { staleNotes: true } : {}),
328
+ jobName: names.replan,
329
+ noteJobName: names.replanNote,
330
+ ...(reportDir !== undefined ? { output: reportDir } : {}),
331
+ ...(context !== undefined ? { context } : {}),
332
+ }),
246
333
  ...replanComments,
247
334
  ...(github && dispatchArg !== undefined ? { dispatch: { argument: dispatchArg } } : {}),
248
335
  ...(replies ? { reply: { prefix: `/${words.product}`, others } } : {}),
@@ -265,11 +352,11 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
265
352
  ...(planRunner !== undefined ? { runner: planRunner } : {}),
266
353
  ...(noteRunner !== undefined ? { noteRunner } : {}),
267
354
  // #4978: a target's plan job plans that target alone, so its checks are `plan:<target>` and `policy:<target>`.
268
- ...(evidence ? { evidence: planEvidenceOf(forge, evidence, words, jobName, { ...(plan.forks === "skip" ? { noForks: true } : {}), ...(name ? { member: { name, reportPath: PR_LOOP_REPORT_DIR } } : {}) }) } : {}),
355
+ ...(evidence ? { evidence: planEvidenceOf(forge, evidence, words, jobName, { ...(plan.forks === "skip" ? { noForks: true } : {}), ...(name ? { member: { name, reportPath: outputDir } } : {}), ...(reportDir !== undefined ? { dir: reportDir } : {}) }) } : {}),
269
356
  ...(Object.keys(jobEnv).length > 0 ? { jobEnv } : {}),
270
357
  ...(login && login.steps.length > 0 ? { login: login.steps } : {}),
271
358
  ...(Object.keys(idTokens).length > 0 ? { idTokens } : {}),
272
- ...(plan.pending && github ? { pending: { context: productStatusContext(words, "plan", name), description: "planning" } } : {}),
359
+ ...(plan.pending && github ? { pending: { context: context ?? productStatusContext(words, "plan", name), description: "planning" } } : {}),
273
360
  ...(control ? { control } : {}),
274
361
  ...(plan.setup?.length ? { setup: plan.setup } : {}),
275
362
  ...(plan.report ? { report: fill(plan.report, name) } : {}),
@@ -278,10 +365,62 @@ export function productPlanJobs(forge, env, loop, words, evidence) {
278
365
  ...(record ? { record } : {}),
279
366
  ...(tradeSpec ? { trade: tradeSpec } : {}),
280
367
  ...(plan.previousMarker && productMarker ? { previous: { marker: prNoteMarker(env, name), name: productMarker } } : {}),
368
+ ...(context !== undefined ? { context } : {}),
369
+ ...(reportDir !== undefined ? { reportDir } : {}),
370
+ ...(artifacts ? { artifacts } : {}),
281
371
  };
282
372
  };
283
373
  return targets ? targets.map(one) : [one()];
284
374
  }
375
+ /** Whether `dir` is a report directory a product plan takes (#5003): a relative path that stays in the checkout. */
376
+ function isReportDir(dir) {
377
+ return /^[A-Za-z0-9_.\/-]+$/.test(dir) && !dir.startsWith("-") && dir.split("/").every((part) => part !== "" && part !== "." && part !== "..");
378
+ }
379
+ /** GitLab's top-level keywords, which no job may be named (#5003). */
380
+ const GITLAB_KEYWORDS = new Set(["default", "include", "stages", "variables", "workflow", "image", "services", "cache", "before_script", "after_script", "spec", "pages"]);
381
+ /**
382
+ * The plan jobs' names for each target (#5003), from
383
+ * {@link ProductPlanOptions.jobNames}, else chant's. Throws on a name that
384
+ * is not one, a `{target}` given without targets or left out with them, and
385
+ * two jobs of the plan that share a name.
386
+ */
387
+ function productPlanJobNames(forge, plan, targets) {
388
+ const github = forge !== "gitlab";
389
+ const given = plan.jobNames ?? {};
390
+ const chant = { plan: "plan", note: PR_PLAN_NOTE_JOB, replan: REPLAN_JOB, replanNote: REPLAN_NOTE_JOB };
391
+ const keys = ["plan", "note", "replan", "replanNote"];
392
+ for (const key of keys) {
393
+ const t = given[key];
394
+ if (t === undefined)
395
+ continue;
396
+ if (Boolean(targets) !== t.includes("{target}"))
397
+ throw new Error(targets ? `the product plan's jobNames.${key} ${JSON.stringify(t)} names every target's job, so it holds {target}` : `the product plan's jobNames.${key} ${JSON.stringify(t)} holds {target}, and the plan has no targets`);
398
+ }
399
+ const namesOf = (target) => {
400
+ const out = {};
401
+ for (const key of keys) {
402
+ const t = given[key];
403
+ // chant's: `plan-<target>` on GitHub and Forgejo, `<target>-plan` on GitLab.
404
+ out[key] = t !== undefined ? t.replaceAll("{target}", target ?? "") : target ? (github ? `${chant[key]}-${target}` : `${target}-${chant[key]}`) : chant[key];
405
+ }
406
+ return out;
407
+ };
408
+ const seen = new Map();
409
+ for (const target of targets ?? [undefined]) {
410
+ const names = namesOf(target);
411
+ for (const key of plan.replan ? keys : ["plan", "note"]) {
412
+ const n = names[key];
413
+ const ok = github ? /^[A-Za-z_][A-Za-z0-9_-]*$/.test(n) : /^[A-Za-z0-9_][A-Za-z0-9_-]*$/.test(n) && !GITLAB_KEYWORDS.has(n);
414
+ if (!ok)
415
+ throw new Error(`the product plan's ${given[key] !== undefined ? `jobNames.${key}` : `${key} job`} ${JSON.stringify(n)} is not a job name of letters, digits, _ and -, starting with a letter or _${github ? "" : " or a digit, and no GitLab keyword"}`);
416
+ const other = seen.get(n);
417
+ if (other !== undefined)
418
+ throw new Error(`the product plan names two jobs ${n}: ${other} and ${key}${target ? ` of ${target}` : ""}`);
419
+ seen.set(n, `${key}${target ? ` of ${target}` : ""}`);
420
+ }
421
+ }
422
+ return namesOf;
423
+ }
285
424
  /** The comments the re-plan answers (#4899): the plan command, then the words' aliases for it. Refused when the words name no plan command. */
286
425
  function replanCommentsOf(words) {
287
426
  const command = commentLine(words, "plan");
@@ -291,15 +430,19 @@ function replanCommentsOf(words) {
291
430
  return { comments: [command, ...aliases.filter((a) => a.when === undefined).map((a) => a.from)], gated: aliases.filter((a) => a.when !== undefined).map((a) => ({ comment: a.from, when: a.when })) };
292
431
  }
293
432
  /** The re-plan's jobs for one target (#4899), its comments filled in by the caller. */
294
- function replanJobOf(forge, env, words, name, artifact, noteWords0, opts = {}) {
433
+ function replanJobOf(forge, env, words, name, artifact, noteWords0, opts) {
295
434
  const github = forge !== "gitlab";
296
- const jobName = github ? (name ? `${REPLAN_JOB}-${name}` : REPLAN_JOB) : name ? `${name}-${REPLAN_JOB}` : REPLAN_JOB;
297
- const noteJobName = github ? (name ? `${REPLAN_NOTE_JOB}-${name}` : REPLAN_NOTE_JOB) : name ? `${name}-${REPLAN_NOTE_JOB}` : REPLAN_NOTE_JOB;
435
+ const { jobName, noteJobName } = opts;
298
436
  // pr-post reads the pull request and the head from the re-plan job, never the comment. GitLab's is GitHub's line with its own --forge.
299
- const command0 = github ? prLoopPostJob(forge, env, name, words).command : prLoopPostJob("github", env, name, words).command.replace(" --forge github ", " --forge gitlab ");
437
+ // #4987: with staleNotes the note's tip line is the target branch's commit the re-plan ran at, as the comment preview's is.
438
+ // #5003: the product's report directory and status context.
439
+ const post0 = { ...(opts.staleNotes ? { staleNotes: true } : {}), ...(opts.output !== undefined ? { output: opts.output } : {}) };
440
+ const command0 = github ? prLoopPostJob(forge, env, name, words, post0).command : prLoopPostJob("github", env, name, words, post0).command.replace(" --forge github ", " --forge gitlab ");
441
+ const command1 = opts.context !== undefined ? `${command0} --context ${opts.context}` : command0;
300
442
  // #4963: the argument the re-plan was narrowed to, which pr-post answers "not affected" for when the change does not reach it.
301
- const command = opts.notAffected ? `${command0} --not-affected "$${PLAN_ARGUMENT_ENV}"` : command0;
302
- const noteWords = opts.notAffected && github ? { ...noteWords0, [PLAN_ARGUMENT_ENV]: `\${{ needs.${jobName}.outputs.argument }}` } : noteWords0;
443
+ const command = opts.notAffected ? `${command1} --not-affected "$${PLAN_ARGUMENT_ENV}"` : command1;
444
+ const noteWords1 = opts.notAffected && github ? { ...noteWords0, [PLAN_ARGUMENT_ENV]: `\${{ needs.${jobName}.outputs.argument }}` } : noteWords0;
445
+ const noteWords = opts.staleNotes ? { ...noteWords1, TIP_SHA: github ? "${{ github.sha }}" : "$CI_COMMIT_SHA" } : noteWords1;
303
446
  const post = github
304
447
  ? {
305
448
  command,
@@ -339,7 +482,8 @@ function literal(text) {
339
482
  * a target, the command with at most one word after it.
340
483
  */
341
484
  export function gitlabReplanCommentIf(replan, target) {
342
- const arg = target ? `( +${literal(target)})?` : "( +[A-Za-z0-9_.\\/@+=,:-]+)?";
485
+ // #4984: the one word never starts with `-`, so a flag such as `--target=x` starts no re-plan.
486
+ const arg = target ? `( +${literal(target)})?` : `( +${REPLAN_WORD_SOURCE})?`;
343
487
  const one = (c) => `$${GITLAB_REPLAN_COMMENT_VAR} =~ /^${literal(c)}${arg} *$/`;
344
488
  return [...replan.comments.map(one), ...replan.gated.map((g) => `($${g.when} && ${one(g.comment)})`)].join(" || ");
345
489
  }
@@ -385,15 +529,19 @@ export function replanDecideJs(opts = {}) {
385
529
  'const body=String((e.comment&&e.comment.body)||"").trim();',
386
530
  'const cmds=JSON.parse(process.env.CHANT_REPLAN_COMMANDS||"[]");',
387
531
  'for(const g of JSON.parse(process.env.CHANT_REPLAN_GATED||"[]")){const v=process.env[g.when]||"";if(v&&v!=="0"&&v!=="false")cmds.push(g.comment)}',
388
- "let arg;",
532
+ "let arg,flag;",
389
533
  ...(reply ? ['let refusal;const product=process.env.CHANT_REPLAN_PRODUCT||"",others=JSON.parse(process.env.CHANT_REPLAN_OTHERS||"[]");const says=(c)=>body===c||body.startsWith(c+" ")||body.startsWith(c+"\\t");'] : []),
390
534
  ...(dispatch
391
535
  ? [
392
536
  'if(dispatch){const pv=String(inputs.pr==null?"":inputs.pr).trim();if(!pv){say("the dispatch names no pull request");process.exit(0)}if(!/^[1-9][0-9]{0,9}$/.test(pv)){console.error("chant: the dispatch\\u0027s pr input is a pull request number, like 42");process.exit(1)}',
393
- 'const k=process.env.CHANT_REPLAN_DISPATCH_ARGUMENT||"argument",a=String(inputs[k]==null?"":inputs[k]).trim();if(a&&!/^[A-Za-z0-9_.\\/@+=,:-]+$/.test(a)){console.error("chant: the dispatch\\u0027s "+k+" input is one word of letters, digits and _./@+=,:-");process.exit(1)}arg=a}else ',
537
+ `const k=process.env.CHANT_REPLAN_DISPATCH_ARGUMENT||"argument",a=String(inputs[k]==null?"":inputs[k]).trim();if(a&&!/${REPLAN_WORD_JS}/.test(a)){console.error("chant: the dispatch\\u0027s "+k+" input is one word of letters, digits and _./@+=,:-, not starting with -");process.exit(1)}arg=a}else `,
394
538
  ]
395
539
  : []),
396
- 'for(const c of cmds){if(body===c){arg="";break}if(body.startsWith(c+" ")){const r=body.slice(c.length).trim();if(/^[A-Za-z0-9_.\\/@+=,:-]+$/.test(r)){arg=r;break}}}',
540
+ // #4984: a word that starts with `-` is a flag (`--target=x`), which the re-plan does not take.
541
+ `for(const c of cmds){if(body===c){arg="";break}if(body.startsWith(c+" ")){const r=body.slice(c.length).trim();if(r.startsWith("-")){flag=r.split(/\\s/)[0];break}if(/${REPLAN_WORD_JS}/.test(r)){arg=r;break}}}`,
542
+ reply
543
+ ? 'if(flag!==undefined){refusal="the re-plan takes no flags, and "+flag+" is one: write the command alone, or with one word that does not start with -";arg=""}'
544
+ : 'if(flag!==undefined){say("the re-plan takes no flags, and "+flag+" is one, so nothing is planned again");process.exit(0)}',
397
545
  reply
398
546
  ? 'if(arg===undefined){if(product&&says(product)&&!others.some(says)){refusal="the commands are "+cmds.concat(others).map((c)=>"`"+c+"`").join(", ")}else{say("the comment asks for no plan");process.exit(0)}}'
399
547
  : 'if(arg===undefined){say("the comment asks for no plan");process.exit(0)}',
@@ -497,7 +645,7 @@ export function planVerbLines(p) {
497
645
  `${p.command} || chant_plan_exit=$?`,
498
646
  ...(p.report ? [`${p.report} || echo "chant: the report line exited $?" >&2`] : []),
499
647
  // #4899: the run record goes into the hand-off, for the note job to keep on chant/lifecycle.
500
- ...(p.record ? [`CHANT_PLAN_EXIT="$chant_plan_exit" CHANT_PLAN_STARTED="$chant_plan_started" node -e '${PLAN_RECORD_JS}' ${PR_LOOP_REPORT_DIR} || echo "chant: the plan's run record was not written" >&2`] : []),
648
+ ...(p.record ? [`CHANT_PLAN_EXIT="$chant_plan_exit" CHANT_PLAN_STARTED="$chant_plan_started" node -e '${PLAN_RECORD_JS}' ${productPlanReportDir(p)} || echo "chant: the plan's run record was not written" >&2`] : []),
501
649
  '[ "$chant_plan_exit" -eq 0 ] || exit "$chant_plan_exit"',
502
650
  ];
503
651
  }
@@ -532,20 +680,22 @@ export function planEvidenceOf(forge, evidence, words, planJob, opts = {}) {
532
680
  const key = evidenceKeyEnv(forge, evidence);
533
681
  const bin = words.bin;
534
682
  const member = opts.member ? { member: opts.member.name } : {};
683
+ // #5003: the product plan's report directory, which the plan job handed on.
684
+ const reportDir = opts.dir ?? PR_LOOP_REPORT_DIR;
535
685
  if (forge === "gitlab") {
536
686
  // #4914: the job runs in the target branch's plan notes pipeline, before the note job, and signs every open
537
687
  // merge request's settled plan job from its artifact; no job of a merge request pipeline holds the key.
538
688
  const dir = gitlabOpenEvidenceDir(planJob);
539
689
  return {
540
690
  jobName: `${planJob}-evidence`,
541
- lines: openEvidenceLines({ job: planJob, dir: opts.member?.reportPath ?? PR_LOOP_REPORT_DIR, out: dir, ...(bin ? { bin } : {}), ...(opts.noForks ? { noForks: true } : {}), ...member }),
691
+ lines: openEvidenceLines({ job: planJob, dir: opts.member?.reportPath ?? reportDir, out: dir, ...(bin ? { bin } : {}), ...(opts.noForks ? { noForks: true } : {}), ...member }),
542
692
  env: key,
543
693
  dir,
544
694
  ...(evidenceKeyless(evidence) ? { idTokens: evidenceIdTokens(evidence) } : {}),
545
695
  };
546
696
  }
547
697
  return {
548
- lines: planEvidenceLines({ dir: PR_LOOP_REPORT_DIR, at: '"$HEAD_SHA"', base: '"$BASE_SHA"', result: '"$PLAN_RESULT"', ...(bin ? { bin } : {}), ...member }),
698
+ lines: planEvidenceLines({ dir: reportDir, at: '"$HEAD_SHA"', base: '"$BASE_SHA"', result: '"$PLAN_RESULT"', ...(bin ? { bin } : {}), ...member }),
549
699
  env: { HEAD_SHA: "${{ github.sha }}", BASE_SHA: "${{ github.event.pull_request.base.sha }}", PLAN_RESULT: `\${{ needs.${planJob}.result }}`, ...key },
550
700
  ...(evidenceKeyless(evidence) ? { idToken: true } : {}),
551
701
  };
@@ -1 +1 @@
1
- {"version":3,"file":"floor-table.data.d.ts","sourceRoot":"","sources":["../src/floor-table.data.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAyOzC,CAAC"}
1
+ {"version":3,"file":"floor-table.data.d.ts","sourceRoot":"","sources":["../src/floor-table.data.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAuPzC,CAAC"}
@@ -33,13 +33,23 @@ export const FLOOR_ROWS = [
33
33
  { name: "PRODUCT_PLAN_FLOOR", version: "0.124.86", gates: "The product plan (#4799): `productPipelineJobs(forge, env, { words, productPlan })` runs the product's plan verb in place of `pr-plan`, one plan job and one plan-note job per target, each with only its target's variables and secrets and an optional write probe, and `pr-post` posts the plan note hand-off the verb wrote (`planNoteHandoff`, `PR_PLAN_NOTE_FILE` in `@intentius/chant/pr-plan-note`).", issue: "#4799", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
34
34
  { name: "PRODUCT_PLAN_STEPS_FLOOR", version: "0.124.88", gates: "The first chant whose product plan carries the plan-job steps beside the plan verb and the note job's own lines (#4899, #4931): `productPlan.login` and a target's `login` (ci-login) with the job's OIDC token, `idTokens`, `pending`, `controlRead`, `setup` steps, job-level `env`, `report`, `concurrency`, the comment re-plan `replan`, and `noteSteps`; a hand-off's `marker` kept under the note words' `productMarker`; and the note job's notices and overdue Ops under a hand-off's counts.", issue: "#4899", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
35
35
  { name: "COMMENT_LEAVES_COMMIT_FLOOR", version: "0.124.88", gates: "The first chant whose `parseProductComment` takes `leaveCommit` and that has `commitWordOf` (#4890): a comment job that is not the commit job leaves every comment for a commit word to it, a malformed one included, so the comment gets one reply.", issue: "#4890", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
36
- { name: "COMMENT_COMMANDS_FLOOR", version: NEXT_RELEASE, gates: "The first chant with the comment job on GitHub and Forgejo and the replies to commands no job runs (#4946): `commentJob` in the product pipeline (`chant components pr-comment`, `answerProductComment` in `@intentius/chant/ci-comment-commands`), which replies to a refusal and to a command the pipeline runs no job for, and with waves on merge starts a merged pull request's apply again; the words' `replies` and an alias's `refuse`, which the GitLab note poll reads too, as `chantNoteRuns`' `members`; `retryApply`; and `locks: \"plan\"` in GitHub's and Forgejo's product plan, with the lock, unlock and comment lock jobs.", issue: "#4946", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
37
- { name: "PRODUCT_PLAN_REACH_LOCKS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose product plan locks what a change reaches (#4979): `productPlan.reach`, a reach line the lock job runs at the target branch's commit with `chant lock --reach` (`@intentius/chant/lifecycle/reach-locks`), on GitHub, Forgejo and GitLab, where the lock job runs in the plan notes pipeline with `--open` beside the comment lock and unlock jobs; and whose comment job answers a re-plan comment with flags the product plan's re-plan cannot take (`noPlanFlags`).", issue: "#4979", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
38
- { name: "WAVE_STOP_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose comment job stops a merged pull request's re-run at a wave (#4979): `/<product> apply wave-<n>` writes a stop for the merge commit on `chant/lifecycle` (`_waves/<op>.stops.json`, `@intentius/chant/op/wave-stop`) before GitHub's re-run or Forgejo's dispatch, and `chant run wave` leaves each wave after n waiting (exit 3).", issue: "#4979", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
36
+ { name: "COMMENT_COMMANDS_FLOOR", version: "0.124.89", gates: "The first chant with the comment job on GitHub and Forgejo and the replies to commands no job runs (#4946): `commentJob` in the product pipeline (`chant components pr-comment`, `answerProductComment` in `@intentius/chant/ci-comment-commands`), which replies to a refusal and to a command the pipeline runs no job for, and with waves on merge starts a merged pull request's apply again; the words' `replies` and an alias's `refuse`, which the GitLab note poll reads too, as `chantNoteRuns`' `members`; `retryApply`; and `locks: \"plan\"` in GitHub's and Forgejo's product plan, with the lock, unlock and comment lock jobs.", issue: "#4946", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
37
+ { name: "PRODUCT_PLAN_REACH_LOCKS_FLOOR", version: "0.124.89", gates: "The first chant whose product plan locks what a change reaches (#4979): `productPlan.reach`, a reach line the lock job runs at the target branch's commit with `chant lock --reach` (`@intentius/chant/lifecycle/reach-locks`), on GitHub, Forgejo and GitLab, where the lock job runs in the plan notes pipeline with `--open` beside the comment lock and unlock jobs; and whose comment job answers a re-plan comment with flags the product plan's re-plan cannot take (`noPlanFlags`).", issue: "#4979", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
38
+ { name: "WAVE_STOP_FLOOR", version: "0.124.89", gates: "The first chant whose comment job stops a merged pull request's re-run at a wave (#4979): `/<product> apply wave-<n>` writes a stop for the merge commit on `chant/lifecycle` (`_waves/<op>.stops.json`, `@intentius/chant/op/wave-stop`) before GitHub's re-run or Forgejo's dispatch, and `chant run wave` leaves each wave after n waiting (exit 3).", issue: "#4979", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
39
+ { name: "WAVES_BEFORE_MERGE_FLOOR", version: "0.124.90", gates: "The first chant whose Op waves run before merge (#4984): `wavesBeforeMerge` in the product pipeline, where the comment job (GitHub, Forgejo) or the note poll (GitLab) decides `/<product> apply [wave-<n>]` on an open pull request (`decideWavesBeforeMerge`, `@intentius/chant/op/before-merge-decide`), records the head and its digest on `chant/lifecycle` (`_waves/<op>.before-merge.json`) and starts the waves for it; the generators' `beforeMerge`, whose guard admits that head alone, whose jobs check it out and read the base from the default branch, and whose `before-merge-done` job merges and releases the locks (`chant run wave --merge`); `waveJobs.<wave>.prelude`; the GitLab note poll's wave stop (`chantNoteRuns`' `waves`); a re-plan word that never starts with `-`; and the terraform lexicon's reach helpers (`@intentius/chant-lexicon-terraform/reach`).", issue: "#4984", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
40
+ { name: "WAVES_APPLY_STATUS_FLOOR", version: "0.124.90", gates: "The first chant whose Op waves post the apply statuses (#4987): the generators' `applyStatus`, a job `apply-status-<n>` after each wave at the default branch's commit that posts `<product>/apply` on the commit the waves applied (a before-merge run's decided head) with `chant run wave --apply-status` (`@intentius/chant/op/apply-status`), and the product pipeline's `applyStatus`; whose product plan takes `staleNotes`, each target's note carrying the target branch's commit and a `stale-notes` job beside wave 1 on a push marking each target's note (`pr-post --stale` with one `--member` per target); whose `productPipelineJobs` returns `waves.pipeline` for the generators; and whose GitLab reach line reaches the lock and note-commands jobs unexpanded (`expand: false`).", issue: "#4987", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
41
+ { name: "WAVES_BEFORE_MERGE_SPLIT_FLOOR", version: "0.124.90", gates: "The first chant whose before-merge waves never run the change's code beside a write token (#4987): with `beforeMerge` each wave is a plan job (the change's code, a checkout with no credentials kept, a read-only token; GitLab drops `CHANT_FORGE_TOKEN` and the job token), a gate job at the default branch with the token, an applying job on the saved plan with no write token, and a record job at the default branch that writes the run records (`chant run wave --phase plan|gate|apply|record`, `@intentius/chant/op/op-waves-split`).", issue: "#4987", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
42
+ { name: "WAVES_BEFORE_MERGE_STEP_FLOOR", version: "0.124.90", gates: "The first chant whose split before-merge waves take a `step` spec, Forgejo's hand-off, holds on other gates and one approval per wave (#4992): the plan job saves each run's step plan, the gate job leases the rows they change (no heartbeat; the decision names the lease) before it spends the approval, the applying job plans its runs again through the step and applies each whose digest the decision holds, and the record job writes the release records and lets go of the rows; a hook in the plan or apply job that holds the wave on another gate reads it with no write token and leaves its pending fact to the gate or record job; on Forgejo the plan and applying jobs hand their files on as job outputs (`packJs`), never through the artifact upload, and the gate and record jobs keep them as the artifacts; the plan job names no environment on GitHub (a wave's `planEnvironment` when set; on GitLab it prepares it), so the environment's reviewers are asked once.", issue: "#4992", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
43
+ { name: "WAVES_PRODUCT_HOOKS_FLOOR", version: "0.124.90", gates: "The first chant whose split waves run a product's own process in every job (#4994): the product wave hook's `hooks` (`runChantInProcess([\"run\", \"wave\", ..., \"--phase\", <phase>], words, { wave: { afterPlan, capabilities, hookExec, runHooks, hooks } })`, `RunOpWaveOptions.inProcessHooks`) serves a spec hook by its name in the process of whichever job runs it, plan, gate or applying job or the one-job shape, in place of a command that called back over a socket; `opWaveProductStateDir` is where the plan job's code keeps what the later jobs read; a `record: true` hold in the plan job is spent by the gate job for a re-run of the hook at the wave's commit (an applied line with `rerun.head`), which the next run's plan job runs and its gate job finishes (`holdsFinished`); and `waveJobs.<wave>.artifact.path` takes a list and `waveJobs.<wave>.gate` gives the gate job a report and an artifact, so a product's own upload steps go through chant's Forgejo hand-off.", issue: "#4994", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
44
+ { name: "WAVES_BEFORE_MERGE_REST_FLOOR", version: "0.124.90", gates: "The first chant whose split before-merge waves take a `rest` wave (#4992): its four jobs run one wave per run, the wave `CHANT_WAVES_WAVE` names (their own by default), and its record job, once the run applied and the plan found another wave, starts the waves workflow again for it (GitHub and Forgejo: a dispatch with the inputs `wave` and the decision's `pr`, `head` and `digest`, or a push's `commit`; GitLab: a pipeline with the same variables, with `CHANT_FORGE_TOKEN`), whose guard admits it as the same decided head; the jobs of the waves before it do not run in that follow-on; the record job's note (`rest-wave.json` beside the outcomes, `@intentius/chant/op/op-waves-follow-on`) tells `before-merge-done`, the control dispatch and the apply status that a run which started a follow-on is not the last.", issue: "#4992", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
45
+ { name: "WAVES_FOLLOW_ON_RECORD_FLOOR", version: "0.124.90", gates: "The first chant whose rest wave's record job records each follow-on it starts on `chant/lifecycle` before it starts it (#4998): `_waves/<op>.follow-on.json` keeps, per decided head or pushed commit, the wave started, the run that started it, the decision (`pr`, `digest`) or the `commit`, and the outcomes of every run of the chain so far; the guard admits a follow-on only for the wave that record names, so a wave started by hand past it is refused; and the last run's control dispatch, apply status and `before-merge-done` add up the outcomes of every run of the chain (the note's `chain`), so a chain whose last wave changed nothing reports `applied`.", issue: "#4998", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
39
46
  { name: "PRODUCT_PLAN_WATCHES_FLOOR", version: "0.124.88", gates: "The first chant whose product plan takes `watches`, the product's own scheduled jobs the note job's `pr-post` checks for having stopped with the job's token (#4888), and whose `checkOverdueOps` and `overdueOpsAt` take a product's `logPrefix` and `label`.", issue: "#4888", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
47
+ { name: "PRODUCT_PLAN_WATCH_TARGETS_FLOOR", version: "0.124.90", gates: "The first chant whose product plan's `watches` take `targets` (#4988): a watch scoped to those targets is checked by their notes alone, and the note of another target checks neither it nor the discovered Op of its name (`watchesForTarget`).", issue: "#4988", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
40
48
  { name: "PRODUCT_PLAN_RECORD_FLOOR", version: "0.124.88", gates: "The first chant whose product plan takes `record` (#4899): the plan step writes the plan job's run record into the hand-off, and the note job keeps it as Op `pr-plan` on `chant/lifecycle` with `pr-post --record-run <plan job>` (`--open` on GitLab), as `chant ci run plan --in-place` records `pr-plan`'s.", issue: "#4899", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
41
- { name: "PRODUCT_PLAN_REPLAN_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose product plan carries what terragucci's and sql-yodeler's plan jobs did themselves (#4963, #4951): `trade` (a plan's or a target's) before the checkout, `replan: { dispatch, reply, notAffected }` (a re-plan from `workflow_dispatch`, a reply to a comment no other job takes, `pr-post --not-affected`), `previousMarker` (`CHANT_PLAN_PREVIOUS_MARKER`), `noteSteps.pullRequest`, a `PrReport`'s `marker`, and a hand-off of the product's own note text (`planBodyHandoff`).", issue: "#4963", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
42
- { name: "PRODUCT_PLAN_SUBJECT_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose note job compares the plan's subject with the previous note's (#4972), on GitHub, Forgejo and GitLab: a plan note hand-off's `subject` (`PrPlanSubject`, an id and named parts) is kept in the note, and `pr-post` adds the note words' `sinceLast` line, naming the parts added, gone and changed (`subjectParts`), when the previous note kept another id.", issue: "#4972", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
49
+ { name: "PRODUCT_PLAN_REPLAN_FLOOR", version: "0.124.89", gates: "The first chant whose product plan carries what terragucci's and sql-yodeler's plan jobs did themselves (#4963, #4951): `trade` (a plan's or a target's) before the checkout, `replan: { dispatch, reply, notAffected }` (a re-plan from `workflow_dispatch`, a reply to a comment no other job takes, `pr-post --not-affected`), `previousMarker` (`CHANT_PLAN_PREVIOUS_MARKER`), `noteSteps.pullRequest`, a `PrReport`'s `marker`, and a hand-off of the product's own note text (`planBodyHandoff`).", issue: "#4963", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
50
+ { name: "PRODUCT_PLAN_SUBJECT_FLOOR", version: "0.124.89", gates: "The first chant whose note job compares the plan's subject with the previous note's (#4972), on GitHub, Forgejo and GitLab: a plan note hand-off's `subject` (`PrPlanSubject`, an id and named parts) is kept in the note, and `pr-post` adds the note words' `sinceLast` line, naming the parts added, gone and changed (`subjectParts`), when the previous note kept another id.", issue: "#4972", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
51
+ { name: "PRODUCT_PLAN_NAMES_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose product plan keeps a product's own names (#5003): `workflowFile` (the generators' `path`), `jobNames` (the plan, note, re-plan and re-plan note jobs, with `{target}`), `statusContext` (which `pr-post --context`, the pending step, the stale job and the apply before merge use) and `reportDir` (`{output}`, the hand-off, the artifact's path and `pr-post --output`), and whose `pr-post --open` finds a plan job of the product's name (`--plan-job`).", issue: "#5003", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
52
+ { name: "PRODUCT_PLAN_ARTIFACTS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose GitLab product plan job keeps a product's own artifacts beside the report directory (#5004): `productPlan.artifacts: { paths, reports }`, as `artifacts:paths` and `artifacts:reports`, such as terragucci's `terraform` report for the merge request's widget, with `{target}` and `{output}` filled.", issue: "#5004", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
43
53
  { name: "PRODUCT_ACTIONS_FLOOR", version: "0.124.58", gates: "Day-2 actions in the product pipeline (#4654): the `action` comment command counted as answered by the product's own workflow (`productPipelineJobs(forge, env, { words, actions: true })`), or the pipeline's own action job (`actionJob`, `build --pr-loop --action-job`), which answers the comment and a dispatch with a member and an action input, and runs the product's action verb with `--from-event`.", issue: "#4654", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
44
54
  { name: "APPROVAL_STATUS_FLOOR", version: "0.124.56", gates: "The approval status before merge (#4630): under a `pr-review` wave, the op waves generators add a job that posts `<product>/approval` on each open pull request's head.", issue: "#4630", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
45
55
  { name: "APPROVAL_STATUS_PULL_REQUEST_FLOOR", version: "0.124.56", gates: "The approval status for `pull-request` waves too (#4630, 2026-10-28 ruling): the generators add the record-plans and approval-status jobs for a spec whose waves take the pull request's own approval, and the status reads that approval's coverage of each wave's change set.", issue: "#4630", file: "ci-product.ts", modules: ["@intentius/chant/ci-product"] },
@@ -145,7 +155,7 @@ export const FLOOR_ROWS = [
145
155
  { name: "TERRAFORM_APPLY_COMMAND_HOOK_FLOOR", version: "0.124.86", gates: "The first chant whose `terraformApplyCapabilityWith` takes `onCommand`, a hook around each engine command `terraform-apply` runs for a root, its reads' upstreams included (#4865).", issue: "#4865", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
146
156
  { name: "TERRAFORM_ENGINE_TIMINGS_FLOOR", version: "0.124.88", gates: "The first chant whose terraform lexicon times each root's engine commands and reads its spans and lock waits (`@intentius/chant-lexicon-terraform/engine-timings`, `engineTimings()` as `terraformApplyCapabilityWith`'s `onCommand`), and runs a composed group's commands through that hook (#4887).", issue: "#4887", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
147
157
  { name: "TERRAFORM_ROOT_HELPERS_FLOOR", version: "0.124.88", gates: "The first chant whose terraform lexicon finds live roots and estates (`live-roots`), places a Terragrunt unit (`terragruntUnitPlace`), reads a state migration's history and revert from its finished lines (`migration-history`), and runs the binary without the forge's tokens (`tokenlessBinaryExec`, `engineEnv`) (#4910).", issue: "#4910", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
148
- { name: "TERRAFORM_ENGINE_RUNNER_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose terraform lexicon has one runner of the engine for a product (`engineRunner` in `engine-runner`: a hooked `exec`, `execSync`, `terragrunt` and the tokenless `script`), traces each engine command (`commandTrace`, `commandTraceEnv`), sends each Terragrunt unit's plan through `planTerragruntWave({ onCommand })`, and resolves a live root's record store (`liveRecordStore`, `writtenRecordStore`, `rootBackendAttrs` in `live-roots`) (#4954).", issue: "#4954", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
158
+ { name: "TERRAFORM_ENGINE_RUNNER_FLOOR", version: "0.124.89", gates: "The first chant whose terraform lexicon has one runner of the engine for a product (`engineRunner` in `engine-runner`: a hooked `exec`, `execSync`, `terragrunt` and the tokenless `script`), traces each engine command (`commandTrace`, `commandTraceEnv`), sends each Terragrunt unit's plan through `planTerragruntWave({ onCommand })`, and resolves a live root's record store (`liveRecordStore`, `writtenRecordStore`, `rootBackendAttrs` in `live-roots`) (#4954).", issue: "#4954", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
149
159
  { name: "PRODUCT_HELPERS_FLOOR", version: "0.124.86", gates: "The first chant with `@intentius/chant/forge-flags` (`forgeTargetWith`, `forgeTargetFromFlags`, `apiBaseOf`), `@intentius/chant/chant-install` (`bundledChant`, `chantArgv`, `installChantResolveFallback`) and `noteLimit` and `fitNote` in `@intentius/chant/plan-summary` (#4800).", issue: "#4800", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
150
160
  { name: "CI_IMAGE_FLOOR", version: "0.124.86", gates: "The first chant with `@intentius/chant/ci-image`: `productImageStages`, `productImageDockerfile` and `derivedImageDockerfile` for a product's CI image, and `ciToolFetchScript`, `ciToolInstallLine` and `installCiTool`, the digest-checked engine installs, with the terraform lexicon's `choudoufuInstallLine` checked the same way (#4784).", issue: "#4784", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
151
161
  { name: "DRIFT_ISSUE_FLOOR", version: "0.124.86", gates: "The first chant with `@intentius/chant/drift-issue`, whose `keepDriftIssue` keeps one drift issue per environment from a product's words and the drift records (#4790).", issue: "#4790", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
@@ -193,23 +203,27 @@ export const FLOOR_ROWS = [
193
203
  { name: "CHECK_SUMMARY_FLOOR", version: "0.124.88", gates: "The first chant whose `chant ci check` takes `--summary <file>` and whose `checkReportSummary` renders the check report's markdown section, so a product's check step runs chant's check stage and keeps the section in its own report (#4914).", issue: "#4914", file: "release-floors.ts", modules: ["@intentius/chant/components/check-hooks", "@intentius/chant/release-floors"] },
194
204
  { name: "REF_GATE_STATUS_JOB_FLOOR", version: "0.124.88", gates: "The first chant whose pull request pipelines take `refGateStatus` (`--ref-gate-status`): a `ref-gate` job that runs `chant workspace ref-gate status` for the pull request's commit, and on GitLab `ref-gate status --open` for every open merge request (#4935).", issue: "#4935", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/components/pr-checks", "@intentius/chant/release-floors"] },
195
205
  { name: "REF_GATE_PIECES_FLOOR", version: "0.124.88", gates: "The first chant with `@intentius/chant/ref-gate-rules` (`refGateRulesAt`), `require` in `checkPrRequires`, `refGateStatus` in `pipelineContract` and `ci forge-check --ref-gate-status`, `@intentius/chant/ref-gate-init` (`refGateInitPlan`, `writeRefGateInit`), and a pre-receive refusal that prints the command recording the override request (#4913).", issue: "#4913", file: "release-floors.ts", modules: ["@intentius/chant/forge-check", "@intentius/chant/forge-check/index", "@intentius/chant/pr-requires", "@intentius/chant/ref-gate-init", "@intentius/chant/ref-gate-rules", "@intentius/chant/release-floors"] },
196
- { name: "RELEASE_CUT_RECORD_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `chant release cut --yes` pushes `chant/lifecycle` again when the remote refuses it, and exits non-zero untagged (`release-record-not-pushed`) when the release record never lands, so the release workflow does not push the tag (#4965).", issue: "#4965", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
197
- { name: "RELEASE_CUT_CARRIES_IMAGE_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose release cut refuses, before it records or tags, a release whose npm publish target would carry an image archive (`publish-npm-carries-image`), and whose GitLab release workflow runs the binfmt image by digest from `IMAGE_PINS` (#4941).", issue: "#4941", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
198
- { name: "CI_TOOL_NODE_DOWNLOAD_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `ciToolFetchScript` and `ciToolInstallLine` take `download: \"node\"`, a fetch and unzip with node for an image with no curl or unzip, whose `CI_TOOL_SHA256` records just 1.36.0 and act 0.2.89 and checks them against their releases' checksums files, and whose overdue check deepens a shallow checkout before it dates a pipeline file (#4952).", issue: "#4952", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
199
- { name: "RENDER_KINDS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `chant build -o <dir>/` writes a build's additional files (a docker project's Dockerfiles) into the directory with no primary file, whose `chantGenerated` renders take a `module` and its `export` (a `{ path: text }` object or a function returning one) and `chant dev render <module> <export>` writes them in place, and whose `chant ci workflow` and `chant release workflow` write into `chant dev generated-check`'s render tree with no `--output` (#4950).", issue: "#4950", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
200
- { name: "SQL_LIVE_COLUMNS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose sql lexicon's `chant lifecycle diff --live` addresses a table's columns by name (`columns[#country].default.expr`), compares a ClickHouse table's column order as `columnOrder`, and reports a column the server has and the declaration does not as pending, and whose `lexiconDriftRecords` counts a deep read's pending changes (that column, a ClickHouse or Postgres privilege granted by hand) as drift (#4944).", issue: "#4944", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
201
- { name: "DRIFT_NOTIFY_STACKS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `driftNotifyFields` takes `stacks`, each member's drift records, and from them names the drifted members and computes the run's fingerprint (#4944).", issue: "#4944", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
202
- { name: "MEMBER_SIGNED_CHECKS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose workspace member's pull request pipeline takes `evidence`, `checkJob` and `refGateStatus` (`chant build --pr-loop` in a member), signing the member's plan job as `plan:<member>` and `policy:<member>` (`ci evidence sign --member`, `memberEvidenceCheck`) and running the check job in the member's directory (#4964).", issue: "#4964", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/components/pr-checks", "@intentius/chant/release-floors"] },
203
- { name: "PRODUCT_CHECK_JOBS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `checkJob` takes `{ services, env, before, dir, args }` (`PrCheckJobOptions`: service containers, the check step's variables and lines, the report directory, the arguments after `--base`) and whose github, forgejo and gitlab lexicons render the check, check evidence and ref gate jobs for a product's own workflow (`productCheckJobs`, `forgejoProductCheckJobs`, `gitlabProductCheckJobs`) (#4964).", issue: "#4964", file: "release-floors.ts", modules: ["@intentius/chant/components/pr-checks", "@intentius/chant/release-floors"] },
204
- { name: "GITLAB_WAVE_KEY_SCOPE_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose GitLab Op waves pipeline with a runner key hands it to no wave job: each deciding wave's `<wave job>-evidence` job names the `chant-evidence` environment and signs `plan:<wave>` from the wave job (#4964).", issue: "#4964", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/release-floors"] },
205
- { name: "ACTOR_ORDER_FLOOR", version: NEXT_RELEASE, gates: "The first chant with `actorOf` and `actorOrder` in `@intentius/chant/actor`: the actor fallback with `GITHUB_TRIGGERING_ACTOR` ahead of the forge's actor and git's `user.name` before the login, each place switched on or off by the caller (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/actor", "@intentius/chant/release-floors"] },
206
- { name: "CI_BASE_REF_FLOOR", version: NEXT_RELEASE, gates: "The first chant with `@intentius/chant/ci-base` (`ciBaseRef`), the base a CI job measures a change from (the pull request's target branch, else the default branch for a push to another branch), and whose `chant ci check` defaults `--base` to it (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/ci-base", "@intentius/chant/release-floors"] },
207
- { name: "PLANNED_FILES_FLOOR", version: NEXT_RELEASE, gates: "The first chant with `@intentius/chant/planned-files` (`planFile`, `planRemoval`, `writePlannedFiles`, `staleGeneratedFiles`): an init's planned files with their modes, written or removed in one call, and the generated files a product no longer renders, found by their header (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/planned-files", "@intentius/chant/release-floors"] },
208
- { name: "FORGE_CHECK_OWN_JOBS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `pipelineContract` takes `jobs`, the jobs a product builds from its own config, beside or in place of `pipelines`, so a product's forge check gets the required statuses and `refGateStatus` from chant (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/forge-check", "@intentius/chant/forge-check/index", "@intentius/chant/release-floors"] },
209
- { name: "BEFORE_MERGE_REF_GATE_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `chant components pr-apply --before-merge` waits for the ref gate's status: the status the policy at base sets for the target branch is passed as `require` to the `checks` require (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
210
- { name: "TARGET_SIGNED_CHECKS_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose product plan with `targets` and `evidence` signs each target's plan job as `plan:<target>` and `policy:<target>` (`ci evidence sign --member <target>`, `targetEvidenceCheck`, `productPlanEvidenceChecks`), and whose `refGateInitPlan` takes `targets` and names those checks in the `refs` rule (#4978).", issue: "#4978", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/ref-gate-init", "@intentius/chant/release-floors"] },
211
- { name: "RUNTIME_WAVES_SPEC_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose Op waves generators take `renderSpec` (the wave jobs run `chant run wave --render-spec`, and `CHANT_WAVES_SPEC_COMMAND` names the product command that prints the spec at the commit in `CHANT_WAVES_SPEC_AT`), so a product whose spec is built from its config at base renders its wave jobs, policy step, evidence job and cloud trade through chant (#4982).", issue: "#4982", file: "release-floors.ts", modules: ["@intentius/chant/op", "@intentius/chant/op/index", "@intentius/chant/op/op-waves-render-spec", "@intentius/chant/release-floors"] },
212
- { name: "GITLAB_WAVE_EVIDENCE_RETRY_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `chant run resume` (`resumeGateRun`) on GitLab retries a wave job's `<wave job>-evidence` with the wave job when the evidence job already ran, and whose `ci evidence sign --from-job` waits for a job it reads to finish, so a resumed wave's evidence job signs from the new try (#4978).", issue: "#4978", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/release-floors"] },
206
+ { name: "RELEASE_CUT_RECORD_FLOOR", version: "0.124.89", gates: "The first chant whose `chant release cut --yes` pushes `chant/lifecycle` again when the remote refuses it, and exits non-zero untagged (`release-record-not-pushed`) when the release record never lands, so the release workflow does not push the tag (#4965).", issue: "#4965", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
207
+ { name: "RELEASE_CUT_CARRIES_IMAGE_FLOOR", version: "0.124.89", gates: "The first chant whose release cut refuses, before it records or tags, a release whose npm publish target would carry an image archive (`publish-npm-carries-image`), and whose GitLab release workflow runs the binfmt image by digest from `IMAGE_PINS` (#4941).", issue: "#4941", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
208
+ { name: "CI_TOOL_NODE_DOWNLOAD_FLOOR", version: "0.124.89", gates: "The first chant whose `ciToolFetchScript` and `ciToolInstallLine` take `download: \"node\"`, a fetch and unzip with node for an image with no curl or unzip, whose `CI_TOOL_SHA256` records just 1.36.0 and act 0.2.89 and checks them against their releases' checksums files, and whose overdue check deepens a shallow checkout before it dates a pipeline file (#4952).", issue: "#4952", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
209
+ { name: "RENDER_KINDS_FLOOR", version: "0.124.89", gates: "The first chant whose `chant build -o <dir>/` writes a build's additional files (a docker project's Dockerfiles) into the directory with no primary file, whose `chantGenerated` renders take a `module` and its `export` (a `{ path: text }` object or a function returning one) and `chant dev render <module> <export>` writes them in place, and whose `chant ci workflow` and `chant release workflow` write into `chant dev generated-check`'s render tree with no `--output` (#4950).", issue: "#4950", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
210
+ { name: "SQL_LIVE_COLUMNS_FLOOR", version: "0.124.89", gates: "The first chant whose sql lexicon's `chant lifecycle diff --live` addresses a table's columns by name (`columns[#country].default.expr`), compares a ClickHouse table's column order as `columnOrder`, and reports a column the server has and the declaration does not as pending, and whose `lexiconDriftRecords` counts a deep read's pending changes (that column, a ClickHouse or Postgres privilege granted by hand) as drift (#4944).", issue: "#4944", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
211
+ { name: "DRIFT_NOTIFY_STACKS_FLOOR", version: "0.124.89", gates: "The first chant whose `driftNotifyFields` takes `stacks`, each member's drift records, and from them names the drifted members and computes the run's fingerprint (#4944).", issue: "#4944", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
212
+ { name: "MEMBER_SIGNED_CHECKS_FLOOR", version: "0.124.89", gates: "The first chant whose workspace member's pull request pipeline takes `evidence`, `checkJob` and `refGateStatus` (`chant build --pr-loop` in a member), signing the member's plan job as `plan:<member>` and `policy:<member>` (`ci evidence sign --member`, `memberEvidenceCheck`) and running the check job in the member's directory (#4964).", issue: "#4964", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/components/pr-checks", "@intentius/chant/release-floors"] },
213
+ { name: "PRODUCT_CHECK_JOBS_FLOOR", version: "0.124.89", gates: "The first chant whose `checkJob` takes `{ services, env, before, dir, args }` (`PrCheckJobOptions`: service containers, the check step's variables and lines, the report directory, the arguments after `--base`) and whose github, forgejo and gitlab lexicons render the check, check evidence and ref gate jobs for a product's own workflow (`productCheckJobs`, `forgejoProductCheckJobs`, `gitlabProductCheckJobs`) (#4964).", issue: "#4964", file: "release-floors.ts", modules: ["@intentius/chant/components/pr-checks", "@intentius/chant/release-floors"] },
214
+ { name: "CHECK_JOB_ARTIFACTS_FLOOR", version: "0.124.90", gates: "The first chant whose `checkJob` takes `artifacts: { paths, reports }` (`PrCheckArtifacts`), which GitLab's check job keeps beside its report as `artifacts:paths` and `artifacts:reports`, such as a lint hook's `codequality` report (#4988).", issue: "#4988", file: "release-floors.ts", modules: ["@intentius/chant/components/pr-checks", "@intentius/chant/release-floors"] },
215
+ { name: "GITLAB_WAVE_KEY_SCOPE_FLOOR", version: "0.124.89", gates: "The first chant whose GitLab Op waves pipeline with a runner key hands it to no wave job: each deciding wave's `<wave job>-evidence` job names the `chant-evidence` environment and signs `plan:<wave>` from the wave job (#4964).", issue: "#4964", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/release-floors"] },
216
+ { name: "ACTOR_ORDER_FLOOR", version: "0.124.89", gates: "The first chant with `actorOf` and `actorOrder` in `@intentius/chant/actor`: the actor fallback with `GITHUB_TRIGGERING_ACTOR` ahead of the forge's actor and git's `user.name` before the login, each place switched on or off by the caller (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/actor", "@intentius/chant/release-floors"] },
217
+ { name: "ACTOR_GIT_ENV_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `actorOf({ env, repo })` runs `git config` in `repo` with the `env` it is given rather than the process's, so a job's `GIT_CONFIG_GLOBAL` or `HOME` picks the `user.name` it reads (#5005).", issue: "#5005", file: "release-floors.ts", modules: ["@intentius/chant/actor", "@intentius/chant/release-floors"] },
218
+ { name: "CI_BASE_REF_FLOOR", version: "0.124.89", gates: "The first chant with `@intentius/chant/ci-base` (`ciBaseRef`), the base a CI job measures a change from (the pull request's target branch, else the default branch for a push to another branch), and whose `chant ci check` defaults `--base` to it (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/ci-base", "@intentius/chant/release-floors"] },
219
+ { name: "PLANNED_FILES_FLOOR", version: "0.124.89", gates: "The first chant with `@intentius/chant/planned-files` (`planFile`, `planRemoval`, `writePlannedFiles`, `staleGeneratedFiles`): an init's planned files with their modes, written or removed in one call, and the generated files a product no longer renders, found by their header (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/planned-files", "@intentius/chant/release-floors"] },
220
+ { name: "PLANNED_BYTES_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose `planFile` in `@intentius/chant/planned-files` takes bytes (`Uint8Array` or `Buffer`) as well as text: `writePlannedFiles` writes them unchanged and the plan compares them with the file byte for byte (#5006).", issue: "#5006", file: "release-floors.ts", modules: ["@intentius/chant/planned-files", "@intentius/chant/release-floors"] },
221
+ { name: "FORGE_CHECK_OWN_JOBS_FLOOR", version: "0.124.89", gates: "The first chant whose `pipelineContract` takes `jobs`, the jobs a product builds from its own config, beside or in place of `pipelines`, so a product's forge check gets the required statuses and `refGateStatus` from chant (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/forge-check", "@intentius/chant/forge-check/index", "@intentius/chant/release-floors"] },
222
+ { name: "BEFORE_MERGE_REF_GATE_FLOOR", version: "0.124.89", gates: "The first chant whose `chant components pr-apply --before-merge` waits for the ref gate's status: the status the policy at base sets for the target branch is passed as `require` to the `checks` require (#4966).", issue: "#4966", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
223
+ { name: "TARGET_SIGNED_CHECKS_FLOOR", version: "0.124.89", gates: "The first chant whose product plan with `targets` and `evidence` signs each target's plan job as `plan:<target>` and `policy:<target>` (`ci evidence sign --member <target>`, `targetEvidenceCheck`, `productPlanEvidenceChecks`), and whose `refGateInitPlan` takes `targets` and names those checks in the `refs` rule (#4978).", issue: "#4978", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/ref-gate-init", "@intentius/chant/release-floors"] },
224
+ { name: "RUNTIME_WAVES_SPEC_FLOOR", version: "0.124.89", gates: "The first chant whose Op waves generators take `renderSpec` (the wave jobs run `chant run wave --render-spec`, and `CHANT_WAVES_SPEC_COMMAND` names the product command that prints the spec at the commit in `CHANT_WAVES_SPEC_AT`), so a product whose spec is built from its config at base renders its wave jobs, policy step, evidence job and cloud trade through chant (#4982).", issue: "#4982", file: "release-floors.ts", modules: ["@intentius/chant/op", "@intentius/chant/op/index", "@intentius/chant/op/op-waves-render-spec", "@intentius/chant/release-floors"] },
225
+ { name: "GITLAB_WAVE_EVIDENCE_RETRY_FLOOR", version: "0.124.89", gates: "The first chant whose `chant run resume` (`resumeGateRun`) on GitLab retries a wave job's `<wave job>-evidence` with the wave job when the evidence job already ran, and whose `ci evidence sign --from-job` waits for a job it reads to finish, so a resumed wave's evidence job signs from the new try (#4978).", issue: "#4978", file: "release-floors.ts", modules: ["@intentius/chant/ci-evidence-jobs", "@intentius/chant/release-floors"] },
226
+ { name: "TERRAFORM_COMMAND_TRACE_FLOOR", version: NEXT_RELEASE, gates: "The first chant whose terraform lexicon's engine runs carry what a product's own command tracing read: `runBinary` and the engine runner's `exec` and `execSync` answer stderr apart (`Ran.stderr`) and a spawn failure's message (`Ran.error`), a hook's `after` gets a binary that could not be started as a null code with `error`, `commandTrace` ends that span with the message, and `composeCommandHooks` runs a product's own hook and `commandTrace` as one `onCommand` (#5007).", issue: "#5007", file: "release-floors.ts", modules: ["@intentius/chant/release-floors"] },
213
227
  { name: "RUN_EVENT_FLOOR", version: "0.124.28", gates: "The first chant that writes contract version 1 of the run-event stream.", file: "run-event.ts", modules: ["@intentius/chant", "@intentius/chant/index", "@intentius/chant/run-event"] },
214
228
  { name: "RUN_EVENT_FAILURE_FLOOR", version: "0.124.30", gates: "The first chant that writes `failure` on `run-settle` (#4094).", issue: "#4094", file: "run-event.ts", modules: ["@intentius/chant", "@intentius/chant/index", "@intentius/chant/run-event"] },
215
229
  { name: "RUN_EVENT_COMPONENT_SKIP_FLOOR", version: "0.124.29", gates: "The first chant that writes `blocked`, `already-applied` and `blockedBy` on `component-settle` (#4007).", issue: "#4007", file: "run-event.ts", modules: ["@intentius/chant", "@intentius/chant/index", "@intentius/chant/run-event"] },
@@ -122,6 +122,8 @@ export declare function lexiconPackagesToInstall(names: readonly string[], paths
122
122
  * path, which is not a package.
123
123
  */
124
124
  export declare function packageNameOf(spec: string): string | undefined;
125
+ /** True when `err` says the package `pkg` itself could not be found, not something it imports. */
126
+ export declare function isPackageNotFound(err: unknown, pkg: string): boolean;
125
127
  /**
126
128
  * chant#2845 — resolve `spec` (a lexicon package or one of its subpaths) from
127
129
  * `fromDir` instead of from chant's own install, or `undefined` when the
@@ -1 +1 @@
1
- {"version":3,"file":"lexicon-module.d.ts","sourceRoot":"","sources":["../src/lexicon-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AASH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,mEAAmE;AACnE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAExE;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,EAAE,CAAC;AAC/E,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;AAiBvG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACxC,OAAO,EAAE,MAAM,EACf,SAAS,SAAM,GACd;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAgBrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,SAAS,EAClD,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBxB;AAMD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAM3G;AAED,2DAA2D;AAC3D,wBAAgB,sBAAsB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAE5D;AAED,sGAAsG;AACtG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElE;AAED,6CAA6C;AAC7C,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACrC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAa9C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAsB,EAC/B,KAAK,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAe,GAC/C,MAAM,CAKR;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,KAAK,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAe,GAC/C,MAAM,EAAE,CAEV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9D;AAUD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,MAAM,GAAG,SAAS,CAMpG;AAcD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqB1H"}
1
+ {"version":3,"file":"lexicon-module.d.ts","sourceRoot":"","sources":["../src/lexicon-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AASH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,mEAAmE;AACnE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAExE;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,EAAE,CAAC;AAC/E,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;AAiBvG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACxC,OAAO,EAAE,MAAM,EACf,SAAS,SAAM,GACd;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAgBrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,SAAS,EAClD,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBxB;AAMD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAM3G;AAED,2DAA2D;AAC3D,wBAAgB,sBAAsB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAE5D;AAED,sGAAsG;AACtG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElE;AAED,6CAA6C;AAC7C,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACrC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAa9C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAsB,EAC/B,KAAK,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAe,GAC/C,MAAM,CAKR;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,KAAK,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAe,GAC/C,MAAM,EAAE,CAEV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9D;AAED,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CASpE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,MAAM,GAAG,SAAS,CAMpG;AAcD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqB1H"}
@@ -206,12 +206,16 @@ export function packageNameOf(spec) {
206
206
  return spec.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
207
207
  }
208
208
  /** True when `err` says the package `pkg` itself could not be found, not something it imports. */
209
- function isPackageNotFound(err, pkg) {
209
+ export function isPackageNotFound(err, pkg) {
210
210
  const code = err?.code;
211
211
  if (code !== "ERR_MODULE_NOT_FOUND" && code !== "MODULE_NOT_FOUND")
212
212
  return false;
213
213
  const message = err instanceof Error ? err.message : String(err);
214
- return message.includes(`'${pkg}'`) || message.includes(`"${pkg}"`) || message.includes(`${pkg}/`);
214
+ // The specifier itself is quoted: `'pkg'`, or `'pkg/sub'` for a subpath.
215
+ // chant#4881 — a file missing inside an installed package is named by its
216
+ // path (`'/…/node_modules/pkg/generated/index.js'`), which is not quoted at
217
+ // the package name, so it doesn't count as the package being missing.
218
+ return [`'${pkg}'`, `"${pkg}"`, `'${pkg}/`, `"${pkg}/`].some((quoted) => message.includes(quoted));
215
219
  }
216
220
  /**
217
221
  * chant#2845 — resolve `spec` (a lexicon package or one of its subpaths) from