@intentius/chant 0.124.55 → 0.124.57

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 (419) hide show
  1. package/dist/ci-agent.d.ts.map +1 -1
  2. package/dist/ci-agent.js +1 -2
  3. package/dist/ci-audit/attribution.d.ts +111 -0
  4. package/dist/ci-audit/attribution.d.ts.map +1 -0
  5. package/dist/ci-audit/attribution.js +194 -0
  6. package/dist/ci-audit/audit-log.d.ts +144 -0
  7. package/dist/ci-audit/audit-log.d.ts.map +1 -0
  8. package/dist/ci-audit/audit-log.js +149 -0
  9. package/dist/ci-audit/index.d.ts +12 -0
  10. package/dist/ci-audit/index.d.ts.map +1 -0
  11. package/dist/ci-audit/index.js +11 -0
  12. package/dist/ci-audit/unrecorded.d.ts +74 -0
  13. package/dist/ci-audit/unrecorded.d.ts.map +1 -0
  14. package/dist/ci-audit/unrecorded.js +95 -0
  15. package/dist/ci-audit.d.ts +3 -0
  16. package/dist/ci-audit.d.ts.map +1 -0
  17. package/dist/ci-audit.js +2 -0
  18. package/dist/ci-control.d.ts.map +1 -1
  19. package/dist/ci-control.js +3 -4
  20. package/dist/ci-estate.d.ts +24 -0
  21. package/dist/ci-estate.d.ts.map +1 -1
  22. package/dist/ci-estate.js +1 -2
  23. package/dist/ci-identity.d.ts.map +1 -1
  24. package/dist/ci-identity.js +2 -3
  25. package/dist/ci-job-guard.d.ts +139 -0
  26. package/dist/ci-job-guard.d.ts.map +1 -0
  27. package/dist/ci-job-guard.js +287 -0
  28. package/dist/ci-jobs.d.ts +7 -0
  29. package/dist/ci-jobs.d.ts.map +1 -1
  30. package/dist/ci-jobs.js +7 -0
  31. package/dist/ci-product-words.d.ts +7 -1
  32. package/dist/ci-product-words.d.ts.map +1 -1
  33. package/dist/ci-product-words.js +38 -4
  34. package/dist/ci-product.d.ts +35 -0
  35. package/dist/ci-product.d.ts.map +1 -1
  36. package/dist/ci-product.js +38 -4
  37. package/dist/ci-respond-run.d.ts +73 -0
  38. package/dist/ci-respond-run.d.ts.map +1 -0
  39. package/dist/ci-respond-run.js +247 -0
  40. package/dist/ci-respond.d.ts +189 -0
  41. package/dist/ci-respond.d.ts.map +1 -0
  42. package/dist/ci-respond.js +285 -0
  43. package/dist/cli/handlers/audit-log.d.ts +12 -0
  44. package/dist/cli/handlers/audit-log.d.ts.map +1 -0
  45. package/dist/cli/handlers/audit-log.js +81 -0
  46. package/dist/cli/handlers/build.d.ts +7 -0
  47. package/dist/cli/handlers/build.d.ts.map +1 -1
  48. package/dist/cli/handlers/build.js +81 -0
  49. package/dist/cli/handlers/ci-check-job.d.ts +11 -0
  50. package/dist/cli/handlers/ci-check-job.d.ts.map +1 -0
  51. package/dist/cli/handlers/ci-check-job.js +27 -0
  52. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  53. package/dist/cli/handlers/ci-check.js +38 -9
  54. package/dist/cli/handlers/e2e-safe-run.d.ts +12 -0
  55. package/dist/cli/handlers/e2e-safe-run.d.ts.map +1 -0
  56. package/dist/cli/handlers/e2e-safe-run.js +23 -0
  57. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  58. package/dist/cli/handlers/lifecycle.js +14 -0
  59. package/dist/cli/handlers/pr.d.ts +5 -0
  60. package/dist/cli/handlers/pr.d.ts.map +1 -1
  61. package/dist/cli/handlers/pr.js +346 -36
  62. package/dist/cli/handlers/run-wave.js +89 -1
  63. package/dist/cli/main.d.ts.map +1 -1
  64. package/dist/cli/main.js +56 -2
  65. package/dist/cli/parse-args.d.ts.map +1 -1
  66. package/dist/cli/parse-args.js +107 -0
  67. package/dist/cli/registry.d.ts +38 -0
  68. package/dist/cli/registry.d.ts.map +1 -1
  69. package/dist/components/adoption.d.ts.map +1 -1
  70. package/dist/components/adoption.js +1 -2
  71. package/dist/components/auto-release.d.ts +5 -2
  72. package/dist/components/auto-release.d.ts.map +1 -1
  73. package/dist/components/auto-release.js +9 -4
  74. package/dist/components/capability.d.ts +47 -0
  75. package/dist/components/capability.d.ts.map +1 -1
  76. package/dist/components/capability.js +25 -0
  77. package/dist/components/check-hooks.d.ts +4 -1
  78. package/dist/components/check-hooks.d.ts.map +1 -1
  79. package/dist/components/check-steps.d.ts +74 -0
  80. package/dist/components/check-steps.d.ts.map +1 -0
  81. package/dist/components/check-steps.js +102 -0
  82. package/dist/components/ci-services.d.ts.map +1 -1
  83. package/dist/components/ci-services.js +1 -2
  84. package/dist/components/deploy-units.d.ts +12 -0
  85. package/dist/components/deploy-units.d.ts.map +1 -1
  86. package/dist/components/deploy-units.js +20 -1
  87. package/dist/components/driver.d.ts +12 -0
  88. package/dist/components/driver.d.ts.map +1 -1
  89. package/dist/components/driver.js +35 -1
  90. package/dist/components/groups.d.ts.map +1 -1
  91. package/dist/components/groups.js +4 -3
  92. package/dist/components/pr-env-ledger.d.ts.map +1 -1
  93. package/dist/components/pr-env-ledger.js +1 -2
  94. package/dist/components/pr-environment.d.ts +1 -1
  95. package/dist/components/pr-environment.d.ts.map +1 -1
  96. package/dist/components/pr-environment.js +1 -1
  97. package/dist/components/pr-pipeline.d.ts +137 -5
  98. package/dist/components/pr-pipeline.d.ts.map +1 -1
  99. package/dist/components/pr-pipeline.js +164 -20
  100. package/dist/components/pr-run.d.ts +8 -0
  101. package/dist/components/pr-run.d.ts.map +1 -1
  102. package/dist/components/pr-run.js +9 -4
  103. package/dist/components/product-pipeline.d.ts +35 -2
  104. package/dist/components/product-pipeline.d.ts.map +1 -1
  105. package/dist/components/product-pipeline.js +24 -5
  106. package/dist/components/row-lease.d.ts +22 -1
  107. package/dist/components/row-lease.d.ts.map +1 -1
  108. package/dist/components/row-lease.js +32 -6
  109. package/dist/components/wave-plan.d.ts +8 -0
  110. package/dist/components/wave-plan.d.ts.map +1 -1
  111. package/dist/components/wave-plan.js +18 -2
  112. package/dist/e2e-harness/bucket.d.ts +21 -0
  113. package/dist/e2e-harness/bucket.d.ts.map +1 -0
  114. package/dist/e2e-harness/bucket.js +61 -0
  115. package/dist/e2e-harness/claim.d.ts +70 -0
  116. package/dist/e2e-harness/claim.d.ts.map +1 -0
  117. package/dist/e2e-harness/claim.js +98 -0
  118. package/dist/e2e-harness/driver.d.ts +64 -0
  119. package/dist/e2e-harness/driver.d.ts.map +1 -0
  120. package/dist/e2e-harness/driver.js +243 -0
  121. package/dist/e2e-harness/forgejo.d.ts +77 -0
  122. package/dist/e2e-harness/forgejo.d.ts.map +1 -0
  123. package/dist/e2e-harness/forgejo.js +205 -0
  124. package/dist/e2e-harness/git.d.ts +32 -0
  125. package/dist/e2e-harness/git.d.ts.map +1 -0
  126. package/dist/e2e-harness/git.js +67 -0
  127. package/dist/e2e-harness/index.d.ts +22 -0
  128. package/dist/e2e-harness/index.d.ts.map +1 -0
  129. package/dist/e2e-harness/index.js +47 -0
  130. package/dist/e2e-harness/jobs.d.ts +8 -0
  131. package/dist/e2e-harness/jobs.d.ts.map +1 -0
  132. package/dist/e2e-harness/jobs.js +34 -0
  133. package/dist/e2e-harness/pins.d.ts +45 -0
  134. package/dist/e2e-harness/pins.d.ts.map +1 -0
  135. package/dist/e2e-harness/pins.js +44 -0
  136. package/dist/e2e-harness/ports.d.ts +113 -0
  137. package/dist/e2e-harness/ports.d.ts.map +1 -0
  138. package/dist/e2e-harness/ports.js +4 -0
  139. package/dist/e2e-harness/reports.d.ts +45 -0
  140. package/dist/e2e-harness/reports.d.ts.map +1 -0
  141. package/dist/e2e-harness/reports.js +57 -0
  142. package/dist/e2e-harness/safe-run-cli.d.ts +17 -0
  143. package/dist/e2e-harness/safe-run-cli.d.ts.map +1 -0
  144. package/dist/e2e-harness/safe-run-cli.js +43 -0
  145. package/dist/e2e-harness/safe-run.d.ts +61 -0
  146. package/dist/e2e-harness/safe-run.d.ts.map +1 -0
  147. package/dist/e2e-harness/safe-run.js +172 -0
  148. package/dist/e2e-harness/scenario.d.ts +11 -0
  149. package/dist/e2e-harness/scenario.d.ts.map +1 -0
  150. package/dist/e2e-harness/scenario.js +89 -0
  151. package/dist/e2e-harness/schemas/demo-cycle.schema.json +282 -0
  152. package/dist/e2e-harness/schemas/demo-step.schema.json +245 -0
  153. package/dist/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
  154. package/dist/e2e-harness/schemas/e2e-claims.schema.json +18 -0
  155. package/dist/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
  156. package/dist/e2e-harness/schemas/index.d.ts +191 -0
  157. package/dist/e2e-harness/schemas/index.d.ts.map +1 -0
  158. package/dist/e2e-harness/schemas/index.js +62 -0
  159. package/dist/e2e-harness/stack.d.ts +124 -0
  160. package/dist/e2e-harness/stack.d.ts.map +1 -0
  161. package/dist/e2e-harness/stack.js +207 -0
  162. package/dist/e2e-harness/steps.d.ts +11 -0
  163. package/dist/e2e-harness/steps.d.ts.map +1 -0
  164. package/dist/e2e-harness/steps.js +22 -0
  165. package/dist/e2e-harness.d.ts +3 -0
  166. package/dist/e2e-harness.d.ts.map +1 -0
  167. package/dist/e2e-harness.js +2 -0
  168. package/dist/exit-codes.d.ts +7 -1
  169. package/dist/exit-codes.d.ts.map +1 -1
  170. package/dist/exit-codes.js +7 -1
  171. package/dist/lexicon.d.ts +55 -0
  172. package/dist/lexicon.d.ts.map +1 -1
  173. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  174. package/dist/lifecycle/gate-ledger.js +2 -3
  175. package/dist/lifecycle/gated-request.d.ts.map +1 -1
  176. package/dist/lifecycle/gated-request.js +1 -2
  177. package/dist/lifecycle/git.d.ts +39 -3
  178. package/dist/lifecycle/git.d.ts.map +1 -1
  179. package/dist/lifecycle/git.js +223 -15
  180. package/dist/lifecycle/lock-rows.d.ts +23 -0
  181. package/dist/lifecycle/lock-rows.d.ts.map +1 -1
  182. package/dist/lifecycle/lock-rows.js +47 -8
  183. package/dist/lifecycle/query.d.ts.map +1 -1
  184. package/dist/lifecycle/query.js +4 -5
  185. package/dist/lifecycle/release-catalog.d.ts.map +1 -1
  186. package/dist/lifecycle/release-catalog.js +1 -1
  187. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  188. package/dist/lifecycle/release-ledger.js +1 -2
  189. package/dist/lifecycle/release-status.d.ts +20 -0
  190. package/dist/lifecycle/release-status.d.ts.map +1 -1
  191. package/dist/lifecycle/release-status.js +1 -22
  192. package/dist/lifecycle/resource-lock.d.ts +70 -0
  193. package/dist/lifecycle/resource-lock.d.ts.map +1 -1
  194. package/dist/lifecycle/resource-lock.js +241 -5
  195. package/dist/lifecycle/wave-plans.d.ts +23 -7
  196. package/dist/lifecycle/wave-plans.d.ts.map +1 -1
  197. package/dist/lifecycle/wave-plans.js +9 -2
  198. package/dist/op/approval-status.d.ts +103 -0
  199. package/dist/op/approval-status.d.ts.map +1 -0
  200. package/dist/op/approval-status.js +197 -0
  201. package/dist/op/gate.js +21 -4
  202. package/dist/op/index.d.ts +1 -1
  203. package/dist/op/index.d.ts.map +1 -1
  204. package/dist/op/index.js +1 -1
  205. package/dist/op/op-waves-capability-spec.d.ts +8 -0
  206. package/dist/op/op-waves-capability-spec.d.ts.map +1 -1
  207. package/dist/op/op-waves-capability-spec.js +21 -0
  208. package/dist/op/op-waves-release-port.js +1 -1
  209. package/dist/op/op-waves-release.d.ts +2 -1
  210. package/dist/op/op-waves-release.d.ts.map +1 -1
  211. package/dist/op/op-waves-release.js +1 -2
  212. package/dist/op/op-waves-run.d.ts +15 -2
  213. package/dist/op/op-waves-run.d.ts.map +1 -1
  214. package/dist/op/op-waves-run.js +195 -31
  215. package/dist/op/op-waves-stand-down.d.ts.map +1 -1
  216. package/dist/op/op-waves-stand-down.js +1 -2
  217. package/dist/op/op-waves.d.ts +53 -0
  218. package/dist/op/op-waves.d.ts.map +1 -1
  219. package/dist/op/op-waves.js +62 -6
  220. package/dist/op/runtime.d.ts +4 -0
  221. package/dist/op/runtime.d.ts.map +1 -1
  222. package/dist/op/runtime.js +2 -3
  223. package/dist/otlp.d.ts.map +1 -1
  224. package/dist/otlp.js +1 -2
  225. package/dist/parallelism.d.ts +17 -0
  226. package/dist/parallelism.d.ts.map +1 -0
  227. package/dist/parallelism.js +33 -0
  228. package/dist/policy-source.d.ts.map +1 -1
  229. package/dist/policy-source.js +1 -2
  230. package/dist/pr-forge.d.ts.map +1 -1
  231. package/dist/pr-forge.js +56 -39
  232. package/dist/pr-loop.d.ts +9 -0
  233. package/dist/pr-loop.d.ts.map +1 -1
  234. package/dist/pr-loop.js +22 -4
  235. package/dist/pr-merge.d.ts +64 -0
  236. package/dist/pr-merge.d.ts.map +1 -0
  237. package/dist/pr-merge.js +78 -0
  238. package/dist/pr-post.d.ts +70 -1
  239. package/dist/pr-post.d.ts.map +1 -1
  240. package/dist/pr-post.js +116 -5
  241. package/dist/pr-report-url.d.ts.map +1 -1
  242. package/dist/pr-report-url.js +1 -2
  243. package/dist/release-floors.d.ts +1 -1
  244. package/dist/release-floors.js +1 -1
  245. package/dist/run-event.d.ts.map +1 -1
  246. package/dist/run-event.js +1 -2
  247. package/dist/scheduled-op-cloud.d.ts +32 -0
  248. package/dist/scheduled-op-cloud.d.ts.map +1 -0
  249. package/dist/scheduled-op-cloud.js +69 -0
  250. package/dist/wave-runtime.mjs +351 -328
  251. package/dist/workspace/ci-lock-grain.d.ts +5 -0
  252. package/dist/workspace/ci-lock-grain.d.ts.map +1 -1
  253. package/dist/workspace/ci-lock-grain.js +1 -7
  254. package/dist/workspace/ci-run.d.ts.map +1 -1
  255. package/dist/workspace/ci-run.js +5 -1
  256. package/dist/workspace/pr-report.schema.json +5 -0
  257. package/package.json +1 -1
  258. package/src/ci-agent.ts +1 -2
  259. package/src/ci-audit/__fixtures__/cloudtrail-lookup-bucket.json +37 -0
  260. package/src/ci-audit/__fixtures__/cloudtrail-writes-window.json +59 -0
  261. package/src/ci-audit/attribution.ts +260 -0
  262. package/src/ci-audit/audit-log.ts +220 -0
  263. package/src/ci-audit/ci-audit.test.ts +175 -0
  264. package/src/ci-audit/index.ts +14 -0
  265. package/src/ci-audit/unrecorded.ts +140 -0
  266. package/src/ci-audit.ts +2 -0
  267. package/src/ci-control.ts +3 -4
  268. package/src/ci-estate.ts +1 -2
  269. package/src/ci-identity-database.test.ts +2 -3
  270. package/src/ci-identity-targets.test.ts +1 -3
  271. package/src/ci-identity.ts +2 -3
  272. package/src/ci-job-guard.test.ts +154 -0
  273. package/src/ci-job-guard.ts +319 -0
  274. package/src/ci-jobs.ts +8 -0
  275. package/src/ci-product-comment-targets.test.ts +45 -0
  276. package/src/ci-product-words.ts +35 -6
  277. package/src/ci-product.ts +55 -4
  278. package/src/ci-respond-run.ts +291 -0
  279. package/src/ci-respond.test.ts +264 -0
  280. package/src/ci-respond.ts +412 -0
  281. package/src/cli/handlers/audit-log.ts +74 -0
  282. package/src/cli/handlers/build-pr-loop-flags.test.ts +98 -0
  283. package/src/cli/handlers/build.ts +69 -0
  284. package/src/cli/handlers/ci-check-job.test.ts +114 -0
  285. package/src/cli/handlers/ci-check-job.ts +33 -0
  286. package/src/cli/handlers/ci-check.ts +38 -8
  287. package/src/cli/handlers/e2e-safe-run.ts +27 -0
  288. package/src/cli/handlers/lifecycle.ts +13 -0
  289. package/src/cli/handlers/pr-before-merge.test.ts +1 -1
  290. package/src/cli/handlers/pr-deploy-inputs.test.ts +1 -1
  291. package/src/cli/handlers/pr-endpoint.test.ts +1 -1
  292. package/src/cli/handlers/pr-green.test.ts +1 -1
  293. package/src/cli/handlers/pr-plan-comment-targets.test.ts +166 -0
  294. package/src/cli/handlers/pr-plan-flags.test.ts +161 -0
  295. package/src/cli/handlers/pr-plan-targets.test.ts +1 -1
  296. package/src/cli/handlers/pr-record.test.ts +34 -2
  297. package/src/cli/handlers/pr-waves-blocked.test.ts +1 -1
  298. package/src/cli/handlers/pr-waves.test.ts +1 -1
  299. package/src/cli/handlers/pr.test.ts +1 -1
  300. package/src/cli/handlers/pr.ts +311 -32
  301. package/src/cli/handlers/run-wave.ts +79 -1
  302. package/src/cli/main.test.ts +1 -1
  303. package/src/cli/main.ts +56 -2
  304. package/src/cli/parse-args.ts +77 -0
  305. package/src/cli/registry.ts +38 -0
  306. package/src/components/adoption.ts +1 -2
  307. package/src/components/auto-release.test.ts +4 -2
  308. package/src/components/auto-release.ts +9 -5
  309. package/src/components/capability.ts +60 -0
  310. package/src/components/check-hooks.ts +4 -1
  311. package/src/components/check-steps.test.ts +70 -0
  312. package/src/components/check-steps.ts +158 -0
  313. package/src/components/ci-services.ts +1 -2
  314. package/src/components/deploy-units.test.ts +18 -1
  315. package/src/components/deploy-units.ts +26 -1
  316. package/src/components/driver.ts +35 -1
  317. package/src/components/groups.ts +4 -2
  318. package/src/components/plan-flags.test.ts +46 -0
  319. package/src/components/pr-comment-preview-targets.test.ts +34 -0
  320. package/src/components/pr-env-ledger.ts +1 -2
  321. package/src/components/pr-env-run-bundle.test.ts +0 -20
  322. package/src/components/pr-environment.ts +1 -1
  323. package/src/components/pr-pipeline-runners.test.ts +80 -0
  324. package/src/components/pr-pipeline.ts +244 -20
  325. package/src/components/pr-run.ts +17 -6
  326. package/src/components/pr-stale-job.test.ts +34 -0
  327. package/src/components/product-pipeline.ts +50 -8
  328. package/src/components/row-lease.test.ts +61 -1
  329. package/src/components/row-lease.ts +48 -7
  330. package/src/components/wave-plan.ts +18 -2
  331. package/src/e2e-harness/__project__/chant.config.ts +4 -0
  332. package/src/e2e-harness/__project__/src/compose.ts +33 -0
  333. package/src/e2e-harness/bucket.ts +69 -0
  334. package/src/e2e-harness/claim.test.ts +150 -0
  335. package/src/e2e-harness/claim.ts +140 -0
  336. package/src/e2e-harness/driver.test.ts +304 -0
  337. package/src/e2e-harness/driver.ts +294 -0
  338. package/src/e2e-harness/forgejo.ts +267 -0
  339. package/src/e2e-harness/git.ts +96 -0
  340. package/src/e2e-harness/index.ts +49 -0
  341. package/src/e2e-harness/jobs.ts +35 -0
  342. package/src/e2e-harness/pins.ts +52 -0
  343. package/src/e2e-harness/ports.ts +130 -0
  344. package/src/e2e-harness/reports.ts +79 -0
  345. package/src/e2e-harness/safe-run-cli.test.ts +102 -0
  346. package/src/e2e-harness/safe-run-cli.ts +54 -0
  347. package/src/e2e-harness/safe-run.ts +198 -0
  348. package/src/e2e-harness/scenario.ts +89 -0
  349. package/src/e2e-harness/schemas/README.md +62 -0
  350. package/src/e2e-harness/schemas/demo-cycle.schema.json +282 -0
  351. package/src/e2e-harness/schemas/demo-step.schema.json +245 -0
  352. package/src/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
  353. package/src/e2e-harness/schemas/e2e-claims.schema.json +18 -0
  354. package/src/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
  355. package/src/e2e-harness/schemas/index.ts +220 -0
  356. package/src/e2e-harness/schemas.test.ts +145 -0
  357. package/src/e2e-harness/stack.test.ts +124 -0
  358. package/src/e2e-harness/stack.ts +306 -0
  359. package/src/e2e-harness/steps.ts +30 -0
  360. package/src/e2e-harness.ts +2 -0
  361. package/src/exit-codes.test.ts +3 -2
  362. package/src/exit-codes.ts +7 -1
  363. package/src/gate-decision-bundle.test.ts +0 -2
  364. package/src/lexicon.ts +57 -0
  365. package/src/lifecycle/control-entries-ledger.test.ts +2 -3
  366. package/src/lifecycle/gate-ledger.ts +2 -3
  367. package/src/lifecycle/gated-request.ts +1 -2
  368. package/src/lifecycle/git.test.ts +155 -0
  369. package/src/lifecycle/git.ts +213 -17
  370. package/src/lifecycle/lock-rows.test.ts +6 -1
  371. package/src/lifecycle/lock-rows.ts +58 -7
  372. package/src/lifecycle/query.ts +4 -5
  373. package/src/lifecycle/release-catalog.test.ts +3 -4
  374. package/src/lifecycle/release-catalog.ts +1 -1
  375. package/src/lifecycle/release-ledger.ts +1 -2
  376. package/src/lifecycle/release-status.test.ts +3 -4
  377. package/src/lifecycle/release-status.ts +1 -2
  378. package/src/lifecycle/resource-lock-wait.test.ts +292 -0
  379. package/src/lifecycle/resource-lock.ts +261 -7
  380. package/src/lifecycle/wave-plans.ts +33 -5
  381. package/src/op/approval-status.test.ts +134 -0
  382. package/src/op/approval-status.ts +235 -0
  383. package/src/op/gate-review.test.ts +2 -1
  384. package/src/op/gate.test.ts +7 -5
  385. package/src/op/gate.ts +20 -4
  386. package/src/op/index.ts +2 -0
  387. package/src/op/op-waves-after-plan.test.ts +11 -0
  388. package/src/op/op-waves-capability-spec.ts +20 -0
  389. package/src/op/op-waves-ledger-lock.test.ts +208 -0
  390. package/src/op/op-waves-parallelism.test.ts +89 -0
  391. package/src/op/op-waves-pull-request.test.ts +78 -1
  392. package/src/op/op-waves-release-port.ts +1 -1
  393. package/src/op/op-waves-release.ts +2 -3
  394. package/src/op/op-waves-run.ts +196 -31
  395. package/src/op/op-waves-stand-down.ts +1 -2
  396. package/src/op/op-waves.ts +81 -6
  397. package/src/op/runtime.ts +6 -3
  398. package/src/otlp.ts +1 -2
  399. package/src/parallelism.test.ts +38 -0
  400. package/src/parallelism.ts +33 -0
  401. package/src/policy-source.ts +1 -2
  402. package/src/pr-forge-bundle.test.ts +1 -1
  403. package/src/pr-forge.ts +54 -35
  404. package/src/pr-loop-bundle.test.ts +0 -2
  405. package/src/pr-loop-narrowed.test.ts +63 -0
  406. package/src/pr-loop.ts +30 -4
  407. package/src/pr-merge.test.ts +100 -0
  408. package/src/pr-merge.ts +105 -0
  409. package/src/pr-post-stale.test.ts +163 -0
  410. package/src/pr-post.ts +159 -5
  411. package/src/pr-report-url.ts +1 -2
  412. package/src/product-subpaths-plain-node.e2e.test.ts +1 -0
  413. package/src/release-floors.ts +1 -1
  414. package/src/run-event.ts +1 -2
  415. package/src/scheduled-op-cloud.ts +68 -0
  416. package/src/stage-hooks-bundle.test.ts +0 -2
  417. package/src/workspace/ci-lock-grain.ts +1 -2
  418. package/src/workspace/ci-run.ts +5 -1
  419. package/src/workspace/pr-report.schema.json +5 -0
@@ -0,0 +1,161 @@
1
+ /**
2
+ * `pr-plan --refresh` and `--target-dependents` (#4627): each reaches the
3
+ * planned members' capability plans through `DeployContext`, the digest
4
+ * binds it, `--target-dependents` needs a target, a member whose capability
5
+ * cannot honour one is refused by name before anything plans, and pr-apply
6
+ * takes neither. The setup is pr-plan-targets.test.ts's. Written for the
7
+ * ci-products post-merge pass.
8
+ */
9
+
10
+ import { mkdtemp, readFile, rm } from "node:fs/promises";
11
+ import { tmpdir } from "node:os";
12
+ import { join } from "node:path";
13
+ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
14
+ import type { DriverComponent } from "../../components/driver";
15
+ import type { DeployContext } from "../../components/capability";
16
+ import type { ParsedArgs } from "../registry";
17
+
18
+ const HEAD = "a".repeat(40);
19
+ const BASE = "b".repeat(40);
20
+
21
+ vi.mock("../../workspace/security", async (original) => ({
22
+ ...(await original<typeof import("../../workspace/security")>()),
23
+ securityGroupsAt: () => new Set<string>(),
24
+ }));
25
+ vi.mock("../../components/pr-hooks", async (original) => ({
26
+ ...(await original<typeof import("../../components/pr-hooks")>()),
27
+ prLoopHooksAt: (_cwd: string, base: string) => ({ hooks: {}, base }),
28
+ }));
29
+ vi.mock("../../workspace/ci-locks", () => ({ ciLocksAt: () => null }));
30
+ vi.mock("../../components/pr-policy", async (original) => ({
31
+ ...(await original<typeof import("../../components/pr-policy")>()),
32
+ prLoopPolicyAt: (_cwd: string, base: string) => ({ base }),
33
+ runPrPolicy: () => undefined,
34
+ }));
35
+ vi.mock("../../components/changed-files", () => ({
36
+ resolveCommit: async () => HEAD,
37
+ resolveMergeBase: async () => BASE,
38
+ }));
39
+ vi.mock("../../config", async () => {
40
+ const actual = await vi.importActual<typeof import("../../config")>("../../config");
41
+ return { ...actual, loadChantConfig: async () => ({ config: {} }) };
42
+ });
43
+ vi.mock("./fan-out", () => ({
44
+ resolveChangedUnits: async () => ({ units: { changed: ["net"], indeterminate: [] } }),
45
+ }));
46
+ vi.mock("../../lifecycle/git", async () => {
47
+ const actual = await vi.importActual<typeof import("../../lifecycle/git")>("../../lifecycle/git");
48
+ return { ...actual, pushLifecycleReport: async () => { throw new Error("pr-plan-flags.test must not push chant/lifecycle"); }, pushLifecycleRebasing: async () => { throw new Error("pr-plan-flags.test must not push chant/lifecycle"); } };
49
+ });
50
+ vi.mock("./run", () => ({
51
+ GATED_EXIT_CODE: 3,
52
+ autoReleaseRun: (id: string) => ({ runId: id, runOrigin: { forge: "local" } }),
53
+ recordAutoReleasesForRun: async () => [],
54
+ }));
55
+ let gateLedger: ReturnType<typeof import("../../op/gate").memoryGateLedgerPort>;
56
+ vi.mock("../../op/gate", async () => {
57
+ const actual = await vi.importActual<typeof import("../../op/gate")>("../../op/gate");
58
+ return { ...actual, gitGateLedgerPort: () => gateLedger, gateIsSealed: async () => false };
59
+ });
60
+
61
+ /** The targets each member's plan was asked for. */
62
+ const asked = new Map<string, string[] | undefined>();
63
+ /** The plan flags each member's plan was asked for (#4627). */
64
+ const flagsAsked = new Map<string, { refresh: boolean; targetDependents: boolean }>();
65
+ let estate: DriverComponent[] = [];
66
+ vi.mock("../../components/fan-out-support", async () => {
67
+ const { CapabilityRegistry } = await import("../../components/capability");
68
+ const { planFanOut } = await import("../../components/fan-out");
69
+ const { computePlanDigest } = await import("../../lifecycle/plan-digest");
70
+ const registry = new CapabilityRegistry();
71
+ const plan = (kind: string) => async (ctx: DeployContext, input: { root: string }) => {
72
+ asked.set(input.root, ctx.targets);
73
+ flagsAsked.set(input.root, { refresh: ctx.refresh === true, targetDependents: ctx.targetDependents === true });
74
+ const planDigest = computePlanDigest(kind, { root: input.root });
75
+ return {
76
+ member: input.root,
77
+ planDigest,
78
+ artifact: { planDigest },
79
+ ...(ctx.targets ? { targets: ctx.targets } : {}),
80
+ changeSet: { member: { member: input.root, lexicon: "terraform", planner: "tofu", status: "planned", planDigest, holes: [] }, entries: [] },
81
+ };
82
+ };
83
+ registry.register({ kind: "narrowing-root", targets: "accept", planFlags: { refresh: "accept", targetDependents: "accept" }, plan: plan("narrowing-root"), async outputs() { return {}; }, async run() { return { outputs: {} }; } } as never);
84
+ registry.register({ kind: "whole-root", targets: "accept", planFlags: { refresh: "accept", targetDependents: { refuse: "a whole-root has no flag for dependents" } }, plan: plan("whole-root"), async outputs() { return {}; }, async run() { return { outputs: {} }; } } as never);
85
+ return {
86
+ fanOutRegistry: async () => registry,
87
+ deriveFanOut: async () => ({
88
+ success: true,
89
+ components: estate,
90
+ plan: planFanOut({ components: estate, changed: estate.map((c) => c.name) }),
91
+ signal: { changed: estate.map((c) => c.name), indeterminate: [], unclaimed: [] },
92
+ }),
93
+ };
94
+ });
95
+
96
+ const root = (name: string, kind = "narrowing-root"): DriverComponent => ({ name, dependsOn: [], deploy: [{ phase: "Apply", steps: [{ kind, root: name }] }] });
97
+
98
+ const { memoryGateLedgerPort } = await import("../../op/gate");
99
+ const { runComponentsPrApply, runComponentsPrPlan } = await import("./pr");
100
+
101
+ let dir: string;
102
+ let errors: string[];
103
+
104
+ const ctx = (a: Partial<ParsedArgs>) =>
105
+ ({ args: { command: "components", path: "pr-plan", format: "", fix: false, watch: false, verbose: false, help: false, live: false, base: "main", env: "prod", output: dir, pr: 12, ...a } as ParsedArgs, plugins: [] }) as never;
106
+
107
+ beforeEach(async () => {
108
+ dir = await mkdtemp(join(tmpdir(), "pr-targets-"));
109
+ errors = [];
110
+ asked.clear();
111
+ flagsAsked.clear();
112
+ estate = [root("net"), root("app")];
113
+ gateLedger = memoryGateLedgerPort();
114
+ vi.spyOn(process.stdout, "write").mockImplementation(() => true);
115
+ vi.spyOn(console, "error").mockImplementation((...m: unknown[]) => { errors.push(m.map(String).join(" ")); });
116
+ vi.spyOn(console, "log").mockImplementation(() => {});
117
+ });
118
+
119
+ afterEach(async () => {
120
+ vi.restoreAllMocks();
121
+ await rm(dir, { recursive: true, force: true });
122
+ });
123
+
124
+ const digest = async (): Promise<string> => JSON.parse(await readFile(join(dir, "pr-plan.json"), "utf8")).digest as string;
125
+
126
+ describe("pr-plan --refresh and --target-dependents (#4627)", () => {
127
+ test("--refresh reaches every plan, and the digest binds it", async () => {
128
+ expect(await runComponentsPrPlan(ctx({}))).toBe(0);
129
+ const plain = await digest();
130
+ expect(await runComponentsPrPlan(ctx({ refresh: true }))).toBe(0);
131
+ expect(flagsAsked.get("net")).toEqual({ refresh: true, targetDependents: false });
132
+ expect(await digest()).not.toBe(plain);
133
+ });
134
+
135
+ test("--target-dependents reaches the targeted members' plans, and moves the digest", async () => {
136
+ expect(await runComponentsPrPlan(ctx({ targets: ["net:module.vpc"] }))).toBe(0);
137
+ const narrowed = await digest();
138
+ expect(await runComponentsPrPlan(ctx({ targets: ["net:module.vpc"], targetDependents: true }))).toBe(0);
139
+ expect(flagsAsked.get("net")).toEqual({ refresh: false, targetDependents: true });
140
+ expect(flagsAsked.get("app")).toEqual({ refresh: false, targetDependents: false });
141
+ expect(await digest()).not.toBe(narrowed);
142
+ });
143
+
144
+ test("--target-dependents without a target is refused", async () => {
145
+ expect(await runComponentsPrPlan(ctx({ targetDependents: true }))).toBe(1);
146
+ expect(flagsAsked.size).toBe(0);
147
+ expect(errors.join("\n")).toMatch(/widens a --target/);
148
+ });
149
+
150
+ test("a member whose capability cannot widen is refused by name, before anything plans", async () => {
151
+ estate = [root("net"), root("db", "whole-root")];
152
+ expect(await runComponentsPrPlan(ctx({ targets: ["aws_s3_bucket.logs"], targetDependents: true }))).toBe(1);
153
+ expect(flagsAsked.size).toBe(0);
154
+ expect(errors.join("\n")).toMatch(/whole-root refuses --target-dependents: a whole-root has no flag for dependents/);
155
+ });
156
+
157
+ test("pr-apply takes neither", async () => {
158
+ expect(await runComponentsPrApply(ctx({ path: "pr-apply", refresh: true }))).toBe(1);
159
+ expect(errors.join("\n")).toMatch(/takes no --refresh/);
160
+ });
161
+ });
@@ -44,7 +44,7 @@ vi.mock("./fan-out", () => ({
44
44
  }));
45
45
  vi.mock("../../lifecycle/git", async () => {
46
46
  const actual = await vi.importActual<typeof import("../../lifecycle/git")>("../../lifecycle/git");
47
- return { ...actual, pushLifecycleReport: async () => { throw new Error("pr-plan-targets.test must not push chant/lifecycle"); } };
47
+ return { ...actual, pushLifecycleReport: async () => { throw new Error("pr-plan-targets.test must not push chant/lifecycle"); }, pushLifecycleRebasing: async () => { throw new Error("pr-plan-targets.test must not push chant/lifecycle"); } };
48
48
  });
49
49
  vi.mock("./run", () => ({
50
50
  GATED_EXIT_CODE: 3,
@@ -44,14 +44,20 @@ vi.mock("../../lifecycle/gate-change-set", () => ({
44
44
  }));
45
45
  vi.mock("../../lifecycle/git", async () => {
46
46
  const actual = await vi.importActual<typeof import("../../lifecycle/git")>("../../lifecycle/git");
47
- return { ...actual, pushLifecycleReport: async () => { throw new Error("pr.test must not push chant/lifecycle"); } };
47
+ return { ...actual, pushLifecycleReport: async () => { throw new Error("pr.test must not push chant/lifecycle"); }, pushLifecycleRebasing: async () => pushRebasing() };
48
48
  });
49
+ // The record's push: never the real one. A test that writes the record sets what it answers.
50
+ let pushRebasing: () => Promise<{ pushed: boolean; pushWarning?: string }> = async () => {
51
+ throw new Error("pr.test must not push chant/lifecycle");
52
+ };
49
53
 
50
54
  // #4168: the record job writes the merge record on chant/lifecycle. Captured here, never written.
55
+ // `recordWrites` makes the write say it wrote, so the record job pushes.
51
56
  const written: Array<Record<string, unknown>> = [];
57
+ let recordWrites = false;
52
58
  vi.mock("../../lifecycle/merge-record", async () => {
53
59
  const actual = await vi.importActual<typeof import("../../lifecycle/merge-record")>("../../lifecycle/merge-record");
54
- return { ...actual, writeMergeRecord: async (r: Record<string, unknown>) => (written.push(r), { commit: null, written: false }) };
60
+ return { ...actual, writeMergeRecord: async (r: Record<string, unknown>) => (written.push(r), recordWrites ? { commit: "c".repeat(40), written: true } : { commit: null, written: false }) };
55
61
  });
56
62
 
57
63
  vi.mock("./run", () => ({
@@ -131,6 +137,10 @@ beforeEach(async () => {
131
137
  errors = [];
132
138
  applied = [];
133
139
  written.length = 0;
140
+ recordWrites = false;
141
+ pushRebasing = async () => {
142
+ throw new Error("pr.test must not push chant/lifecycle");
143
+ };
134
144
  failing.clear();
135
145
  refusal.clear();
136
146
  onRun = (r) => applied.push(r);
@@ -191,6 +201,28 @@ describe("pr-record (#4168)", () => {
191
201
  expect(written[0]).toMatchObject({ source: { kind: "direct-push" }, op: null, plan: "unapproved" });
192
202
  });
193
203
 
204
+ // #4551: the merge record goes out through the fetch-replay-retry push, and one that never reaches the remote fails the job.
205
+ test("a merge record pushed through the retrying push exits 0", async () => {
206
+ recordWrites = true;
207
+ let pushes = 0;
208
+ pushRebasing = async () => (pushes++, { pushed: true });
209
+ expect(await runComponentsPrRecord(ctx({ pr: 12 }))).toBe(0);
210
+ expect(pushes).toBe(1);
211
+ });
212
+
213
+ test("a merge record the remote never takes fails the job with LifecyclePushLostError's words, and the report is still written", async () => {
214
+ const { LifecyclePushLostError } = await vi.importActual<typeof import("../../lifecycle/git")>("../../lifecycle/git");
215
+ recordWrites = true;
216
+ pushRebasing = async () => {
217
+ throw new LifecyclePushLostError("origin", 3, "another writer pushed before each try");
218
+ };
219
+ expect(await runComponentsPrRecord(ctx({ pr: 12 }))).toBe(1);
220
+ expect(report("record")).toMatchObject({ status: "recorded", pr: 12 });
221
+ const said = errors.join("\n");
222
+ expect(said).toContain(`the merge record for ${HEAD} was written but not pushed`);
223
+ expect(said).toContain('chant/lifecycle was not pushed to "origin" after 3 tries');
224
+ });
225
+
194
226
  test("a member that fails to plan is recorded as plan-failed and exits 1", async () => {
195
227
  const plan = vi.spyOn(await import("../../components/pr-run"), "planPrSet");
196
228
  plan.mockImplementationOnce(async (input) => ({ ...(await (await vi.importActual<typeof import("../../components/pr-run")>("../../components/pr-run")).planPrSet(input)), failed: true }));
@@ -50,7 +50,7 @@ vi.mock("../../lifecycle/gate-change-set", () => ({
50
50
  }));
51
51
  vi.mock("../../lifecycle/git", async () => {
52
52
  const actual = await vi.importActual<typeof import("../../lifecycle/git")>("../../lifecycle/git");
53
- return { ...actual, pushLifecycleReport: async () => { throw new Error("pr-waves.test must not push chant/lifecycle"); } };
53
+ return { ...actual, pushLifecycleReport: async () => { throw new Error("pr-waves.test must not push chant/lifecycle"); }, pushLifecycleRebasing: async () => { throw new Error("pr-waves.test must not push chant/lifecycle"); } };
54
54
  });
55
55
 
56
56
  // The declaration at base sets no hooks, policy, security group or lock, and the change adds no migration (#4502).
@@ -45,7 +45,7 @@ vi.mock("../../lifecycle/gate-change-set", () => ({
45
45
  }));
46
46
  vi.mock("../../lifecycle/git", async () => {
47
47
  const actual = await vi.importActual<typeof import("../../lifecycle/git")>("../../lifecycle/git");
48
- return { ...actual, pushLifecycleReport: async () => { throw new Error("pr-waves.test must not push chant/lifecycle"); } };
48
+ return { ...actual, pushLifecycleReport: async () => { throw new Error("pr-waves.test must not push chant/lifecycle"); }, pushLifecycleRebasing: async () => { throw new Error("pr-waves.test must not push chant/lifecycle"); } };
49
49
  });
50
50
 
51
51
  vi.mock("./run", () => ({
@@ -78,7 +78,7 @@ vi.mock("../../lifecycle/gate-change-set", () => ({
78
78
  }));
79
79
  vi.mock("../../lifecycle/git", async () => {
80
80
  const actual = await vi.importActual<typeof import("../../lifecycle/git")>("../../lifecycle/git");
81
- return { ...actual, pushLifecycleReport: async () => { throw new Error("pr.test must not push chant/lifecycle"); } };
81
+ return { ...actual, pushLifecycleReport: async () => { throw new Error("pr.test must not push chant/lifecycle"); }, pushLifecycleRebasing: async () => { throw new Error("pr.test must not push chant/lifecycle"); } };
82
82
  });
83
83
 
84
84
  vi.mock("./run", () => ({