@intentius/chant 0.124.55 → 0.124.56

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 (370) 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 +12 -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 -3
  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/pr.d.ts +5 -0
  58. package/dist/cli/handlers/pr.d.ts.map +1 -1
  59. package/dist/cli/handlers/pr.js +259 -4
  60. package/dist/cli/handlers/run-wave.js +89 -1
  61. package/dist/cli/main.d.ts.map +1 -1
  62. package/dist/cli/main.js +56 -2
  63. package/dist/cli/parse-args.d.ts.map +1 -1
  64. package/dist/cli/parse-args.js +107 -0
  65. package/dist/cli/registry.d.ts +38 -0
  66. package/dist/cli/registry.d.ts.map +1 -1
  67. package/dist/components/adoption.d.ts.map +1 -1
  68. package/dist/components/adoption.js +1 -2
  69. package/dist/components/capability.d.ts +37 -0
  70. package/dist/components/capability.d.ts.map +1 -1
  71. package/dist/components/capability.js +25 -0
  72. package/dist/components/check-hooks.d.ts +4 -1
  73. package/dist/components/check-hooks.d.ts.map +1 -1
  74. package/dist/components/check-steps.d.ts +74 -0
  75. package/dist/components/check-steps.d.ts.map +1 -0
  76. package/dist/components/check-steps.js +102 -0
  77. package/dist/components/ci-services.d.ts.map +1 -1
  78. package/dist/components/ci-services.js +1 -2
  79. package/dist/components/driver.d.ts +12 -0
  80. package/dist/components/driver.d.ts.map +1 -1
  81. package/dist/components/driver.js +35 -1
  82. package/dist/components/groups.d.ts.map +1 -1
  83. package/dist/components/groups.js +4 -3
  84. package/dist/components/pr-env-ledger.d.ts.map +1 -1
  85. package/dist/components/pr-env-ledger.js +1 -2
  86. package/dist/components/pr-environment.d.ts +1 -1
  87. package/dist/components/pr-environment.d.ts.map +1 -1
  88. package/dist/components/pr-environment.js +1 -1
  89. package/dist/components/pr-pipeline.d.ts +129 -3
  90. package/dist/components/pr-pipeline.d.ts.map +1 -1
  91. package/dist/components/pr-pipeline.js +153 -17
  92. package/dist/components/pr-run.d.ts +8 -0
  93. package/dist/components/pr-run.d.ts.map +1 -1
  94. package/dist/components/pr-run.js +9 -4
  95. package/dist/components/product-pipeline.d.ts +35 -2
  96. package/dist/components/product-pipeline.d.ts.map +1 -1
  97. package/dist/components/product-pipeline.js +24 -5
  98. package/dist/components/wave-plan.d.ts +8 -0
  99. package/dist/components/wave-plan.d.ts.map +1 -1
  100. package/dist/components/wave-plan.js +18 -2
  101. package/dist/e2e-harness/bucket.d.ts +21 -0
  102. package/dist/e2e-harness/bucket.d.ts.map +1 -0
  103. package/dist/e2e-harness/bucket.js +61 -0
  104. package/dist/e2e-harness/claim.d.ts +70 -0
  105. package/dist/e2e-harness/claim.d.ts.map +1 -0
  106. package/dist/e2e-harness/claim.js +98 -0
  107. package/dist/e2e-harness/driver.d.ts +64 -0
  108. package/dist/e2e-harness/driver.d.ts.map +1 -0
  109. package/dist/e2e-harness/driver.js +243 -0
  110. package/dist/e2e-harness/forgejo.d.ts +77 -0
  111. package/dist/e2e-harness/forgejo.d.ts.map +1 -0
  112. package/dist/e2e-harness/forgejo.js +205 -0
  113. package/dist/e2e-harness/git.d.ts +32 -0
  114. package/dist/e2e-harness/git.d.ts.map +1 -0
  115. package/dist/e2e-harness/git.js +67 -0
  116. package/dist/e2e-harness/index.d.ts +22 -0
  117. package/dist/e2e-harness/index.d.ts.map +1 -0
  118. package/dist/e2e-harness/index.js +48 -0
  119. package/dist/e2e-harness/jobs.d.ts +8 -0
  120. package/dist/e2e-harness/jobs.d.ts.map +1 -0
  121. package/dist/e2e-harness/jobs.js +34 -0
  122. package/dist/e2e-harness/pins.d.ts +45 -0
  123. package/dist/e2e-harness/pins.d.ts.map +1 -0
  124. package/dist/e2e-harness/pins.js +44 -0
  125. package/dist/e2e-harness/ports.d.ts +113 -0
  126. package/dist/e2e-harness/ports.d.ts.map +1 -0
  127. package/dist/e2e-harness/ports.js +4 -0
  128. package/dist/e2e-harness/reports.d.ts +45 -0
  129. package/dist/e2e-harness/reports.d.ts.map +1 -0
  130. package/dist/e2e-harness/reports.js +57 -0
  131. package/dist/e2e-harness/safe-run-cli.d.ts +17 -0
  132. package/dist/e2e-harness/safe-run-cli.d.ts.map +1 -0
  133. package/dist/e2e-harness/safe-run-cli.js +43 -0
  134. package/dist/e2e-harness/safe-run.d.ts +61 -0
  135. package/dist/e2e-harness/safe-run.d.ts.map +1 -0
  136. package/dist/e2e-harness/safe-run.js +172 -0
  137. package/dist/e2e-harness/scenario.d.ts +11 -0
  138. package/dist/e2e-harness/scenario.d.ts.map +1 -0
  139. package/dist/e2e-harness/scenario.js +89 -0
  140. package/dist/e2e-harness/schemas/demo-cycle.schema.json +282 -0
  141. package/dist/e2e-harness/schemas/demo-step.schema.json +245 -0
  142. package/dist/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
  143. package/dist/e2e-harness/schemas/e2e-claims.schema.json +18 -0
  144. package/dist/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
  145. package/dist/e2e-harness/schemas/index.d.ts +191 -0
  146. package/dist/e2e-harness/schemas/index.d.ts.map +1 -0
  147. package/dist/e2e-harness/schemas/index.js +62 -0
  148. package/dist/e2e-harness/stack.d.ts +124 -0
  149. package/dist/e2e-harness/stack.d.ts.map +1 -0
  150. package/dist/e2e-harness/stack.js +207 -0
  151. package/dist/e2e-harness/steps.d.ts +11 -0
  152. package/dist/e2e-harness/steps.d.ts.map +1 -0
  153. package/dist/e2e-harness/steps.js +22 -0
  154. package/dist/e2e-harness.d.ts +3 -0
  155. package/dist/e2e-harness.d.ts.map +1 -0
  156. package/dist/e2e-harness.js +2 -0
  157. package/dist/exit-codes.d.ts +7 -1
  158. package/dist/exit-codes.d.ts.map +1 -1
  159. package/dist/exit-codes.js +7 -1
  160. package/dist/lexicon.d.ts +46 -0
  161. package/dist/lexicon.d.ts.map +1 -1
  162. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  163. package/dist/lifecycle/gate-ledger.js +2 -3
  164. package/dist/lifecycle/gated-request.d.ts.map +1 -1
  165. package/dist/lifecycle/gated-request.js +1 -2
  166. package/dist/lifecycle/query.d.ts.map +1 -1
  167. package/dist/lifecycle/query.js +4 -5
  168. package/dist/lifecycle/release-catalog.d.ts.map +1 -1
  169. package/dist/lifecycle/release-catalog.js +1 -1
  170. package/dist/lifecycle/release-ledger.d.ts.map +1 -1
  171. package/dist/lifecycle/release-ledger.js +1 -2
  172. package/dist/lifecycle/release-status.d.ts +20 -0
  173. package/dist/lifecycle/release-status.d.ts.map +1 -1
  174. package/dist/lifecycle/release-status.js +1 -22
  175. package/dist/lifecycle/wave-plans.d.ts +23 -7
  176. package/dist/lifecycle/wave-plans.d.ts.map +1 -1
  177. package/dist/lifecycle/wave-plans.js +9 -2
  178. package/dist/op/approval-status.d.ts +103 -0
  179. package/dist/op/approval-status.d.ts.map +1 -0
  180. package/dist/op/approval-status.js +197 -0
  181. package/dist/op/index.d.ts +1 -1
  182. package/dist/op/index.d.ts.map +1 -1
  183. package/dist/op/index.js +1 -1
  184. package/dist/op/op-waves-capability-spec.d.ts +8 -0
  185. package/dist/op/op-waves-capability-spec.d.ts.map +1 -1
  186. package/dist/op/op-waves-capability-spec.js +21 -0
  187. package/dist/op/op-waves-release.d.ts.map +1 -1
  188. package/dist/op/op-waves-release.js +1 -2
  189. package/dist/op/op-waves-run.d.ts +7 -2
  190. package/dist/op/op-waves-run.d.ts.map +1 -1
  191. package/dist/op/op-waves-run.js +96 -4
  192. package/dist/op/op-waves-stand-down.d.ts.map +1 -1
  193. package/dist/op/op-waves-stand-down.js +1 -2
  194. package/dist/op/op-waves.d.ts +35 -0
  195. package/dist/op/op-waves.d.ts.map +1 -1
  196. package/dist/op/op-waves.js +46 -6
  197. package/dist/op/runtime.d.ts +4 -0
  198. package/dist/op/runtime.d.ts.map +1 -1
  199. package/dist/op/runtime.js +2 -3
  200. package/dist/otlp.d.ts.map +1 -1
  201. package/dist/otlp.js +1 -2
  202. package/dist/parallelism.d.ts +17 -0
  203. package/dist/parallelism.d.ts.map +1 -0
  204. package/dist/parallelism.js +33 -0
  205. package/dist/policy-source.d.ts.map +1 -1
  206. package/dist/policy-source.js +1 -2
  207. package/dist/pr-forge.d.ts.map +1 -1
  208. package/dist/pr-forge.js +56 -39
  209. package/dist/pr-loop.d.ts +9 -0
  210. package/dist/pr-loop.d.ts.map +1 -1
  211. package/dist/pr-loop.js +22 -3
  212. package/dist/pr-merge.d.ts +64 -0
  213. package/dist/pr-merge.d.ts.map +1 -0
  214. package/dist/pr-merge.js +78 -0
  215. package/dist/pr-post.d.ts +70 -1
  216. package/dist/pr-post.d.ts.map +1 -1
  217. package/dist/pr-post.js +116 -5
  218. package/dist/pr-report-url.d.ts.map +1 -1
  219. package/dist/pr-report-url.js +1 -2
  220. package/dist/release-floors.d.ts +1 -1
  221. package/dist/release-floors.js +1 -1
  222. package/dist/run-event.d.ts.map +1 -1
  223. package/dist/run-event.js +1 -2
  224. package/dist/scheduled-op-cloud.d.ts +32 -0
  225. package/dist/scheduled-op-cloud.d.ts.map +1 -0
  226. package/dist/scheduled-op-cloud.js +69 -0
  227. package/dist/wave-runtime.mjs +340 -327
  228. package/dist/workspace/ci-lock-grain.d.ts +5 -0
  229. package/dist/workspace/ci-lock-grain.d.ts.map +1 -1
  230. package/dist/workspace/ci-lock-grain.js +1 -7
  231. package/dist/workspace/ci-run.d.ts.map +1 -1
  232. package/dist/workspace/ci-run.js +5 -1
  233. package/dist/workspace/pr-report.schema.json +5 -0
  234. package/package.json +1 -1
  235. package/src/ci-agent.ts +1 -2
  236. package/src/ci-audit/__fixtures__/cloudtrail-lookup-bucket.json +37 -0
  237. package/src/ci-audit/__fixtures__/cloudtrail-writes-window.json +59 -0
  238. package/src/ci-audit/attribution.ts +260 -0
  239. package/src/ci-audit/audit-log.ts +220 -0
  240. package/src/ci-audit/ci-audit.test.ts +175 -0
  241. package/src/ci-audit/index.ts +15 -0
  242. package/src/ci-audit/unrecorded.ts +140 -0
  243. package/src/ci-audit.ts +2 -0
  244. package/src/ci-control.ts +3 -4
  245. package/src/ci-estate.ts +1 -2
  246. package/src/ci-identity-database.test.ts +2 -3
  247. package/src/ci-identity-targets.test.ts +1 -3
  248. package/src/ci-identity.ts +2 -3
  249. package/src/ci-job-guard.test.ts +154 -0
  250. package/src/ci-job-guard.ts +319 -0
  251. package/src/ci-jobs.ts +8 -0
  252. package/src/ci-product-comment-targets.test.ts +45 -0
  253. package/src/ci-product-words.ts +35 -6
  254. package/src/ci-product.ts +55 -3
  255. package/src/ci-respond-run.ts +291 -0
  256. package/src/ci-respond.test.ts +264 -0
  257. package/src/ci-respond.ts +412 -0
  258. package/src/cli/handlers/audit-log.ts +74 -0
  259. package/src/cli/handlers/build-pr-loop-flags.test.ts +98 -0
  260. package/src/cli/handlers/build.ts +69 -0
  261. package/src/cli/handlers/ci-check-job.test.ts +114 -0
  262. package/src/cli/handlers/ci-check-job.ts +33 -0
  263. package/src/cli/handlers/ci-check.ts +38 -8
  264. package/src/cli/handlers/e2e-safe-run.ts +27 -0
  265. package/src/cli/handlers/pr-plan-comment-targets.test.ts +166 -0
  266. package/src/cli/handlers/pr-plan-flags.test.ts +161 -0
  267. package/src/cli/handlers/pr.ts +228 -4
  268. package/src/cli/handlers/run-wave.ts +79 -1
  269. package/src/cli/main.test.ts +1 -1
  270. package/src/cli/main.ts +56 -2
  271. package/src/cli/parse-args.ts +77 -0
  272. package/src/cli/registry.ts +38 -0
  273. package/src/components/adoption.ts +1 -2
  274. package/src/components/capability.ts +50 -0
  275. package/src/components/check-hooks.ts +4 -1
  276. package/src/components/check-steps.test.ts +70 -0
  277. package/src/components/check-steps.ts +158 -0
  278. package/src/components/ci-services.ts +1 -2
  279. package/src/components/driver.ts +35 -1
  280. package/src/components/groups.ts +4 -2
  281. package/src/components/plan-flags.test.ts +46 -0
  282. package/src/components/pr-comment-preview-targets.test.ts +34 -0
  283. package/src/components/pr-env-ledger.ts +1 -2
  284. package/src/components/pr-env-run-bundle.test.ts +0 -20
  285. package/src/components/pr-environment.ts +1 -1
  286. package/src/components/pr-pipeline-runners.test.ts +80 -0
  287. package/src/components/pr-pipeline.ts +232 -17
  288. package/src/components/pr-run.ts +17 -6
  289. package/src/components/pr-stale-job.test.ts +34 -0
  290. package/src/components/product-pipeline.ts +50 -8
  291. package/src/components/wave-plan.ts +18 -2
  292. package/src/e2e-harness/__project__/chant.config.ts +4 -0
  293. package/src/e2e-harness/__project__/src/compose.ts +33 -0
  294. package/src/e2e-harness/bucket.ts +69 -0
  295. package/src/e2e-harness/claim.test.ts +150 -0
  296. package/src/e2e-harness/claim.ts +140 -0
  297. package/src/e2e-harness/driver.test.ts +304 -0
  298. package/src/e2e-harness/driver.ts +294 -0
  299. package/src/e2e-harness/forgejo.ts +267 -0
  300. package/src/e2e-harness/git.ts +96 -0
  301. package/src/e2e-harness/index.ts +50 -0
  302. package/src/e2e-harness/jobs.ts +35 -0
  303. package/src/e2e-harness/pins.ts +52 -0
  304. package/src/e2e-harness/ports.ts +130 -0
  305. package/src/e2e-harness/reports.ts +79 -0
  306. package/src/e2e-harness/safe-run-cli.test.ts +102 -0
  307. package/src/e2e-harness/safe-run-cli.ts +54 -0
  308. package/src/e2e-harness/safe-run.ts +198 -0
  309. package/src/e2e-harness/scenario.ts +89 -0
  310. package/src/e2e-harness/schemas/README.md +62 -0
  311. package/src/e2e-harness/schemas/demo-cycle.schema.json +282 -0
  312. package/src/e2e-harness/schemas/demo-step.schema.json +245 -0
  313. package/src/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
  314. package/src/e2e-harness/schemas/e2e-claims.schema.json +18 -0
  315. package/src/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
  316. package/src/e2e-harness/schemas/index.ts +220 -0
  317. package/src/e2e-harness/schemas.test.ts +145 -0
  318. package/src/e2e-harness/stack.test.ts +124 -0
  319. package/src/e2e-harness/stack.ts +306 -0
  320. package/src/e2e-harness/steps.ts +30 -0
  321. package/src/e2e-harness.ts +2 -0
  322. package/src/exit-codes.test.ts +3 -2
  323. package/src/exit-codes.ts +7 -1
  324. package/src/gate-decision-bundle.test.ts +0 -2
  325. package/src/lexicon.ts +48 -0
  326. package/src/lifecycle/control-entries-ledger.test.ts +2 -3
  327. package/src/lifecycle/gate-ledger.ts +2 -3
  328. package/src/lifecycle/gated-request.ts +1 -2
  329. package/src/lifecycle/query.ts +4 -5
  330. package/src/lifecycle/release-catalog.test.ts +3 -4
  331. package/src/lifecycle/release-catalog.ts +1 -1
  332. package/src/lifecycle/release-ledger.ts +1 -2
  333. package/src/lifecycle/release-status.test.ts +3 -4
  334. package/src/lifecycle/release-status.ts +1 -2
  335. package/src/lifecycle/wave-plans.ts +33 -5
  336. package/src/op/approval-status.test.ts +134 -0
  337. package/src/op/approval-status.ts +235 -0
  338. package/src/op/gate-review.test.ts +2 -1
  339. package/src/op/index.ts +2 -0
  340. package/src/op/op-waves-after-plan.test.ts +12 -0
  341. package/src/op/op-waves-capability-spec.ts +20 -0
  342. package/src/op/op-waves-parallelism.test.ts +89 -0
  343. package/src/op/op-waves-pull-request.test.ts +78 -1
  344. package/src/op/op-waves-release.ts +1 -2
  345. package/src/op/op-waves-run.ts +94 -4
  346. package/src/op/op-waves-stand-down.ts +1 -2
  347. package/src/op/op-waves.ts +63 -6
  348. package/src/op/runtime.ts +6 -3
  349. package/src/otlp.ts +1 -2
  350. package/src/parallelism.test.ts +38 -0
  351. package/src/parallelism.ts +33 -0
  352. package/src/policy-source.ts +1 -2
  353. package/src/pr-forge-bundle.test.ts +1 -1
  354. package/src/pr-forge.ts +54 -35
  355. package/src/pr-loop-bundle.test.ts +1 -1
  356. package/src/pr-loop-narrowed.test.ts +63 -0
  357. package/src/pr-loop.ts +30 -3
  358. package/src/pr-merge.test.ts +100 -0
  359. package/src/pr-merge.ts +105 -0
  360. package/src/pr-post-stale.test.ts +163 -0
  361. package/src/pr-post.ts +159 -5
  362. package/src/pr-report-url.ts +1 -2
  363. package/src/product-subpaths-plain-node.e2e.test.ts +1 -0
  364. package/src/release-floors.ts +1 -1
  365. package/src/run-event.ts +1 -2
  366. package/src/scheduled-op-cloud.ts +68 -0
  367. package/src/stage-hooks-bundle.test.ts +0 -2
  368. package/src/workspace/ci-lock-grain.ts +1 -2
  369. package/src/workspace/ci-run.ts +5 -1
  370. package/src/workspace/pr-report.schema.json +5 -0
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The e2e harness's contracts (chant#4587) and their validators: the fan-out
3
+ * demo's demo-step/v1 and demo-cycle/v1 (#4085 section 3, #4092, moved here
4
+ * from examples/fan-out-estate/demo/schemas), and the harness's own
5
+ * e2e-scenario/v1, e2e-claim-row/v1 and e2e-claims/v1. The schemas are the
6
+ * source of truth; the types follow them.
7
+ */
8
+ import { createRequire } from "node:module";
9
+ import { loadAjv2020 } from "../../workspace/ajv2020.js";
10
+ const require = createRequire(import.meta.url);
11
+ const stepSchema = require("./demo-step.schema.json");
12
+ const cycleSchema = require("./demo-cycle.schema.json");
13
+ const scenarioSchema = require("./e2e-scenario.schema.json");
14
+ const claimRowSchema = require("./e2e-claim-row.schema.json");
15
+ const claimsSchema = require("./e2e-claims.schema.json");
16
+ export const DEMO_STEP_SCHEMA = "https://intentius.io/chant/schemas/demo/demo-step/v1/demo-step.schema.json";
17
+ export const DEMO_CYCLE_SCHEMA = "https://intentius.io/chant/schemas/demo/demo-cycle/v1/demo-cycle.schema.json";
18
+ export const E2E_SCENARIO_SCHEMA = "https://intentius.io/chant/schemas/e2e-harness/e2e-scenario/v1/e2e-scenario.schema.json";
19
+ export const E2E_CLAIM_ROW_SCHEMA = "https://intentius.io/chant/schemas/e2e-harness/e2e-claim-row/v1/e2e-claim-row.schema.json";
20
+ export const E2E_CLAIMS_SCHEMA = "https://intentius.io/chant/schemas/e2e-harness/e2e-claims/v1/e2e-claims.schema.json";
21
+ // ── demo-step/v1 and demo-cycle/v1 ────────────────────────────────────
22
+ export const DEMO_STEPS = [
23
+ "pull-request",
24
+ "planned",
25
+ "waiting",
26
+ "approved",
27
+ "merged",
28
+ "applying",
29
+ "failed",
30
+ "resumed",
31
+ "applied",
32
+ "reset",
33
+ "stalled",
34
+ ];
35
+ // ── e2e-scenario/v1 ───────────────────────────────────────────────────
36
+ export const SCENARIO_STEP_KINDS = ["open", "open-concurrent", "plan", "approve", "merge", "apply", "out-of-band", "kill-job"];
37
+ let ajv;
38
+ function validatorFor(id) {
39
+ if (!ajv) {
40
+ const Ajv = loadAjv2020();
41
+ const made = new Ajv({ allErrors: true, strict: true });
42
+ for (const s of [stepSchema, cycleSchema, scenarioSchema, claimRowSchema, claimsSchema])
43
+ made.addSchema(s);
44
+ ajv = made;
45
+ }
46
+ const fn = ajv.getSchema(id);
47
+ if (!fn)
48
+ throw new Error(`no schema ${id}`);
49
+ return fn;
50
+ }
51
+ function check(id, data) {
52
+ const fn = validatorFor(id);
53
+ if (fn(data))
54
+ return { ok: true, value: data };
55
+ const errors = (fn.errors ?? []).map((e) => `${e.instancePath || "/"} ${e.message ?? "is invalid"}`);
56
+ return { ok: false, errors };
57
+ }
58
+ export const validateDemoStep = (data) => check(DEMO_STEP_SCHEMA, data);
59
+ export const validateDemoCycle = (data) => check(DEMO_CYCLE_SCHEMA, data);
60
+ export const validateScenario = (data) => check(E2E_SCENARIO_SCHEMA, data);
61
+ export const validateClaimRow = (data) => check(E2E_CLAIM_ROW_SCHEMA, data);
62
+ export const validateClaims = (data) => check(E2E_CLAIMS_SCHEMA, data);
@@ -0,0 +1,124 @@
1
+ /**
2
+ * The service properties the harness sets, a subset of compose's. A type
3
+ * alias, not an interface: the docker lexicon's ServiceProps has an `x-` index
4
+ * signature, which only an alias's implicit index signature satisfies.
5
+ */
6
+ export type ComposeServiceSpec = {
7
+ image: string;
8
+ container_name: string;
9
+ profiles?: string[];
10
+ user?: string;
11
+ environment?: Record<string, string>;
12
+ ports?: string[];
13
+ volumes?: string[];
14
+ working_dir?: string;
15
+ command?: string[];
16
+ depends_on?: Record<string, {
17
+ condition: "service_started" | "service_healthy";
18
+ }>;
19
+ networks: Record<string, {
20
+ aliases: string[];
21
+ }>;
22
+ healthcheck?: {
23
+ test: string[];
24
+ interval: string;
25
+ timeout: string;
26
+ retries: number;
27
+ };
28
+ restart?: string;
29
+ };
30
+ export interface HarnessStackOptions {
31
+ /**
32
+ * The compose project, which also names the network, the containers and
33
+ * the volumes. Pass it to `docker compose -p` as well.
34
+ */
35
+ project: string;
36
+ /** The prefix of the port variables, `<envPrefix>_FLOCI_PORT` and so on. Default `CHANT_E2E`. */
37
+ envPrefix?: string;
38
+ /** The network's export name in the product's project. Default `harness`. */
39
+ networkKey?: string;
40
+ /** Default host ports. */
41
+ ports?: Partial<HarnessPorts>;
42
+ /**
43
+ * The address host ports bind to. Default 127.0.0.1. Null publishes on
44
+ * every interface, for a demo host whose viewers read floci from outside.
45
+ */
46
+ bind?: string | null;
47
+ /** Forgejo Actions on the instance. Default true; off when nothing on the forge runs workflows. */
48
+ forgejoActions?: boolean;
49
+ /** Another floci image, for a bench that needs the other line (pins.ts). Rows still name the one they ran on. */
50
+ flociImage?: string;
51
+ }
52
+ export interface HarnessPorts {
53
+ floci: number;
54
+ forgejo: number;
55
+ clickhouse: number;
56
+ postgres: number;
57
+ }
58
+ /** The default host ports, off every tool's own default and off terragucci's and plywood's benches. */
59
+ export declare const HARNESS_PORTS: HarnessPorts;
60
+ /** The profile the sql emulator's servers are behind. */
61
+ export declare const SQL_PROFILE = "sql";
62
+ /** Inside the network: the addresses jobs and the runner use. */
63
+ export declare const HARNESS_HOSTS: {
64
+ readonly floci: "http://floci:4566";
65
+ readonly forgejo: "http://forgejo:3000";
66
+ readonly clickhouse: "http://clickhouse:8123";
67
+ readonly postgres: "postgres://postgres:chant@postgres:5432/postgres";
68
+ };
69
+ /** Where forgejo-runner reads its config, which `forgejoRunnerConfig` writes. */
70
+ export declare const RUNNER_CONFIG_PATH = "/data/config.yml";
71
+ export interface HarnessStack {
72
+ project: string;
73
+ /** The network's properties, under `networkKey`. */
74
+ network: {
75
+ name: string;
76
+ };
77
+ networkKey: string;
78
+ /** Volumes by export name. */
79
+ volumes: {
80
+ forgejoData: {
81
+ name: string;
82
+ };
83
+ runnerData: {
84
+ name: string;
85
+ };
86
+ };
87
+ /** Services by export name, which is their compose key. */
88
+ services: {
89
+ floci: ComposeServiceSpec;
90
+ forgejo: ComposeServiceSpec;
91
+ forgejoRunner: ComposeServiceSpec;
92
+ clickhouse: ComposeServiceSpec;
93
+ postgres: ComposeServiceSpec;
94
+ };
95
+ /** The port variables, by service. */
96
+ portVars: Record<keyof HarnessPorts, string>;
97
+ }
98
+ /** A project name compose and the harness accept: lower case, digits, `-` and `_`, starting with a letter or digit. */
99
+ export declare function assertProjectName(project: string): void;
100
+ export declare function harnessStack(o: HarnessStackOptions): HarnessStack;
101
+ /** The host URLs of a stack's services, from its port variables in `env` or the defaults. */
102
+ export declare function harnessUrls(s: Pick<HarnessStack, "portVars">, env?: Record<string, string | undefined>, defaults?: HarnessPorts): Record<keyof HarnessPorts, string>;
103
+ export interface RunnerConfigOptions {
104
+ /** The project network every job container joins. */
105
+ network: string;
106
+ /** The runner's uuid and token, from POST /admin/actions/runners. */
107
+ uuid: string;
108
+ token: string;
109
+ /** The image the `docker` and `ubuntu-latest` labels run. */
110
+ jobImage: string;
111
+ /** Jobs at once. Default 4. */
112
+ capacity?: number;
113
+ /** Environment every job gets. Default floci's endpoint and test credentials. */
114
+ envs?: Record<string, string>;
115
+ }
116
+ /** What every job gets by default: AWS is floci, as a CI runner in a real account carries that account's credentials. */
117
+ export declare const RUNNER_JOB_ENV: Record<string, string>;
118
+ /**
119
+ * forgejo-runner's config (Forgejo 16, runner 13): the server connection by
120
+ * uuid and token, the job containers on the project network, no host
121
+ * mounts, and floci for AWS.
122
+ */
123
+ export declare function forgejoRunnerConfig(o: RunnerConfigOptions): string;
124
+ //# sourceMappingURL=stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../src/e2e-harness/stack.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,207 @@
1
+ /**
2
+ * The e2e harness's compose project (chant#4587), as data a chant
3
+ * docker-lexicon project wraps: floci, Forgejo and forgejo-runner with the
4
+ * docker executor on one network, and the sql emulator's ClickHouse and
5
+ * Postgres behind the `sql` profile. Every image comes from ./pins.ts.
6
+ *
7
+ * Core does not depend on the docker lexicon, so this file returns plain
8
+ * service properties. A product's project hands each to the lexicon's
9
+ * `Service`, under the key named here (compose keys are export names):
10
+ *
11
+ * ```ts
12
+ * import { Network, Service, Volume } from "@intentius/chant-lexicon-docker";
13
+ * import { harnessStack } from "@intentius/chant/e2e-harness";
14
+ * const h = harnessStack({ project: "terragucci-e2e", envPrefix: "TERRAGUCCI_E2E" });
15
+ * export const harness = new Network(h.network);
16
+ * export const floci = new Service(h.services.floci);
17
+ * ...
18
+ * ```
19
+ *
20
+ * ./project/ is that project for the whole stack, and the fan-out demo's
21
+ * stack/src/compose.ts takes floci and Forgejo from it.
22
+ *
23
+ * Two rules from terragucci's stack hold here. A forge's public URL is its
24
+ * service name (http://forgejo:3000), since inside a job container localhost
25
+ * is the job container. The network has a fixed name, the project's, and the
26
+ * runner puts every job container on it. Host ports bind to 127.0.0.1 and
27
+ * move with `<envPrefix>_<SERVICE>_PORT`, and every name carries the project,
28
+ * so two benches share a host (plywood stack/compose.yml does the same).
29
+ */
30
+ import { CLICKHOUSE_IMAGE, FLOCI_IMAGE, FORGEJO_IMAGE, FORGEJO_RUNNER_IMAGE, POSTGRES_IMAGE, POSTGRES_PASSWORD } from "./pins.js";
31
+ /** The default host ports, off every tool's own default and off terragucci's and plywood's benches. */
32
+ export const HARNESS_PORTS = { floci: 4591, forgejo: 3391, clickhouse: 8124, postgres: 5433 };
33
+ /** The profile the sql emulator's servers are behind. */
34
+ export const SQL_PROFILE = "sql";
35
+ /** Inside the network: the addresses jobs and the runner use. */
36
+ export const HARNESS_HOSTS = {
37
+ floci: "http://floci:4566",
38
+ forgejo: "http://forgejo:3000",
39
+ clickhouse: "http://clickhouse:8123",
40
+ postgres: "postgres://postgres:chant@postgres:5432/postgres",
41
+ };
42
+ /** Where forgejo-runner reads its config, which `forgejoRunnerConfig` writes. */
43
+ export const RUNNER_CONFIG_PATH = "/data/config.yml";
44
+ /** A project name compose and the harness accept: lower case, digits, `-` and `_`, starting with a letter or digit. */
45
+ export function assertProjectName(project) {
46
+ if (!/^[a-z0-9][a-z0-9_-]*$/.test(project))
47
+ throw new Error(`"${project}" is not a compose project name (lower case, digits, - and _)`);
48
+ }
49
+ export function harnessStack(o) {
50
+ assertProjectName(o.project);
51
+ const p = o.project;
52
+ const prefix = o.envPrefix ?? "CHANT_E2E";
53
+ const key = o.networkKey ?? "harness";
54
+ const ports = { ...HARNESS_PORTS, ...o.ports };
55
+ const bind = o.bind === undefined ? "127.0.0.1" : o.bind;
56
+ const portVars = {
57
+ floci: `${prefix}_FLOCI_PORT`,
58
+ forgejo: `${prefix}_FORGEJO_PORT`,
59
+ clickhouse: `${prefix}_CLICKHOUSE_PORT`,
60
+ postgres: `${prefix}_POSTGRES_PORT`,
61
+ };
62
+ const publish = (svc, inner) => `${bind ? `${bind}:` : ""}\${${portVars[svc]}:-${ports[svc]}}:${inner}`;
63
+ const on = (...aliases) => ({ [key]: { aliases } });
64
+ return {
65
+ project: p,
66
+ network: { name: p },
67
+ networkKey: key,
68
+ volumes: { forgejoData: { name: `${p}-forgejo-data` }, runnerData: { name: `${p}-runner-data` } },
69
+ portVars,
70
+ services: {
71
+ floci: {
72
+ image: o.flociImage ?? FLOCI_IMAGE,
73
+ container_name: `${p}-floci`,
74
+ ports: [publish("floci", 4566)],
75
+ networks: on("floci", "000000000000.floci"),
76
+ restart: "unless-stopped",
77
+ },
78
+ // sqlite and INSTALL_LOCK skip the web installer; the driver makes the
79
+ // admin and the people with Forgejo's own CLI.
80
+ forgejo: {
81
+ image: FORGEJO_IMAGE,
82
+ container_name: `${p}-forgejo`,
83
+ environment: {
84
+ FORGEJO__database__DB_TYPE: "sqlite3",
85
+ FORGEJO__security__INSTALL_LOCK: "true",
86
+ FORGEJO__server__DOMAIN: "forgejo",
87
+ FORGEJO__server__ROOT_URL: "http://forgejo:3000/",
88
+ FORGEJO__server__HTTP_PORT: "3000",
89
+ FORGEJO__server__DISABLE_SSH: "true",
90
+ FORGEJO__service__DISABLE_REGISTRATION: "true",
91
+ FORGEJO__actions__ENABLED: o.forgejoActions === false ? "false" : "true",
92
+ FORGEJO__repository__DEFAULT_BRANCH: "main",
93
+ FORGEJO__log__LEVEL: "warn",
94
+ },
95
+ ports: [publish("forgejo", 3000)],
96
+ volumes: ["forgejoData:/data"],
97
+ networks: on("forgejo"),
98
+ healthcheck: {
99
+ test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/v1/version"],
100
+ interval: "3s",
101
+ timeout: "3s",
102
+ retries: 40,
103
+ },
104
+ restart: "unless-stopped",
105
+ },
106
+ // The docker executor: one job container per job through the host's
107
+ // socket, on the project network (container.network in the config
108
+ // registerForgejoRunner writes). It waits for that config, since the
109
+ // runner's credentials come from Forgejo after it boots. Root, for the
110
+ // socket Docker Desktop mounts as root:root.
111
+ forgejoRunner: {
112
+ image: FORGEJO_RUNNER_IMAGE,
113
+ container_name: `${p}-forgejo-runner`,
114
+ user: "0:0",
115
+ depends_on: { forgejo: { condition: "service_healthy" } },
116
+ volumes: ["/var/run/docker.sock:/var/run/docker.sock", "runnerData:/data"],
117
+ working_dir: "/data",
118
+ command: [
119
+ "sh",
120
+ "-c",
121
+ `while [ ! -s ${RUNNER_CONFIG_PATH} ]; do sleep 1; done; exec forgejo-runner daemon -c ${RUNNER_CONFIG_PATH}`,
122
+ ],
123
+ networks: on("forgejo-runner"),
124
+ restart: "unless-stopped",
125
+ },
126
+ clickhouse: {
127
+ image: CLICKHOUSE_IMAGE,
128
+ container_name: `${p}-clickhouse`,
129
+ profiles: [SQL_PROFILE],
130
+ environment: { CLICKHOUSE_SKIP_USER_SETUP: "1" },
131
+ ports: [publish("clickhouse", 8123)],
132
+ networks: on("clickhouse"),
133
+ healthcheck: { test: ["CMD", "wget", "--spider", "-q", "http://localhost:8123/ping"], interval: "2s", timeout: "3s", retries: 60 },
134
+ restart: "unless-stopped",
135
+ },
136
+ postgres: {
137
+ image: POSTGRES_IMAGE,
138
+ container_name: `${p}-postgres`,
139
+ profiles: [SQL_PROFILE],
140
+ environment: { POSTGRES_PASSWORD },
141
+ ports: [publish("postgres", 5432)],
142
+ networks: on("postgres"),
143
+ healthcheck: { test: ["CMD", "pg_isready", "-h", "127.0.0.1", "-U", "postgres"], interval: "2s", timeout: "3s", retries: 60 },
144
+ restart: "unless-stopped",
145
+ },
146
+ },
147
+ };
148
+ }
149
+ /** The host URLs of a stack's services, from its port variables in `env` or the defaults. */
150
+ export function harnessUrls(s, env = process.env, defaults = HARNESS_PORTS) {
151
+ const port = (k) => Number(env[s.portVars[k]] ?? defaults[k]);
152
+ return {
153
+ floci: `http://localhost:${port("floci")}`,
154
+ forgejo: `http://localhost:${port("forgejo")}`,
155
+ clickhouse: `http://localhost:${port("clickhouse")}`,
156
+ postgres: `postgres://postgres:${POSTGRES_PASSWORD}@localhost:${port("postgres")}/postgres`,
157
+ };
158
+ }
159
+ /** What every job gets by default: AWS is floci, as a CI runner in a real account carries that account's credentials. */
160
+ export const RUNNER_JOB_ENV = {
161
+ AWS_ENDPOINT_URL: HARNESS_HOSTS.floci,
162
+ AWS_ACCESS_KEY_ID: "test",
163
+ AWS_SECRET_ACCESS_KEY: "test",
164
+ AWS_REGION: "us-east-1",
165
+ AWS_EC2_METADATA_DISABLED: "true",
166
+ };
167
+ const q = (s) => JSON.stringify(s);
168
+ /**
169
+ * forgejo-runner's config (Forgejo 16, runner 13): the server connection by
170
+ * uuid and token, the job containers on the project network, no host
171
+ * mounts, and floci for AWS.
172
+ */
173
+ export function forgejoRunnerConfig(o) {
174
+ const envs = o.envs ?? RUNNER_JOB_ENV;
175
+ return [
176
+ "log:",
177
+ " level: info",
178
+ " job_level: info",
179
+ "runner:",
180
+ " file: /data/.runner",
181
+ ` capacity: ${o.capacity ?? 4}`,
182
+ " timeout: 30m",
183
+ " shutdown_timeout: 0s",
184
+ " fetch_interval: 1s",
185
+ " report_interval: 1s",
186
+ " envs:",
187
+ ...Object.entries(envs).map(([k, v]) => ` ${k}: ${q(v)}`),
188
+ " labels:",
189
+ ` - ${q(`docker:docker://${o.jobImage}`)}`,
190
+ ` - ${q(`ubuntu-latest:docker://${o.jobImage}`)}`,
191
+ "cache:",
192
+ " enabled: false",
193
+ "container:",
194
+ ` network: ${q(o.network)}`,
195
+ " privileged: false",
196
+ " valid_volumes: []",
197
+ ' docker_host: "-"',
198
+ " force_pull: false",
199
+ "server:",
200
+ " connections:",
201
+ " forgejo:",
202
+ " url: http://forgejo:3000/",
203
+ ` uuid: ${q(o.uuid)}`,
204
+ ` token: ${q(o.token)}`,
205
+ "",
206
+ ].join("\n");
207
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Per-step time limits of the harness's driver (chant#4587), from the fan-out
3
+ * demo's steps.ts LIMITS. Past its limit a step stalls the run, and a stalled
4
+ * run is neither a pass nor a caught break.
5
+ */
6
+ import type { ScenarioStepKind } from "./schemas/index.js";
7
+ /** Seconds each kind of step may take by default. */
8
+ export declare const HARNESS_LIMITS: Record<ScenarioStepKind, number>;
9
+ /** A scenario's limits over the defaults. */
10
+ export declare function limitsFor(over?: Partial<Record<ScenarioStepKind, number>>): Record<ScenarioStepKind, number>;
11
+ //# sourceMappingURL=steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../src/e2e-harness/steps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,qDAAqD;AACrD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAgB3D,CAAC;AAEF,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,IAAI,GAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAM,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAEhH"}
@@ -0,0 +1,22 @@
1
+ /** Seconds each kind of step may take by default. */
2
+ export const HARNESS_LIMITS = {
3
+ /** The branch push and the pull request open. */
4
+ open: 60,
5
+ "open-concurrent": 60,
6
+ /** pr-plan.json at the head, from the push. */
7
+ plan: 600,
8
+ /** The forge review and chant approve. */
9
+ approve: 120,
10
+ /** The merge and its merge commit. */
11
+ merge: 60,
12
+ /** pr-apply.json at the merge commit, from the merge. */
13
+ apply: 900,
14
+ /** A command run out of band. */
15
+ "out-of-band": 600,
16
+ /** Finding and killing a running job. */
17
+ "kill-job": 120,
18
+ };
19
+ /** A scenario's limits over the defaults. */
20
+ export function limitsFor(over = {}) {
21
+ return { ...HARNESS_LIMITS, ...over };
22
+ }
@@ -0,0 +1,3 @@
1
+ /** `@intentius/chant/e2e-harness` (#4587): the subpath entry for `./e2e-harness/index.ts`. */
2
+ export * from "./e2e-harness/index.js";
3
+ //# sourceMappingURL=e2e-harness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e2e-harness.d.ts","sourceRoot":"","sources":["../src/e2e-harness.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** `@intentius/chant/e2e-harness` (#4587): the subpath entry for `./e2e-harness/index.ts`. */
2
+ export * from "./e2e-harness/index.js";
@@ -8,7 +8,7 @@
8
8
  * the code through unchanged.
9
9
  *
10
10
  * The numbers are the ones op waves already used, so a pipeline reading op
11
- * waves' 3 to 8 sees no change. A moved plan is 4 and a waiting run 3; before
11
+ * waves' 3 to 8 sees no change. 9 is the apply-job guard's (#4624). A moved plan is 4 and a waiting run 3; before
12
12
  * this table both were 3 outside op waves.
13
13
  *
14
14
  * A usage or config error has no code of its own: it is `failed`, 1.
@@ -38,6 +38,12 @@ export declare const CHANT_EXIT: {
38
38
  readonly denied: 7;
39
39
  /** A decision point answered with an answer the gate does not pass on. */
40
40
  readonly declined: 8;
41
+ /**
42
+ * The apply-job guard stopped the job (#4624): it runs somewhere its spec
43
+ * did not set it to run, or it carries no spec the guard can read. Outside
44
+ * the GitLab op-wave jobs' allowed failure (1), so the waves after it stop.
45
+ */
46
+ readonly misplaced: 9;
41
47
  };
42
48
  /** A name in {@link CHANT_EXIT}. */
43
49
  export type ChantExitName = keyof typeof CHANT_EXIT;
@@ -1 +1 @@
1
- {"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU;IACrB,iCAAiC;aACjC,IAAI,EAAE,CAAC;IACP,gFAAgF;aAChF,MAAM,EAAE,CAAC;IACT,sFAAsF;aACtF,KAAK,EAAE,CAAC;IACR;;;;OAIG;aACH,OAAO,EAAE,CAAC;IACV,4FAA4F;aAC5F,KAAK,EAAE,CAAC;IACR,8GAA8G;aAC9G,IAAI,EAAE,CAAC;IACP,oCAAoC;aACpC,UAAU,EAAE,CAAC;IACb,+EAA+E;aAC/E,MAAM,EAAE,CAAC;IACT,0EAA0E;aAC1E,QAAQ,EAAE,CAAC;CACH,CAAC;AAEX,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC;AAEpD,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC;AAE/D,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAKrE"}
1
+ {"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU;IACrB,iCAAiC;aACjC,IAAI,EAAE,CAAC;IACP,gFAAgF;aAChF,MAAM,EAAE,CAAC;IACT,sFAAsF;aACtF,KAAK,EAAE,CAAC;IACR;;;;OAIG;aACH,OAAO,EAAE,CAAC;IACV,4FAA4F;aAC5F,KAAK,EAAE,CAAC;IACR,8GAA8G;aAC9G,IAAI,EAAE,CAAC;IACP,oCAAoC;aACpC,UAAU,EAAE,CAAC;IACb,+EAA+E;aAC/E,MAAM,EAAE,CAAC;IACT,0EAA0E;aAC1E,QAAQ,EAAE,CAAC;IACX;;;;OAIG;aACH,SAAS,EAAE,CAAC;CACJ,CAAC;AAEX,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC;AAEpD,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC;AAE/D,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAKrE"}
@@ -8,7 +8,7 @@
8
8
  * the code through unchanged.
9
9
  *
10
10
  * The numbers are the ones op waves already used, so a pipeline reading op
11
- * waves' 3 to 8 sees no change. A moved plan is 4 and a waiting run 3; before
11
+ * waves' 3 to 8 sees no change. 9 is the apply-job guard's (#4624). A moved plan is 4 and a waiting run 3; before
12
12
  * this table both were 3 outside op waves.
13
13
  *
14
14
  * A usage or config error has no code of its own: it is `failed`, 1.
@@ -38,6 +38,12 @@ export const CHANT_EXIT = {
38
38
  denied: 7,
39
39
  /** A decision point answered with an answer the gate does not pass on. */
40
40
  declined: 8,
41
+ /**
42
+ * The apply-job guard stopped the job (#4624): it runs somewhere its spec
43
+ * did not set it to run, or it carries no spec the guard can read. Outside
44
+ * the GitLab op-wave jobs' allowed failure (1), so the waves after it stop.
45
+ */
46
+ misplaced: 9,
41
47
  };
42
48
  /** The name of `code` in {@link CHANT_EXIT}, or `undefined` for a code outside the table. */
43
49
  export function chantExitName(code) {
package/dist/lexicon.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { InstanceObservation } from "./instance-nodes.js";
2
2
  import type { CiRunner } from "./ci-jobs.js";
3
3
  import type { OpAgentSpec } from "./ci-agent.js";
4
+ import type { CloudTradeSpec } from "./ci-identity.js";
4
5
  import type { EngineFacts } from "./engine-facts.js";
5
6
  import type { CapabilityPack } from "./capabilities/view.js";
6
7
  import type { Serializer } from "./serializer.js";
@@ -816,6 +817,42 @@ export interface ScheduledOpSpec {
816
817
  * branch. The model's job holds no write token; the push job does.
817
818
  */
818
819
  agent?: OpAgentSpec;
820
+ /**
821
+ * The job's cloud identities (#4631), as an op wave's `cloud` (#4332,
822
+ * #4549): the three generators trade the job's OIDC token for them in a
823
+ * step before the checkout, and every later step drops the variables a
824
+ * token is requested with. The job alone gets `id-token: write`; the
825
+ * finding-mode's permissions stay as they are. Build one with
826
+ * `cloudIdentityWave` from `@intentius/chant/ci-identity`.
827
+ */
828
+ cloud?: CloudTradeSpec;
829
+ /**
830
+ * An update the Op's run starts on drift (#4631): a job of its own after
831
+ * the Op's job, started only when the run exits with chant's drift code,
832
+ * which trades for `update.cloud` and runs `update.command`. The drift
833
+ * check never holds the update's identity, and the update never runs the
834
+ * check. A cron or pull_request trigger only.
835
+ */
836
+ update?: ScheduledOpUpdate;
837
+ }
838
+ /** A scheduled Op's update on drift (#4631). */
839
+ export interface ScheduledOpUpdate {
840
+ /** The shell line the update job runs, such as `npx --no-install plywood up`. */
841
+ command: string;
842
+ /** The identity only the update job holds. Absent: the update runs with no cloud identity of its own. */
843
+ cloud?: CloudTradeSpec;
844
+ /**
845
+ * Scopes the update job adds to `contents: read`, as
846
+ * {@link ScheduledOpSpec.permissions}. `contents: "write"` raises the
847
+ * update job's own contents scope (2026-10-28 ruling), so the update can
848
+ * record on `chant/lifecycle`; the Op's own job keeps its scopes. GitHub
849
+ * and Forgejo only: GitLab has no per-job token scopes.
850
+ */
851
+ permissions?: Record<string, "read" | "write">;
852
+ /** The forge environment the update job runs in. */
853
+ environment?: OpEnvironment;
854
+ /** Variables for the update job alone. */
855
+ variables?: Record<string, string>;
819
856
  }
820
857
  /**
821
858
  * Resolve a `ScheduledOpSpec`'s effective trigger, most specific first:
@@ -1361,6 +1398,15 @@ export interface LexiconPlugin {
1361
1398
  prEnvTeardown?(ctx: {
1362
1399
  cwd: string;
1363
1400
  }): import("./components/pr-environment.js").PrEnvTeardownAdapter | undefined;
1401
+ /**
1402
+ * This lexicon's steps in the check stage (#4633,
1403
+ * `./components/check-steps.ts`): `chant ci check` runs them after the
1404
+ * `ci.hooks.check` hooks for each workspace member of the adapter's kinds,
1405
+ * with the check job's environment (no forge token, no cloud credentials).
1406
+ * The pulumi lexicon runs `pulumi install`, a stack config check and
1407
+ * `pulumi about --json` per pulumi member. Return undefined for none.
1408
+ */
1409
+ checkSteps?(): import("./components/check-steps.js").CheckStepsAdapter | undefined;
1364
1410
  /**
1365
1411
  * Host Op runs — the seam `chant run <op> --on <this lexicon>` dispatches to
1366
1412
  * (#2121, epic #2114). Core ships one provider of its own, `local`, and