@intentius/chant 0.124.87 → 0.124.88

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 (342) hide show
  1. package/dist/action-pins.d.ts +1 -0
  2. package/dist/action-pins.d.ts.map +1 -1
  3. package/dist/action-pins.js +2 -0
  4. package/dist/actor.d.ts +12 -0
  5. package/dist/actor.d.ts.map +1 -0
  6. package/dist/actor.js +18 -0
  7. package/dist/bundle-check.d.ts +20 -5
  8. package/dist/bundle-check.d.ts.map +1 -1
  9. package/dist/bundle-check.js +20 -5
  10. package/dist/chant-install.d.ts +98 -0
  11. package/dist/chant-install.d.ts.map +1 -1
  12. package/dist/chant-install.js +204 -2
  13. package/dist/ci-commit.d.ts +1 -1
  14. package/dist/ci-commit.d.ts.map +1 -1
  15. package/dist/ci-commit.js +1 -2
  16. package/dist/ci-control.d.ts +1 -1
  17. package/dist/ci-control.d.ts.map +1 -1
  18. package/dist/ci-control.js +1 -1
  19. package/dist/ci-evidence-claims.d.ts +59 -0
  20. package/dist/ci-evidence-claims.d.ts.map +1 -0
  21. package/dist/ci-evidence-claims.js +87 -0
  22. package/dist/ci-evidence-from-job.d.ts +103 -0
  23. package/dist/ci-evidence-from-job.d.ts.map +1 -0
  24. package/dist/ci-evidence-from-job.js +162 -0
  25. package/dist/ci-evidence-jobs.d.ts +39 -4
  26. package/dist/ci-evidence-jobs.d.ts.map +1 -1
  27. package/dist/ci-evidence-jobs.js +38 -4
  28. package/dist/ci-handover.d.ts +12 -0
  29. package/dist/ci-handover.d.ts.map +1 -1
  30. package/dist/ci-handover.js +15 -3
  31. package/dist/ci-identity.d.ts +32 -6
  32. package/dist/ci-identity.d.ts.map +1 -1
  33. package/dist/ci-identity.js +40 -8
  34. package/dist/ci-image.d.ts +47 -9
  35. package/dist/ci-image.d.ts.map +1 -1
  36. package/dist/ci-image.js +45 -18
  37. package/dist/ci-jobs.d.ts +1 -1
  38. package/dist/ci-jobs.d.ts.map +1 -1
  39. package/dist/ci-jobs.js +7 -2
  40. package/dist/ci-login.d.ts +75 -13
  41. package/dist/ci-login.d.ts.map +1 -1
  42. package/dist/ci-login.js +89 -37
  43. package/dist/ci-product-words.d.ts +20 -1
  44. package/dist/ci-product-words.d.ts.map +1 -1
  45. package/dist/ci-product-words.js +27 -1
  46. package/dist/ci-product.d.ts +21 -2
  47. package/dist/ci-product.d.ts.map +1 -1
  48. package/dist/ci-product.js +21 -2
  49. package/dist/cli/handlers/approve-confirm.d.ts +14 -0
  50. package/dist/cli/handlers/approve-confirm.d.ts.map +1 -1
  51. package/dist/cli/handlers/approve-confirm.js +46 -0
  52. package/dist/cli/handlers/build.d.ts +1 -1
  53. package/dist/cli/handlers/build.d.ts.map +1 -1
  54. package/dist/cli/handlers/build.js +22 -1
  55. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  56. package/dist/cli/handlers/ci-check.js +21 -1
  57. package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
  58. package/dist/cli/handlers/ci-evidence.js +227 -18
  59. package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -1
  60. package/dist/cli/handlers/ci-forge-check.js +34 -17
  61. package/dist/cli/handlers/generated-check.d.ts +3 -0
  62. package/dist/cli/handlers/generated-check.d.ts.map +1 -0
  63. package/dist/cli/handlers/generated-check.js +41 -0
  64. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  65. package/dist/cli/handlers/lifecycle.js +3 -0
  66. package/dist/cli/handlers/local-chant.d.ts +13 -0
  67. package/dist/cli/handlers/local-chant.d.ts.map +1 -1
  68. package/dist/cli/handlers/local-chant.js +42 -1
  69. package/dist/cli/handlers/pr.d.ts.map +1 -1
  70. package/dist/cli/handlers/pr.js +42 -5
  71. package/dist/cli/handlers/run-wave.js +8 -0
  72. package/dist/cli/main.d.ts.map +1 -1
  73. package/dist/cli/main.js +38 -4
  74. package/dist/cli/parse-args.d.ts.map +1 -1
  75. package/dist/cli/parse-args.js +66 -0
  76. package/dist/cli/registry.d.ts +24 -0
  77. package/dist/cli/registry.d.ts.map +1 -1
  78. package/dist/components/check-hooks.d.ts +10 -0
  79. package/dist/components/check-hooks.d.ts.map +1 -1
  80. package/dist/components/check-hooks.js +18 -0
  81. package/dist/components/pr-checks.d.ts +105 -0
  82. package/dist/components/pr-checks.d.ts.map +1 -0
  83. package/dist/components/pr-checks.js +119 -0
  84. package/dist/components/pr-pipeline.d.ts +34 -0
  85. package/dist/components/pr-pipeline.d.ts.map +1 -1
  86. package/dist/components/pr-pipeline.js +14 -1
  87. package/dist/components/product-pipeline.d.ts +16 -1
  88. package/dist/components/product-pipeline.d.ts.map +1 -1
  89. package/dist/components/product-pipeline.js +17 -2
  90. package/dist/components/product-plan.d.ts +257 -4
  91. package/dist/components/product-plan.d.ts.map +1 -1
  92. package/dist/components/product-plan.js +241 -11
  93. package/dist/config.d.ts +10 -6
  94. package/dist/config.d.ts.map +1 -1
  95. package/dist/config.js +11 -6
  96. package/dist/control/consumers.d.ts +6 -0
  97. package/dist/control/consumers.d.ts.map +1 -1
  98. package/dist/control/consumers.js +6 -0
  99. package/dist/dead-guards.d.ts.map +1 -1
  100. package/dist/dead-guards.js +9 -6
  101. package/dist/discovery/files.d.ts +1 -1
  102. package/dist/discovery/files.js +1 -1
  103. package/dist/drift-issue.d.ts +20 -3
  104. package/dist/drift-issue.d.ts.map +1 -1
  105. package/dist/drift-issue.js +16 -0
  106. package/dist/drift-record.d.ts +45 -5
  107. package/dist/drift-record.d.ts.map +1 -1
  108. package/dist/drift-record.js +27 -6
  109. package/dist/floor-table.d.ts +6 -6
  110. package/dist/floor-table.d.ts.map +1 -1
  111. package/dist/floor-table.data.d.ts.map +1 -1
  112. package/dist/floor-table.data.js +58 -21
  113. package/dist/floor-table.js +10 -7
  114. package/dist/forge-check/contract.d.ts +8 -0
  115. package/dist/forge-check/contract.d.ts.map +1 -1
  116. package/dist/forge-check/contract.js +4 -1
  117. package/dist/forge-check/index.d.ts +2 -0
  118. package/dist/forge-check/index.d.ts.map +1 -1
  119. package/dist/forge-check/index.js +2 -0
  120. package/dist/forge-flags.d.ts +10 -0
  121. package/dist/forge-flags.d.ts.map +1 -1
  122. package/dist/forge-flags.js +31 -0
  123. package/dist/forge-remote.d.ts +47 -0
  124. package/dist/forge-remote.d.ts.map +1 -0
  125. package/dist/forge-remote.js +69 -0
  126. package/dist/generated-check.d.ts +74 -0
  127. package/dist/generated-check.d.ts.map +1 -0
  128. package/dist/generated-check.js +216 -0
  129. package/dist/lexicon.d.ts +16 -0
  130. package/dist/lexicon.d.ts.map +1 -1
  131. package/dist/lifecycle/publish-npm.d.ts +15 -0
  132. package/dist/lifecycle/publish-npm.d.ts.map +1 -1
  133. package/dist/lifecycle/publish-npm.js +49 -3
  134. package/dist/lifecycle/release-images.d.ts +22 -1
  135. package/dist/lifecycle/release-images.d.ts.map +1 -1
  136. package/dist/lifecycle/release-images.js +27 -3
  137. package/dist/lifecycle/release-ledger.d.ts +4 -3
  138. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  139. package/dist/lifecycle/release-ledger.js +3 -2
  140. package/dist/local-chant.d.ts +57 -3
  141. package/dist/local-chant.d.ts.map +1 -1
  142. package/dist/local-chant.js +122 -13
  143. package/dist/op/op-waves-evidence-jobs.d.ts +92 -0
  144. package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -0
  145. package/dist/op/op-waves-evidence-jobs.js +112 -0
  146. package/dist/op/op-waves-evidence.d.ts +12 -1
  147. package/dist/op/op-waves-evidence.d.ts.map +1 -1
  148. package/dist/op/op-waves-evidence.js +23 -2
  149. package/dist/op/op-waves-run.d.ts +12 -1
  150. package/dist/op/op-waves-run.d.ts.map +1 -1
  151. package/dist/op/op-waves-run.js +54 -3
  152. package/dist/op/op-waves.d.ts +8 -0
  153. package/dist/op/op-waves.d.ts.map +1 -1
  154. package/dist/op/op-waves.js +10 -0
  155. package/dist/op/schedule-overdue.d.ts +39 -2
  156. package/dist/op/schedule-overdue.d.ts.map +1 -1
  157. package/dist/op/schedule-overdue.js +89 -7
  158. package/dist/pr-forge-reads.d.ts +21 -1
  159. package/dist/pr-forge-reads.d.ts.map +1 -1
  160. package/dist/pr-forge-reads.js +19 -1
  161. package/dist/pr-forge.d.ts +7 -1
  162. package/dist/pr-forge.d.ts.map +1 -1
  163. package/dist/pr-forge.js +7 -2
  164. package/dist/pr-plan-note.d.ts +24 -0
  165. package/dist/pr-plan-note.d.ts.map +1 -1
  166. package/dist/pr-plan-note.js +11 -1
  167. package/dist/pr-plan-record.d.ts +47 -0
  168. package/dist/pr-plan-record.d.ts.map +1 -0
  169. package/dist/pr-plan-record.js +89 -0
  170. package/dist/pr-post.d.ts +40 -0
  171. package/dist/pr-post.d.ts.map +1 -1
  172. package/dist/pr-post.js +79 -6
  173. package/dist/pr-requires.d.ts +8 -0
  174. package/dist/pr-requires.d.ts.map +1 -1
  175. package/dist/pr-requires.js +3 -1
  176. package/dist/ref-gate-init.d.ts +76 -0
  177. package/dist/ref-gate-init.d.ts.map +1 -0
  178. package/dist/ref-gate-init.js +144 -0
  179. package/dist/ref-gate-rules.d.ts +19 -0
  180. package/dist/ref-gate-rules.d.ts.map +1 -0
  181. package/dist/ref-gate-rules.js +17 -0
  182. package/dist/release-floors.d.ts +64 -16
  183. package/dist/release-floors.d.ts.map +1 -1
  184. package/dist/release-floors.js +65 -17
  185. package/dist/state-migration.d.ts +24 -1
  186. package/dist/state-migration.d.ts.map +1 -1
  187. package/dist/state-migration.js +39 -3
  188. package/dist/state-unlock.d.ts +32 -1
  189. package/dist/state-unlock.d.ts.map +1 -1
  190. package/dist/state-unlock.js +31 -0
  191. package/dist/wave-runtime.mjs +292 -285
  192. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  193. package/dist/workspace/ci-green-cli.js +13 -7
  194. package/dist/workspace/drift-cli.d.ts +1 -1
  195. package/dist/workspace/drift-cli.d.ts.map +1 -1
  196. package/dist/workspace/drift-cli.js +5 -12
  197. package/dist/workspace/forge-work.d.ts +3 -2
  198. package/dist/workspace/forge-work.d.ts.map +1 -1
  199. package/dist/workspace/forge-work.js +7 -17
  200. package/dist/workspace/lexicon-outputs.js +2 -2
  201. package/dist/workspace/release-workflow.d.ts +26 -3
  202. package/dist/workspace/release-workflow.d.ts.map +1 -1
  203. package/dist/workspace/release-workflow.js +48 -6
  204. package/dist/workspace/trust/check-evidence-report.d.ts +18 -0
  205. package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
  206. package/dist/workspace/trust/check-evidence-report.js +13 -0
  207. package/dist/workspace/trust/check-evidence.d.ts +13 -1
  208. package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
  209. package/dist/workspace/trust/check-evidence.js +8 -3
  210. package/dist/workspace/trust/evidence.d.ts +5 -0
  211. package/dist/workspace/trust/evidence.d.ts.map +1 -1
  212. package/dist/workspace/trust/evidence.js +5 -0
  213. package/dist/workspace/trust/open-evidence.d.ts +67 -0
  214. package/dist/workspace/trust/open-evidence.d.ts.map +1 -0
  215. package/dist/workspace/trust/open-evidence.js +92 -0
  216. package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
  217. package/dist/workspace/trust/ref-gate-cli.js +65 -3
  218. package/dist/workspace/trust/ref-gate.d.ts +61 -2
  219. package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
  220. package/dist/workspace/trust/ref-gate.js +72 -7
  221. package/package.json +1 -1
  222. package/src/action-pins.ts +2 -0
  223. package/src/actor.test.ts +12 -0
  224. package/src/actor.ts +19 -0
  225. package/src/bundle-check.test.ts +22 -0
  226. package/src/bundle-check.ts +33 -5
  227. package/src/chant-install.test.ts +109 -1
  228. package/src/chant-install.ts +243 -2
  229. package/src/ci-commit.test.ts +51 -5
  230. package/src/ci-commit.ts +1 -2
  231. package/src/ci-control.ts +1 -0
  232. package/src/ci-evidence-claims.ts +102 -0
  233. package/src/ci-evidence-from-job.test.ts +147 -0
  234. package/src/ci-evidence-from-job.ts +195 -0
  235. package/src/ci-evidence-jobs.ts +41 -4
  236. package/src/ci-handover.ts +16 -3
  237. package/src/ci-identity.test.ts +3 -3
  238. package/src/ci-identity.ts +51 -11
  239. package/src/ci-image.test.ts +60 -10
  240. package/src/ci-image.ts +78 -19
  241. package/src/ci-jobs.ts +7 -2
  242. package/src/ci-login.test.ts +131 -3
  243. package/src/ci-login.token-drop.test.ts +204 -0
  244. package/src/ci-login.ts +137 -39
  245. package/src/ci-product-words.ts +30 -0
  246. package/src/ci-product.ts +26 -1
  247. package/src/cli/commands/__fixtures__/source-dir-root/migrations/0001-init/backfill.ts +3 -0
  248. package/src/cli/handlers/approve-confirm.test.ts +35 -0
  249. package/src/cli/handlers/approve-confirm.ts +44 -0
  250. package/src/cli/handlers/build-source-dir.test.ts +4 -0
  251. package/src/cli/handlers/build.ts +20 -2
  252. package/src/cli/handlers/ci-check.ts +19 -1
  253. package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
  254. package/src/cli/handlers/ci-evidence.ts +210 -16
  255. package/src/cli/handlers/ci-forge-check.ts +22 -9
  256. package/src/cli/handlers/generated-check.ts +39 -0
  257. package/src/cli/handlers/lifecycle.test.ts +20 -0
  258. package/src/cli/handlers/lifecycle.ts +4 -0
  259. package/src/cli/handlers/local-chant.ts +39 -1
  260. package/src/cli/handlers/pr.ts +43 -5
  261. package/src/cli/handlers/run-wave.ts +7 -0
  262. package/src/cli/main.ts +38 -4
  263. package/src/cli/parse-args.ts +46 -0
  264. package/src/cli/registry.ts +24 -0
  265. package/src/components/check-hooks.ts +22 -0
  266. package/src/components/check-report-summary.test.ts +78 -0
  267. package/src/components/pr-checks.ts +159 -0
  268. package/src/components/pr-pipeline.ts +41 -1
  269. package/src/components/product-pipeline.ts +25 -3
  270. package/src/components/product-plan.test.ts +102 -1
  271. package/src/components/product-plan.ts +416 -15
  272. package/src/config.ts +13 -8
  273. package/src/control/consumers.ts +7 -0
  274. package/src/dead-guards.test.ts +27 -5
  275. package/src/dead-guards.ts +9 -6
  276. package/src/discovery/files.ts +1 -1
  277. package/src/drift-issue.test.ts +29 -1
  278. package/src/drift-issue.ts +28 -3
  279. package/src/drift-record.test.ts +25 -0
  280. package/src/drift-record.ts +55 -6
  281. package/src/floor-table.data.ts +58 -21
  282. package/src/floor-table.ts +12 -9
  283. package/src/forge-check/contract.ts +11 -1
  284. package/src/forge-check/forge-check.test.ts +8 -0
  285. package/src/forge-check/index.ts +2 -0
  286. package/src/forge-flags.test.ts +25 -1
  287. package/src/forge-flags.ts +34 -0
  288. package/src/forge-remote.test.ts +37 -0
  289. package/src/forge-remote.ts +79 -0
  290. package/src/generated-check.e2e.test.ts +98 -0
  291. package/src/generated-check.test.ts +104 -0
  292. package/src/generated-check.ts +269 -0
  293. package/src/lexicon.ts +17 -0
  294. package/src/lifecycle/publish-npm.ts +56 -3
  295. package/src/lifecycle/release-catalog.test.ts +2 -2
  296. package/src/lifecycle/release-images-dockerfile.test.ts +20 -0
  297. package/src/lifecycle/release-images.test.ts +44 -0
  298. package/src/lifecycle/release-images.ts +39 -3
  299. package/src/lifecycle/release-ledger.ts +4 -3
  300. package/src/local-chant.e2e.test.ts +81 -6
  301. package/src/local-chant.test.ts +22 -3
  302. package/src/local-chant.ts +130 -13
  303. package/src/op/op-waves-evidence-jobs.ts +134 -0
  304. package/src/op/op-waves-evidence.test.ts +36 -3
  305. package/src/op/op-waves-evidence.ts +23 -3
  306. package/src/op/op-waves-run.ts +57 -2
  307. package/src/op/op-waves.ts +11 -0
  308. package/src/op/schedule-overdue.test.ts +83 -1
  309. package/src/op/schedule-overdue.ts +107 -9
  310. package/src/pr-forge-reads-compare.test.ts +2 -1
  311. package/src/pr-forge-reads.ts +37 -1
  312. package/src/pr-forge.ts +14 -3
  313. package/src/pr-plan-note.ts +32 -3
  314. package/src/pr-plan-record.test.ts +75 -0
  315. package/src/pr-plan-record.ts +101 -0
  316. package/src/pr-post-plan-note.test.ts +60 -0
  317. package/src/pr-post.test.ts +30 -0
  318. package/src/pr-post.ts +110 -6
  319. package/src/pr-requires.test.ts +20 -0
  320. package/src/pr-requires.ts +10 -1
  321. package/src/ref-gate-init.ts +189 -0
  322. package/src/ref-gate-rules.ts +26 -0
  323. package/src/release-floors.ts +86 -17
  324. package/src/state-migration-record.test.ts +90 -0
  325. package/src/state-migration.test.ts +1 -1
  326. package/src/state-migration.ts +52 -3
  327. package/src/state-unlock.test.ts +33 -1
  328. package/src/state-unlock.ts +49 -1
  329. package/src/workspace/ci-green-cli.ts +12 -6
  330. package/src/workspace/drift-cli.ts +6 -18
  331. package/src/workspace/forge-work.ts +7 -14
  332. package/src/workspace/lexicon-outputs.ts +2 -2
  333. package/src/workspace/release-workflow.test.ts +70 -0
  334. package/src/workspace/release-workflow.ts +56 -8
  335. package/src/workspace/trust/check-evidence-report.ts +24 -0
  336. package/src/workspace/trust/check-evidence.ts +17 -5
  337. package/src/workspace/trust/evidence.ts +5 -0
  338. package/src/workspace/trust/open-evidence.ts +129 -0
  339. package/src/workspace/trust/ref-gate-cli.ts +59 -3
  340. package/src/workspace/trust/ref-gate-pieces.test.ts +175 -0
  341. package/src/workspace/trust/ref-gate.e2e.test.ts +17 -0
  342. package/src/workspace/trust/ref-gate.ts +87 -6
@@ -17,7 +17,7 @@ import { NEXT_RELEASE } from "./release-floors.js";
17
17
  * note (#4573).
18
18
  */
19
19
  export const CI_PRODUCT_FLOOR = "0.124.55";
20
- export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productActionFromEnv, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, } from "./ci-product-words.js";
20
+ export { activeProductWords, approveLine, assertProductWords, CHANT_APPROVE_TEMPLATE, CHANT_NOTIFY_WAVE_TEMPLATE, CHANT_OVERRIDE_TEMPLATE, CHANT_WORDS, CI_PRODUCT_APPLY_MODES, CI_PRODUCT_COMMANDS, CI_PRODUCT_STAGES, CiProductWordsError, commandWord, commentLine, commitWordOf, isChantWords, notifyWaveLabel, overrideLine, parseProductComment, productActionFromEnv, PRODUCT_ACTION_ENV, PRODUCT_ACTION_EVENT_FLAG, productContext, productStatusContext, productWaveGate, productWordsProblems, resolveProductWords, setActiveProductWords, withProductWords, } from "./ci-product-words.js";
21
21
  export { driftNotifyFields, NOTIFY_MESSAGE_WORDS_FLOOR, productNotifySource, productNotifyWords, productSendOptions } from "./notify-product.js";
22
22
  /** The first chant with `chant notify relay` and the notify relay buttons (#4611). */
23
23
  export const NOTIFY_RELAY_FLOOR = "0.124.55";
@@ -44,9 +44,28 @@ export { prActionJob, PR_ACTION_JOB, prApplyComment, prCommentLockJobs, prCommen
44
44
  * `components/product-plan-pipeline`. A product feature-detects on this
45
45
  * floor.
46
46
  */
47
- export const PRODUCT_PLAN_FLOOR = NEXT_RELEASE;
47
+ export const PRODUCT_PLAN_FLOOR = "0.124.86";
48
48
  export { productPlanJobs, PR_PLAN_NOTE_WORDS_ENV } from "./components/product-plan.js";
49
49
  export { planNoteHandoff, PR_PLAN_NOTE_FILE } from "./pr-plan-note.js";
50
+ /**
51
+ * 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.
52
+ */
53
+ export const PRODUCT_PLAN_STEPS_FLOOR = NEXT_RELEASE;
54
+ export { PLAN_ARGUMENT_ENV, PLAN_NOTE_NOTICES_ENV } from "./components/product-plan.js";
55
+ /**
56
+ * 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.
57
+ */
58
+ export const COMMENT_LEAVES_COMMIT_FLOOR = NEXT_RELEASE;
59
+ /**
60
+ * 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`.
61
+ */
62
+ export const PRODUCT_PLAN_WATCHES_FLOOR = NEXT_RELEASE;
63
+ export { PLAN_WATCHES_ENV } from "./op/schedule-overdue.js";
64
+ /**
65
+ * 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.
66
+ */
67
+ export const PRODUCT_PLAN_RECORD_FLOOR = NEXT_RELEASE;
68
+ export { PLAN_RUN_OP, PLAN_RUN_RECORD_FILE, readPlanRunRecord } from "./pr-plan-record.js";
50
69
  /**
51
70
  * Day-2 actions in the product pipeline (#4654): the `action` comment
52
71
  * command counted as answered by the product's own workflow
@@ -22,6 +22,13 @@
22
22
  */
23
23
  import type { ParsedArgs } from "../registry.js";
24
24
  import type { PendingGateRecord } from "../../lifecycle/gate-ledger.js";
25
+ /**
26
+ * The first chant with `confirmApproval` here, the type-the-name
27
+ * confirmation a product's approve word asks through (#4575). #4916
28
+ * declared it after the fact, so `chant dev dead-guards` sees a product's
29
+ * lazy load of this subpath.
30
+ */
31
+ export declare const APPROVE_CONFIRM_FLOOR = "0.124.55";
25
32
  /** The streams the terminal check reads. `process` in the CLI; tests pass their own. */
26
33
  export interface ApprovalTerminal {
27
34
  stdin: {
@@ -81,4 +88,11 @@ export declare function approvalTarget(gate: string, standing: Pick<PendingGateR
81
88
  * ({@link interactiveApproval}).
82
89
  */
83
90
  export declare function confirmApproval(opName: string, gate: string, opts?: ConfirmApprovalOptions): Promise<ApprovalConfirmation>;
91
+ /**
92
+ * Print the attachment a gated request stored under `digest` (#4928), such
93
+ * as a state migration's roots and the product's record. JSON is printed
94
+ * indented, anything else as stored, and either is cut at
95
+ * {@link ATTACHMENT_SHOWN_BYTES} with the path of the whole. False when none is stored.
96
+ */
97
+ export declare function showAttachment(op: string, digest: string, cwd: string, out: (text: string) => void, err: (text: string) => void): Promise<boolean>;
84
98
  //# sourceMappingURL=approve-confirm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"approve-confirm.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/approve-confirm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,wFAAwF;AACxF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3B,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAAC,EACtC,QAAQ,GAAE,gBAA0B,GACnC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,qCAAqC;AACrC,MAAM,MAAM,oBAAoB;AAC9B,2HAA2H;AACzH;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE;AACvB,kEAAkE;GAChE;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACvD,6CAA6C;GAC3C;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sHAAsH;IACtH,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACnD,qDAAqD;IACrD,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,6EAA6E;IAC7E,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,2EAA2E;AAC3E,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CActE;AAQD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvI;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,sBAA2B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA0FpI"}
1
+ {"version":3,"file":"approve-confirm.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/approve-confirm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAEhD,wFAAwF;AACxF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3B,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAAC,EACtC,QAAQ,GAAE,gBAA0B,GACnC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,qCAAqC;AACrC,MAAM,MAAM,oBAAoB;AAC9B,2HAA2H;AACzH;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE;AACvB,kEAAkE;GAChE;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACvD,6CAA6C;GAC3C;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sHAAsH;IACtH,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACnD,qDAAqD;IACrD,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,6EAA6E;IAC7E,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,2EAA2E;AAC3E,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CActE;AAQD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvI;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,sBAA2B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA4FpI;AAKD;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBxJ"}
@@ -1,4 +1,11 @@
1
1
  import { CHANT_EXIT } from "../../exit-codes.js";
2
+ /**
3
+ * The first chant with `confirmApproval` here, the type-the-name
4
+ * confirmation a product's approve word asks through (#4575). #4916
5
+ * declared it after the fact, so `chant dev dead-guards` sees a product's
6
+ * lazy load of this subpath.
7
+ */
8
+ export const APPROVE_CONFIRM_FLOOR = "0.124.55";
2
9
  /**
3
10
  * Whether `chant approve` asks before recording: a person at a terminal, on
4
11
  * a shell channel, who did not pass `--yes` or `--json`.
@@ -114,6 +121,9 @@ export async function confirmApproval(opName, gate, opts = {}) {
114
121
  err(`The stored plan can't be read: ${e instanceof Error ? e.message : String(e)}\n`);
115
122
  }
116
123
  }
124
+ // #4928: a gated request's attachment (a state migration's roots and the product's record) is what its digest binds; show it.
125
+ if (!shown)
126
+ shown = await showAttachment(opName, digest, cwd, out, err);
117
127
  if (!shown) {
118
128
  err(`No plan is stored on chant/lifecycle under ${changeSet}. The run that stopped at the gate printed it; ` +
119
129
  `the digest above is what this approval binds.\n`);
@@ -140,3 +150,39 @@ export async function confirmApproval(opName, gate, opts = {}) {
140
150
  }
141
151
  return { status: "confirmed", plan: digest, target };
142
152
  }
153
+ /** The most of an attachment `chant approve` prints before it says where the rest is (#4928). */
154
+ const ATTACHMENT_SHOWN_BYTES = 64 * 1024;
155
+ /**
156
+ * Print the attachment a gated request stored under `digest` (#4928), such
157
+ * as a state migration's roots and the product's record. JSON is printed
158
+ * indented, anything else as stored, and either is cut at
159
+ * {@link ATTACHMENT_SHOWN_BYTES} with the path of the whole. False when none is stored.
160
+ */
161
+ export async function showAttachment(op, digest, cwd, out, err) {
162
+ const { gatedRequestAttachmentPath } = await import("../../lifecycle/gated-request-digest.js");
163
+ const { readBlobFromPath } = await import("../../lifecycle/git.js");
164
+ const { dir, file } = gatedRequestAttachmentPath(op, digest);
165
+ let text;
166
+ try {
167
+ text = await readBlobFromPath(dir, file, { cwd });
168
+ }
169
+ catch (e) {
170
+ err(`The request's attachment can't be read: ${e instanceof Error ? e.message : String(e)}\n`);
171
+ return false;
172
+ }
173
+ if (text === null)
174
+ return false;
175
+ let shown = text;
176
+ try {
177
+ shown = `${JSON.stringify(JSON.parse(text), null, 2)}\n`;
178
+ }
179
+ catch {
180
+ // Not JSON: shown as stored.
181
+ }
182
+ const cut = Buffer.byteLength(shown, "utf8") > ATTACHMENT_SHOWN_BYTES;
183
+ out(`The request binds ${dir}/${file}:\n`);
184
+ out(cut ? `${Buffer.from(shown, "utf8").subarray(0, ATTACHMENT_SHOWN_BYTES).toString("utf8")}\n...\n` : shown);
185
+ if (cut)
186
+ err(`The attachment is longer than ${ATTACHMENT_SHOWN_BYTES} bytes; the whole is at ${dir}/${file} on chant/lifecycle.\n`);
187
+ return true;
188
+ }
@@ -5,7 +5,7 @@ import type { CommandContext } from "../registry.js";
5
5
  * they do. Each value is refused by name, as `pr-apply` and `pr-post` refuse
6
6
  * it, so a build never writes a job that fails on its own line.
7
7
  */
8
- export declare function prLoopFlagsProblem(args: Pick<CommandContext["args"], "prLoop" | "applyBeforeMerge" | "merge" | "mergeTokenEnv" | "mergeMethod" | "respond" | "decideBackend" | "decideModel" | "targetDependents"> & Partial<Pick<CommandContext["args"], "controlRepo" | "controlSettings">>): string | undefined;
8
+ export declare function prLoopFlagsProblem(args: Pick<CommandContext["args"], "prLoop" | "applyBeforeMerge" | "merge" | "mergeTokenEnv" | "mergeMethod" | "respond" | "decideBackend" | "decideModel" | "targetDependents"> & Partial<Pick<CommandContext["args"], "controlRepo" | "controlSettings" | "evidenceRunnerKeySecret" | "evidenceIdentity" | "evidenceAudience" | "checkJob" | "refGateStatus">>): string | undefined;
9
9
  /**
10
10
  * The directory `chant build` builds (#4794). A path argument wins. With
11
11
  * none, at the root of a project, it is the one source-dir rule's
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAyGlD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,kBAAkB,GAAG,OAAO,GAAG,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,aAAa,GAAG,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,iBAAiB,CAAC,CAAC,GAAG,MAAM,GAAG,SAAS,CAgClT;AAsTD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAM3G;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwJnE"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkHlD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,kBAAkB,GAAG,OAAO,GAAG,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,aAAa,GAAG,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,iBAAiB,GAAG,yBAAyB,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,UAAU,GAAG,eAAe,CAAC,CAAC,GAAG,MAAM,GAAG,SAAS,CAyCvZ;AAsTD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAM3G;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwJnE"}
@@ -63,7 +63,11 @@ async function engineSetupFor(path) {
63
63
  * `--merge auto --merge-token-env <VAR> [--merge-method <m>]` (#4636) merges
64
64
  * the pull request after its update before merge. `--respond <list>`,
65
65
  * `--decide-backend` and `--decide-model` (#4629) set the apply and note
66
- * jobs' responses and the description check's service. {@link prLoopFlagsProblem}
66
+ * jobs' responses and the description check's service.
67
+ * `--evidence-runner-key-secret <NAME>`, or `--evidence-identity oidc` with
68
+ * `--evidence-audience` (#4935), give the loop its runner identity: the note
69
+ * job signs `plan` and `policy`. `--check-job` and `--ref-gate-status`
70
+ * (#4935) write the check job and the ref gate's status job. {@link prLoopFlagsProblem}
67
71
  * has checked all of them first.
68
72
  */
69
73
  function prLoopOption(args, reportUrl, requireReview = false, requireRunnerStart = false) {
@@ -103,6 +107,11 @@ function prLoopOption(args, reportUrl, requireReview = false, requireRunnerStart
103
107
  // #4629: the responses on the apply and note jobs, and the description check's service.
104
108
  ...(respond && Object.keys(respond).length > 0 ? { respond } : {}),
105
109
  ...(args.decideBackend && args.decideModel ? { decide: { backend: args.decideBackend, model: args.decideModel } } : {}),
110
+ // #4935: the runner identity the note job signs with, the check job and the ref gate's status job.
111
+ ...(args.evidenceRunnerKeySecret ? { evidence: { runnerKeySecret: args.evidenceRunnerKeySecret } } : {}),
112
+ ...(args.evidenceIdentity === "oidc" ? { evidence: { identity: "oidc", ...(args.evidenceAudience ? { audience: args.evidenceAudience } : {}) } } : {}),
113
+ ...(args.checkJob ? { checkJob: true } : {}),
114
+ ...(args.refGateStatus ? { refGateStatus: true } : {}),
106
115
  };
107
116
  }
108
117
  /**
@@ -113,6 +122,11 @@ function prLoopOption(args, reportUrl, requireReview = false, requireRunnerStart
113
122
  */
114
123
  export function prLoopFlagsProblem(args) {
115
124
  const given = [
125
+ ...(args.evidenceRunnerKeySecret !== undefined ? ["--evidence-runner-key-secret"] : []),
126
+ ...(args.evidenceIdentity !== undefined ? ["--evidence-identity"] : []),
127
+ ...(args.evidenceAudience !== undefined ? ["--evidence-audience"] : []),
128
+ ...(args.checkJob ? ["--check-job"] : []),
129
+ ...(args.refGateStatus ? ["--ref-gate-status"] : []),
116
130
  ...(args.controlRepo !== undefined ? ["--control"] : []),
117
131
  ...(args.controlSettings !== undefined ? ["--control-setting"] : []),
118
132
  ...(args.merge !== undefined ? ["--merge"] : []),
@@ -149,6 +163,13 @@ export function prLoopFlagsProblem(args) {
149
163
  }
150
164
  if (args.controlSettings !== undefined && args.controlRepo === undefined)
151
165
  return "--control-setting sets the control repo's settings, so it needs --control <repo>";
166
+ // #4935: one runner identity, as PipelineEvidence takes it.
167
+ if (args.evidenceRunnerKeySecret !== undefined && args.evidenceIdentity !== undefined)
168
+ return "--evidence-runner-key-secret and --evidence-identity each name the runner identity the jobs sign with; give one of them";
169
+ if (args.evidenceAudience !== undefined && args.evidenceIdentity === undefined)
170
+ return "--evidence-audience is the keyless signing token's audience, so it goes with --evidence-identity oidc";
171
+ if (args.evidenceRunnerKeySecret !== undefined && !/^[A-Za-z_][A-Za-z0-9_]*$/.test(args.evidenceRunnerKeySecret))
172
+ return `--evidence-runner-key-secret takes a secret name of letters, digits and _, not ${args.evidenceRunnerKeySecret}`;
152
173
  const respond = args.respond ? parseRespondList(args.respond) : {};
153
174
  if ("error" in respond)
154
175
  return respond.error;
@@ -1 +1 @@
1
- {"version":3,"file":"ci-check.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/ci-check.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA8DlD,wBAAsB,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BrE"}
1
+ {"version":3,"file":"ci-check.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/ci-check.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA8DlD,wBAAsB,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4CrE"}
@@ -20,6 +20,10 @@
20
20
  * is signed as local evidence instead, under `refs/notes/chant/local-evidence`.
21
21
  * Without one, a hook whose check `local.checks` at base names is skipped
22
22
  * when current local evidence for the tree stands in for it; the rest run.
23
+ *
24
+ * #4914: `--summary <file>` appends the report's markdown section
25
+ * (`checkReportSummary`) to the file, as a product's check report keeps it,
26
+ * and a job with `GITHUB_STEP_SUMMARY` set gets it in its summary too.
23
27
  */
24
28
  import { resolve } from "node:path";
25
29
  import { CHANT_EXIT } from "../../exit-codes.js";
@@ -42,7 +46,7 @@ async function lexiconCheckSteps(ctx, cwd) {
42
46
  }
43
47
  return plugins.map((p) => p.checkSteps?.()).filter((a) => a !== undefined);
44
48
  }
45
- const USAGE = "chant ci check --base <rev> [<target>...] [--output <dir>] [--no-push] [--json]";
49
+ const USAGE = "chant ci check --base <rev> [<target>...] [--output <dir>] [--summary <file>] [--no-push] [--json]";
46
50
  /**
47
51
  * The check stage's signer (#4870), when the job has a runner identity: a
48
52
  * runner key in `CHANT_RUNNER_KEY`, or its OIDC identity with
@@ -103,6 +107,22 @@ export async function runCiCheck(ctx) {
103
107
  console.error(formatError({ message: err instanceof Error ? err.message : String(err), hint: USAGE }));
104
108
  return CHANT_EXIT.failed;
105
109
  }
110
+ // #4914: the report's markdown section, in the product's own report and the job summary of a forge that keeps one.
111
+ for (const file of [...new Set([args.checkSummary, process.env.GITHUB_STEP_SUMMARY].filter((f) => Boolean(f)))]) {
112
+ const { checkReportSummary } = await import("../../components/check-hooks.js");
113
+ const lines = checkReportSummary(report);
114
+ if (lines.length === 0)
115
+ continue;
116
+ try {
117
+ const { appendFileSync, mkdirSync } = await import("node:fs");
118
+ const { dirname } = await import("node:path");
119
+ mkdirSync(dirname(resolve(file)), { recursive: true });
120
+ appendFileSync(file, `${lines.join("\n")}\n`);
121
+ }
122
+ catch (err) {
123
+ console.error(`ci check: could not write the summary to ${file}: ${err instanceof Error ? err.message : String(err)}`);
124
+ }
125
+ }
106
126
  if (args.json)
107
127
  console.log(JSON.stringify(report, null, 2));
108
128
  else if (report.status === "none")
@@ -1 +1 @@
1
- {"version":3,"file":"ci-evidence.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/ci-evidence.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA6BlD,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAWxE"}
1
+ {"version":3,"file":"ci-evidence.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/ci-evidence.ts"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA+BlD,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAWxE"}
@@ -15,6 +15,26 @@
15
15
  * deny it (a `pr-plan.json`'s `policy`, a plan note hand-off's overrides).
16
16
  * It writes `evidence.json` in `<dir>`, which `pr-post` reads to say in the
17
17
  * note which checks were signed.
18
+ * - `sign --from-report <dir>` on a check job's report (#4935), a
19
+ * `check-hooks.json` from `chant ci check`, is the `check-evidence` job's
20
+ * form: it signs each hook that passed, by name, with the runs as its
21
+ * claim, as `ci check` with a runner identity signs them. A hook skipped on
22
+ * local evidence did not pass here and is not signed. With `--result`, a
23
+ * check job that neither succeeded nor failed signs nothing.
24
+ * - `sign --open --job <job> --from-report <dir> -o <out>` (#4914) is the
25
+ * GitLab signing job's form, in a pipeline of the target branch: for each
26
+ * open merge request it reads the report from the newest pipeline's
27
+ * `<job>` artifact, fetches the head and signs it as `--from-report`
28
+ * does, skipping a check already signed for the head's tree, and keeps
29
+ * `<out>/<iid>/evidence.json` for the note job. No job of a merge request
30
+ * pipeline, which the change's own files build, holds the key.
31
+ * - `sign --from-job <job> --check-id <id>[,<id>...] [--claims <dir>]`
32
+ * (#4926) is a wave's evidence job's form: it reads the job of that name
33
+ * in this run through the forge, refuses one of another run or commit,
34
+ * and signs each check whose step (named in `CHANT_EVIDENCE_SOURCES`; on
35
+ * GitLab, whose jobs have no steps, the job) the forge reports passed and
36
+ * whose claim file in `<dir>` says so. Each statement names the run, job
37
+ * and step it relied on (`source`).
18
38
  * - `verify --check-id <id>[,<id>...]` reads the evidence for `--at`'s tree
19
39
  * and verifies it against the runner keys at `--base`; exits 1 when one
20
40
  * is not current.
@@ -27,7 +47,8 @@
27
47
  * `local.keys` at base lists, and pushes `refs/notes/chant/local-evidence`;
28
48
  * `verify --local` says whether CI would skip each check on that evidence.
29
49
  */
30
- import { readFileSync, writeFileSync } from "node:fs";
50
+ import { execFileSync, spawnSync } from "node:child_process";
51
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
31
52
  import { join } from "node:path";
32
53
  import { CHANT_EXIT } from "../../exit-codes.js";
33
54
  import { formatError } from "../format.js";
@@ -36,6 +57,8 @@ import { resolveBase } from "../../workspace/trust/provenance.js";
36
57
  import { CHECK_EVIDENCE_KEY_ENV, noRunnerIdentity, readCheckEvidence, recordChecks, RUNNER_IDENTITY_ENV, runnerEvidenceSigner, signChecks, } from "../../workspace/trust/check-evidence.js";
37
58
  import { CHECK_EVIDENCE_FILE, LOCAL_EVIDENCE_KEY_ENV, planReportChecks } from "../../workspace/trust/check-evidence-report.js";
38
59
  const USAGE = "chant ci evidence sign (--check-id <id>[,<id>...] | --from-report <dir> --result <result>) [--at <rev>] [--base <rev>] [--key <file>] [--claim <file>] [--no-push] [--json]\n" +
60
+ " chant ci evidence sign --open --job <job> --from-report <dir> -o <out> [--branch <branch>] [--base <rev>] [--key <file>] [--no-push] [--json]\n" +
61
+ " chant ci evidence sign --from-job <job> --check-id <id>[,<id>...] [--claims <dir>] [--at <rev>] [--base <rev>] [--key <file>] [--no-push] [--json]\n" +
39
62
  " chant ci evidence sign --local --check-id <id>[,<id>...] [--at <rev>] [--base <rev>] [--key <file>] [--claim <file>] [--no-push] [--json]\n" +
40
63
  " chant ci evidence verify [--local] --check-id <id>[,<id>...] [--at <rev>] [--base <rev>] [--json]";
41
64
  function usage(message) {
@@ -107,35 +130,97 @@ async function verifyLocal(ctx, repo, base, at) {
107
130
  console.error(v.status === "accepted" ? ` accepted ${v.check} (${v.class} ${v.signer} at ${v.commit.slice(0, 12)})` : ` ${v.status.padEnd(12)} ${v.check}: ${v.reason}`);
108
131
  return verdicts.every((v) => v.status === "accepted") ? CHANT_EXIT.done : CHANT_EXIT.failed;
109
132
  }
133
+ /**
134
+ * `sign --from-job <job>` (#4926): the wave's evidence job, signing each
135
+ * named check whose step in that job of this run and commit the forge
136
+ * reports as passed (../../ci-evidence-from-job.ts). Exits 1 when the job is
137
+ * another run's or commit's.
138
+ */
139
+ async function signFromJobCommand(ctx, repo, base) {
140
+ const { args } = ctx;
141
+ const checks = idsOf(args.checkId);
142
+ if (checks.length === 0)
143
+ return usage("sign --from-job needs --check-id <id>[,<id>...], the checks the job ran");
144
+ if (args.fromReport)
145
+ return usage("--from-job and --from-report are two ways to sign; pass one");
146
+ const pem = args.key ? readFileSync(args.key, "utf-8") : undefined;
147
+ try {
148
+ const { forgeTargetFromEnv } = await import("../../pr-forge.js");
149
+ const { forgeReadsFor } = await import("../../pr-forge-reads.js");
150
+ const { signFromJob } = await import("../../ci-evidence-from-job.js");
151
+ const reads = forgeReadsFor(forgeTargetFromEnv(process.env));
152
+ const done = await signFromJob({ repo, base, fromJob: args.fromJob, checks, ...(args.claims ? { claims: args.claims } : {}), ...(args.at ? { at: args.at } : {}), reads, ...(pem ? { key: pem } : {}), push: !args.noPush });
153
+ if ("refused" in done) {
154
+ console.error(formatError({ message: `ci evidence: ${done.refused}`, hint: USAGE }));
155
+ return CHANT_EXIT.failed;
156
+ }
157
+ if (args.json)
158
+ console.log(JSON.stringify({ signed: done.signed, skipped: done.skipped }, null, 2));
159
+ return CHANT_EXIT.done;
160
+ }
161
+ catch (err) {
162
+ console.error(formatError({ message: err instanceof Error ? err.message : String(err), hint: USAGE }));
163
+ return CHANT_EXIT.failed;
164
+ }
165
+ }
110
166
  async function sign(ctx, repo, base, at) {
111
167
  const { args } = ctx;
168
+ if (args.open && args.fromJob)
169
+ return usage("--open and --from-job are two ways to sign; pass one");
170
+ if (args.open)
171
+ return signOpen(ctx, repo, base);
172
+ if (args.fromJob)
173
+ return signFromJobCommand(ctx, repo, base);
112
174
  const fromReport = args.fromReport;
113
175
  if (!fromReport && idsOf(args.checkId).length === 0)
114
176
  return usage("sign needs --check-id <id>, or --from-report <dir> in a plan note job");
115
177
  const pem = args.key ? readFileSync(args.key, "utf-8") : process.env[CHECK_EVIDENCE_KEY_ENV];
178
+ let wanted;
179
+ if (!fromReport) {
180
+ const claim = args.claim ? readFileSync(args.claim) : undefined;
181
+ wanted = idsOf(args.checkId).map((check) => ({ check, ...(claim ? { claim } : {}) }));
182
+ }
183
+ const done = await signChecksOf(repo, base, at, { ...(fromReport ? { fromReport } : {}), ...(wanted ? { wanted } : {}), ...(args.planResult ? { result: args.planResult } : {}), pem, push: !args.noPush });
184
+ if ("usage" in done)
185
+ return usage(done.usage);
186
+ if (fromReport)
187
+ writeFileSync(join(fromReport, CHECK_EVIDENCE_FILE), JSON.stringify(done.note, null, 2) + "\n");
188
+ if (args.json)
189
+ console.log(JSON.stringify(done.note, null, 2));
190
+ return done.code;
191
+ }
192
+ /**
193
+ * Sign the checks of a report directory (`fromReport`) or the named ones
194
+ * (`wanted`) at `at`, against the runner identities at `base`. With
195
+ * `skipCurrent` (#4914), a check whose current evidence the notes already
196
+ * hold is not signed again and is listed as signed by that runner, so a
197
+ * pipeline that runs on every schedule signs each head once.
198
+ */
199
+ async function signChecksOf(repo, base, at, opts) {
200
+ const { fromReport, pem } = opts;
116
201
  const identity = pem !== undefined && pem !== "" ? "key" : process.env[RUNNER_IDENTITY_ENV] ? "oidc" : undefined;
117
202
  const note = { signed: [], skipped: [] };
118
203
  let wanted;
119
- if (fromReport) {
120
- const decided = planReportChecks(fromReport, args.planResult);
204
+ if (fromReport && isCheckReportDir(fromReport)) {
205
+ // #4935: a check job's report, each passed hook signed by name.
206
+ const decided = await checkReportChecks(fromReport, opts.result);
207
+ if ("error" in decided)
208
+ return { usage: decided.error };
209
+ wanted = decided.sign;
210
+ note.skipped.push(...decided.skipped);
211
+ }
212
+ else if (fromReport) {
213
+ const decided = planReportChecks(fromReport, opts.result);
121
214
  wanted = decided.sign;
122
215
  note.skipped.push(...decided.skipped);
123
216
  }
124
217
  else {
125
- const claim = args.claim ? readFileSync(args.claim) : undefined;
126
- wanted = idsOf(args.checkId).map((check) => ({ check, ...(claim ? { claim } : {}) }));
218
+ wanted = opts.wanted ?? [];
127
219
  }
128
- const finish = (code) => {
129
- if (fromReport)
130
- writeFileSync(join(fromReport, CHECK_EVIDENCE_FILE), JSON.stringify(note, null, 2) + "\n");
131
- if (args.json)
132
- console.log(JSON.stringify(note, null, 2));
133
- return code;
134
- };
135
220
  if (!identity) {
136
221
  note.skipped.push(...wanted.map((w) => ({ check: w.check, reason: noRunnerIdentity() })));
137
222
  console.error(`ci evidence: ${noRunnerIdentity()}, so no check was signed`);
138
- return finish(CHANT_EXIT.done);
223
+ return { note, code: CHANT_EXIT.done };
139
224
  }
140
225
  let signer;
141
226
  try {
@@ -143,21 +228,145 @@ async function sign(ctx, repo, base, at) {
143
228
  }
144
229
  catch (err) {
145
230
  console.error(formatError({ message: err instanceof Error ? err.message : String(err), hint: USAGE }));
146
- return finish(CHANT_EXIT.failed);
231
+ return { note, code: CHANT_EXIT.failed };
147
232
  }
148
233
  for (const s of note.skipped)
149
234
  console.error(`ci evidence: ${s.check} not signed: ${s.reason}`);
235
+ if (opts.skipCurrent && wanted.length > 0) {
236
+ const { tree } = commitTree(repo, at);
237
+ const current = (await readCheckEvidence(repo, at, base, wanted.map((w) => w.check))).filter((v) => v.status === "current");
238
+ for (const v of current) {
239
+ note.signed.push({ check: v.check, runner: v.runner, commit: v.commit, tree });
240
+ console.error(`ci evidence: ${v.check} at ${at.slice(0, 12)} is already signed by ${v.runner}`);
241
+ }
242
+ const kept = new Set(current.map((v) => v.check));
243
+ wanted = wanted.filter((w) => !kept.has(w.check));
244
+ }
150
245
  if (wanted.length === 0)
151
- return finish(CHANT_EXIT.done);
246
+ return { note, code: CHANT_EXIT.done };
152
247
  const signed = await signChecks(repo, at, wanted, signer);
153
- const pushed = await recordChecks(repo, signed, { push: !args.noPush });
248
+ const pushed = await recordChecks(repo, signed, { push: opts.push });
154
249
  for (const s of signed) {
155
250
  note.signed.push({ check: s.check, runner: s.runner, commit: s.commit, tree: s.tree });
156
251
  console.error(`ci evidence: signed ${s.check} at ${s.commit.slice(0, 12)} as ${s.runner}`);
157
252
  }
158
- if (!args.noPush && !pushed.pushed && pushed.pushWarning)
253
+ if (opts.push && !pushed.pushed && pushed.pushWarning)
159
254
  console.error(`ci evidence: the evidence is attached here, and the push did not land: ${pushed.pushWarning}`);
160
- return finish(CHANT_EXIT.done);
255
+ return { note, code: CHANT_EXIT.done };
256
+ }
257
+ /** A commit's full sha and tree, read with git. */
258
+ function commitTree(repo, rev) {
259
+ const read = (spec) => execFileSync("git", ["rev-parse", "--verify", spec], { cwd: repo, encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] }).trim();
260
+ return { commit: read(`${rev}^{commit}`), tree: read(`${rev}^{tree}`) };
261
+ }
262
+ /**
263
+ * `sign --open --job <job> --from-report <dir> -o <out>` (#4914): in a
264
+ * GitLab pipeline of the target branch, sign each open merge request's
265
+ * settled `job` from its artifact (../../workspace/trust/open-evidence.ts),
266
+ * against the policy at `--base` (the generated job passes the branch's
267
+ * commit). The branch is `--branch`, else the pipeline's own. Exits 0 once
268
+ * each merge request is signed or said, and 1 when the job's runner
269
+ * identity is not one the policy at base lists.
270
+ */
271
+ async function signOpen(ctx, repo, base) {
272
+ const { args } = ctx;
273
+ if (!args.ciJob || !/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(args.ciJob))
274
+ return usage("sign --open needs the job to sign for, by name: --job plan");
275
+ if (!args.fromReport)
276
+ return usage("sign --open needs the job's report directory as its artifact keeps it: --from-report .chant/pr");
277
+ if (!args.output)
278
+ return usage("sign --open needs where to keep each merge request's evidence.json: -o .chant/evidence/<job>");
279
+ if (args.checkId || args.at || args.planResult)
280
+ return usage("sign --open finds each merge request's head and its job's result itself, so it takes no --check-id, --at or --result");
281
+ const branch = args.branch ?? process.env.CI_COMMIT_BRANCH;
282
+ if (!branch)
283
+ return usage("sign --open signs for the merge requests into a branch: run it in a branch pipeline, or pass --branch <branch>");
284
+ const pem = args.key ? readFileSync(args.key, "utf-8") : process.env[CHECK_EVIDENCE_KEY_ENV];
285
+ const { forgeFromEnv } = await import("../../pr-forge.js");
286
+ const { signOpenReports } = await import("../../workspace/trust/open-evidence.js");
287
+ // The notes there are the ones to skip a head already signed by, and to add to.
288
+ spawnSync("git", ["fetch", "--quiet", "--no-tags", "origin", "+refs/notes/chant/evidence:refs/notes/chant/evidence"], { cwd: repo, encoding: "utf-8" });
289
+ let failed = false;
290
+ let done;
291
+ try {
292
+ done = await signOpenReports({
293
+ forge: forgeFromEnv("gitlab"),
294
+ branch,
295
+ job: args.ciJob,
296
+ artifactDir: args.fromReport,
297
+ out: args.output,
298
+ ...(args.noForks ? { noForks: true } : {}),
299
+ fetchHead: (pr, head) => fetchMergeRequestHead(repo, pr, head),
300
+ sign: async (dir, head, result) => {
301
+ const r = await signChecksOf(repo, base, head, { fromReport: dir, result, ...(pem ? { pem } : {}), push: !args.noPush, skipCurrent: true });
302
+ if ("usage" in r)
303
+ throw new Error(r.usage);
304
+ if (r.code !== CHANT_EXIT.done)
305
+ failed = true;
306
+ return r.note;
307
+ },
308
+ });
309
+ }
310
+ catch (err) {
311
+ console.error(formatError({ message: err instanceof Error ? err.message : String(err), hint: USAGE }));
312
+ return CHANT_EXIT.failed;
313
+ }
314
+ for (const w of done.warnings)
315
+ console.error(`ci evidence: ${w}`);
316
+ for (const d of done.done) {
317
+ if (d.skipped)
318
+ console.error(`ci evidence: !${d.pr}: ${d.skipped}`);
319
+ else
320
+ console.error(`ci evidence: !${d.pr} at ${d.head.slice(0, 12)}: signed ${d.note.signed.map((s) => s.check).join(", ") || "nothing"}`);
321
+ }
322
+ if (done.done.length === 0)
323
+ console.error(`ci evidence: no open merge request into ${branch} has a ${args.ciJob} job`);
324
+ if (args.json)
325
+ console.log(JSON.stringify(done.done, null, 2));
326
+ return failed ? CHANT_EXIT.failed : CHANT_EXIT.done;
327
+ }
328
+ /** Fetch merge request `pr`'s head (`refs/merge-requests/<iid>/head`, a fork's too), else the commit itself; true once it is here. */
329
+ function fetchMergeRequestHead(repo, pr, head) {
330
+ const here = () => spawnSync("git", ["cat-file", "-e", `${head}^{commit}`], { cwd: repo }).status === 0;
331
+ if (here())
332
+ return true;
333
+ spawnSync("git", ["fetch", "--quiet", "--no-tags", "origin", `refs/merge-requests/${pr}/head`], { cwd: repo, encoding: "utf-8" });
334
+ if (here())
335
+ return true;
336
+ spawnSync("git", ["fetch", "--quiet", "--no-tags", "origin", head], { cwd: repo, encoding: "utf-8" });
337
+ return here();
338
+ }
339
+ /** Whether `dir` holds a check job's report and no plan report (#4935). */
340
+ function isCheckReportDir(dir) {
341
+ return existsSync(join(dir, "check-hooks.json")) && !existsSync(join(dir, "pr-plan.json")) && !existsSync(join(dir, "pr-plan-note.json"));
342
+ }
343
+ /**
344
+ * The hooks to sign from a check job's report (#4935): each hook whose every
345
+ * run passed, with its runs as the claim, as the check runner signs them
346
+ * (../../components/check-steps.ts). The report is the check job's, which ran
347
+ * the change's code, so it is read as data: a hook with no name or outcome is
348
+ * left out. A job `result` other than success or failure signs none.
349
+ */
350
+ async function checkReportChecks(dir, result) {
351
+ const { CHECK_HOOKS_REPORT_FILE, passedCheckHooks } = await import("../../components/check-hooks.js");
352
+ let doc;
353
+ try {
354
+ doc = JSON.parse(readFileSync(join(dir, CHECK_HOOKS_REPORT_FILE), "utf-8"));
355
+ }
356
+ catch (err) {
357
+ return { error: `--from-report ${dir}: ${CHECK_HOOKS_REPORT_FILE} does not read: ${err instanceof Error ? err.message : String(err)}` };
358
+ }
359
+ const hooks = doc && typeof doc === "object" && Array.isArray(doc.hooks) ? doc.hooks : undefined;
360
+ if (!hooks)
361
+ return { error: `--from-report ${dir}: ${CHECK_HOOKS_REPORT_FILE} lists no hooks` };
362
+ const runs = hooks.filter((h) => h && typeof h.name === "string" && h.name.length > 0 && h.name.length <= 200 && (h.outcome === "passed" || h.outcome === "failed" || h.outcome === "skipped"));
363
+ const passed = passedCheckHooks(runs);
364
+ if (result !== undefined && result !== "success" && result !== "failure") {
365
+ return { sign: [], skipped: passed.map((p) => ({ check: p.check, reason: `the check job's result is ${result}` })) };
366
+ }
367
+ const signed = new Set(passed.map((p) => p.check));
368
+ const skipped = [...new Set(runs.map((h) => h.name))].filter((n) => !signed.has(n)).map((check) => ({ check, reason: "the hook did not pass in the check job" }));
369
+ return { sign: passed.map((p) => ({ check: p.check, claim: JSON.stringify(p.runs) })), skipped };
161
370
  }
162
371
  async function verify(ctx, repo, base, at) {
163
372
  const { args } = ctx;
@@ -1 +1 @@
1
- {"version":3,"file":"ci-forge-check.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/ci-forge-check.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOlD,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuE1E"}
1
+ {"version":3,"file":"ci-forge-check.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/ci-forge-check.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOlD,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiF1E"}