@intentius/chant 0.124.28 → 0.124.29

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 (395) hide show
  1. package/dist/build-params.d.ts +34 -1
  2. package/dist/build-params.d.ts.map +1 -1
  3. package/dist/build-params.js +31 -1
  4. package/dist/change-set-graph.d.ts +8 -1
  5. package/dist/change-set-graph.d.ts.map +1 -1
  6. package/dist/change-set-graph.js +4 -2
  7. package/dist/change-set.d.ts +10 -0
  8. package/dist/change-set.d.ts.map +1 -1
  9. package/dist/change-set.js +4 -3
  10. package/dist/cli/build-params-cli.d.ts +7 -1
  11. package/dist/cli/build-params-cli.d.ts.map +1 -1
  12. package/dist/cli/build-params-cli.js +17 -8
  13. package/dist/cli/commands/build.d.ts.map +1 -1
  14. package/dist/cli/commands/build.js +6 -3
  15. package/dist/cli/handlers/approve.d.ts.map +1 -1
  16. package/dist/cli/handlers/approve.js +45 -0
  17. package/dist/cli/handlers/build.d.ts.map +1 -1
  18. package/dist/cli/handlers/build.js +15 -4
  19. package/dist/cli/handlers/fan-out.d.ts +9 -0
  20. package/dist/cli/handlers/fan-out.d.ts.map +1 -1
  21. package/dist/cli/handlers/fan-out.js +40 -3
  22. package/dist/cli/handlers/lifecycle-gc.d.ts +19 -0
  23. package/dist/cli/handlers/lifecycle-gc.d.ts.map +1 -0
  24. package/dist/cli/handlers/lifecycle-gc.js +143 -0
  25. package/dist/cli/handlers/pr.d.ts +11 -3
  26. package/dist/cli/handlers/pr.d.ts.map +1 -1
  27. package/dist/cli/handlers/pr.js +134 -26
  28. package/dist/cli/handlers/promote.d.ts +7 -0
  29. package/dist/cli/handlers/promote.d.ts.map +1 -1
  30. package/dist/cli/handlers/promote.js +210 -33
  31. package/dist/cli/handlers/release.d.ts +62 -5
  32. package/dist/cli/handlers/release.d.ts.map +1 -1
  33. package/dist/cli/handlers/release.js +414 -28
  34. package/dist/cli/handlers/run.d.ts +11 -1
  35. package/dist/cli/handlers/run.d.ts.map +1 -1
  36. package/dist/cli/handlers/run.js +67 -6
  37. package/dist/cli/main.d.ts.map +1 -1
  38. package/dist/cli/main.js +61 -10
  39. package/dist/cli/parse-args.d.ts.map +1 -1
  40. package/dist/cli/parse-args.js +24 -2
  41. package/dist/cli/registry.d.ts +15 -3
  42. package/dist/cli/registry.d.ts.map +1 -1
  43. package/dist/cli/run-events.d.ts +3 -2
  44. package/dist/cli/run-events.d.ts.map +1 -1
  45. package/dist/cli/run-events.js +5 -3
  46. package/dist/components/auto-release.d.ts +2 -0
  47. package/dist/components/auto-release.d.ts.map +1 -1
  48. package/dist/components/auto-release.js +1 -0
  49. package/dist/components/capability.d.ts +9 -0
  50. package/dist/components/capability.d.ts.map +1 -1
  51. package/dist/components/driver.d.ts +8 -0
  52. package/dist/components/driver.d.ts.map +1 -1
  53. package/dist/components/driver.js +35 -0
  54. package/dist/components/fan-out-inputs.d.ts +69 -0
  55. package/dist/components/fan-out-inputs.d.ts.map +1 -0
  56. package/dist/components/fan-out-inputs.js +169 -0
  57. package/dist/components/fan-out-record.d.ts +13 -0
  58. package/dist/components/fan-out-record.d.ts.map +1 -1
  59. package/dist/components/fan-out-record.js +16 -0
  60. package/dist/components/fan-out-run.d.ts.map +1 -1
  61. package/dist/components/fan-out-run.js +50 -0
  62. package/dist/components/fan-out.d.ts +4 -0
  63. package/dist/components/fan-out.d.ts.map +1 -1
  64. package/dist/components/pr-pipeline.d.ts +25 -0
  65. package/dist/components/pr-pipeline.d.ts.map +1 -1
  66. package/dist/components/pr-pipeline.js +22 -4
  67. package/dist/components/promote.d.ts +23 -0
  68. package/dist/components/promote.d.ts.map +1 -1
  69. package/dist/components/promote.js +60 -2
  70. package/dist/components/release-compile.d.ts +9 -0
  71. package/dist/components/release-compile.d.ts.map +1 -1
  72. package/dist/components/release-compile.js +9 -3
  73. package/dist/components/release-gate.d.ts +11 -1
  74. package/dist/components/release-gate.d.ts.map +1 -1
  75. package/dist/components/release-gate.js +10 -4
  76. package/dist/components/wave-plan.d.ts +5 -0
  77. package/dist/components/wave-plan.d.ts.map +1 -1
  78. package/dist/components/wave-plan.js +10 -2
  79. package/dist/config.d.ts +38 -0
  80. package/dist/config.d.ts.map +1 -1
  81. package/dist/config.js +2 -0
  82. package/dist/flag-params.d.ts +54 -0
  83. package/dist/flag-params.d.ts.map +1 -0
  84. package/dist/flag-params.js +130 -0
  85. package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +120 -0
  86. package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -0
  87. package/dist/lifecycle/__fixtures__/publish-fakes.js +304 -0
  88. package/dist/lifecycle/change-set-store.d.ts +2 -1
  89. package/dist/lifecycle/change-set-store.d.ts.map +1 -1
  90. package/dist/lifecycle/change-set-store.js +2 -1
  91. package/dist/lifecycle/delivery-metrics.d.ts +139 -0
  92. package/dist/lifecycle/delivery-metrics.d.ts.map +1 -0
  93. package/dist/lifecycle/delivery-metrics.js +145 -0
  94. package/dist/lifecycle/deploy-outcome.d.ts +81 -0
  95. package/dist/lifecycle/deploy-outcome.d.ts.map +1 -0
  96. package/dist/lifecycle/deploy-outcome.js +101 -0
  97. package/dist/lifecycle/gate-change-set.d.ts +10 -1
  98. package/dist/lifecycle/gate-change-set.d.ts.map +1 -1
  99. package/dist/lifecycle/gate-change-set.js +35 -3
  100. package/dist/lifecycle/gate-ledger.d.ts +2 -3
  101. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  102. package/dist/lifecycle/git.d.ts +30 -1
  103. package/dist/lifecycle/git.d.ts.map +1 -1
  104. package/dist/lifecycle/git.js +31 -5
  105. package/dist/lifecycle/index.d.ts +4 -0
  106. package/dist/lifecycle/index.d.ts.map +1 -1
  107. package/dist/lifecycle/index.js +4 -0
  108. package/dist/lifecycle/mixed-environment.d.ts +95 -0
  109. package/dist/lifecycle/mixed-environment.d.ts.map +1 -0
  110. package/dist/lifecycle/mixed-environment.js +154 -0
  111. package/dist/lifecycle/publish-attachments.d.ts +79 -0
  112. package/dist/lifecycle/publish-attachments.d.ts.map +1 -0
  113. package/dist/lifecycle/publish-attachments.js +179 -0
  114. package/dist/lifecycle/publish-credentials.d.ts +37 -0
  115. package/dist/lifecycle/publish-credentials.d.ts.map +1 -0
  116. package/dist/lifecycle/publish-credentials.js +69 -0
  117. package/dist/lifecycle/publish-declaration.d.ts +97 -0
  118. package/dist/lifecycle/publish-declaration.d.ts.map +1 -0
  119. package/dist/lifecycle/publish-declaration.js +83 -0
  120. package/dist/lifecycle/publish-forge.d.ts +53 -0
  121. package/dist/lifecycle/publish-forge.d.ts.map +1 -0
  122. package/dist/lifecycle/publish-forge.js +298 -0
  123. package/dist/lifecycle/publish-npm.d.ts +61 -0
  124. package/dist/lifecycle/publish-npm.d.ts.map +1 -0
  125. package/dist/lifecycle/publish-npm.js +242 -0
  126. package/dist/lifecycle/publish-oci.d.ts +64 -0
  127. package/dist/lifecycle/publish-oci.d.ts.map +1 -0
  128. package/dist/lifecycle/publish-oci.js +383 -0
  129. package/dist/lifecycle/publish-record.d.ts +66 -0
  130. package/dist/lifecycle/publish-record.d.ts.map +1 -0
  131. package/dist/lifecycle/publish-record.js +84 -0
  132. package/dist/lifecycle/publish-targets.d.ts +45 -0
  133. package/dist/lifecycle/publish-targets.d.ts.map +1 -0
  134. package/dist/lifecycle/publish-targets.js +85 -0
  135. package/dist/lifecycle/release-cut.d.ts +48 -1
  136. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  137. package/dist/lifecycle/release-cut.js +116 -23
  138. package/dist/lifecycle/release-join.d.ts +95 -0
  139. package/dist/lifecycle/release-join.d.ts.map +1 -0
  140. package/dist/lifecycle/release-join.js +139 -0
  141. package/dist/lifecycle/release-publish.d.ts +312 -0
  142. package/dist/lifecycle/release-publish.d.ts.map +1 -0
  143. package/dist/lifecycle/release-publish.js +335 -0
  144. package/dist/lifecycle/release-revocation.d.ts +80 -0
  145. package/dist/lifecycle/release-revocation.d.ts.map +1 -0
  146. package/dist/lifecycle/release-revocation.js +123 -0
  147. package/dist/lifecycle/release-store.d.ts +12 -2
  148. package/dist/lifecycle/release-store.d.ts.map +1 -1
  149. package/dist/lifecycle/release-store.js +4 -2
  150. package/dist/lifecycle/release-verify.d.ts +61 -0
  151. package/dist/lifecycle/release-verify.d.ts.map +1 -0
  152. package/dist/lifecycle/release-verify.js +92 -0
  153. package/dist/lifecycle/release-workstation.d.ts +91 -0
  154. package/dist/lifecycle/release-workstation.d.ts.map +1 -0
  155. package/dist/lifecycle/release-workstation.js +180 -0
  156. package/dist/lifecycle/retention-policy.d.ts +45 -0
  157. package/dist/lifecycle/retention-policy.d.ts.map +1 -0
  158. package/dist/lifecycle/retention-policy.js +43 -0
  159. package/dist/lifecycle/retention.d.ts +185 -0
  160. package/dist/lifecycle/retention.d.ts.map +1 -0
  161. package/dist/lifecycle/retention.js +400 -0
  162. package/dist/plan-summary.d.ts.map +1 -1
  163. package/dist/plan-summary.js +8 -2
  164. package/dist/pr-loop.d.ts +7 -0
  165. package/dist/pr-loop.d.ts.map +1 -1
  166. package/dist/pr-loop.js +23 -4
  167. package/dist/pr-report-url.d.ts +82 -0
  168. package/dist/pr-report-url.d.ts.map +1 -0
  169. package/dist/pr-report-url.js +174 -0
  170. package/dist/provenance.d.ts +2 -2
  171. package/dist/provenance.d.ts.map +1 -1
  172. package/dist/run-event-store.d.ts +29 -2
  173. package/dist/run-event-store.d.ts.map +1 -1
  174. package/dist/run-event-store.js +50 -3
  175. package/dist/run-event-stream.d.ts +2 -1
  176. package/dist/run-event-stream.d.ts.map +1 -1
  177. package/dist/run-event-stream.js +5 -1
  178. package/dist/run-event.d.ts +19 -1
  179. package/dist/run-event.d.ts.map +1 -1
  180. package/dist/run-event.js +2 -0
  181. package/dist/wave-runtime.mjs +260 -229
  182. package/dist/workspace/__fixtures__/flag-workspace.d.ts +31 -0
  183. package/dist/workspace/__fixtures__/flag-workspace.d.ts.map +1 -0
  184. package/dist/workspace/__fixtures__/flag-workspace.js +114 -0
  185. package/dist/workspace/change-set.schema.json +5 -1
  186. package/dist/workspace/check.schema.json +4 -2
  187. package/dist/workspace/checks/records.d.ts +9 -1
  188. package/dist/workspace/checks/records.d.ts.map +1 -1
  189. package/dist/workspace/checks/records.js +35 -1
  190. package/dist/workspace/checks.d.ts +1 -0
  191. package/dist/workspace/checks.d.ts.map +1 -1
  192. package/dist/workspace/checks.js +2 -1
  193. package/dist/workspace/ci-green.d.ts +8 -0
  194. package/dist/workspace/ci-green.d.ts.map +1 -1
  195. package/dist/workspace/ci-green.js +10 -3
  196. package/dist/workspace/declaration.d.ts +16 -0
  197. package/dist/workspace/declaration.d.ts.map +1 -1
  198. package/dist/workspace/declaration.js +26 -0
  199. package/dist/workspace/declaration.schema.json +64 -0
  200. package/dist/workspace/declared-kinds.d.ts +16 -0
  201. package/dist/workspace/declared-kinds.d.ts.map +1 -1
  202. package/dist/workspace/declared-kinds.js +25 -0
  203. package/dist/workspace/delivery-metrics.d.ts +91 -0
  204. package/dist/workspace/delivery-metrics.d.ts.map +1 -0
  205. package/dist/workspace/delivery-metrics.js +217 -0
  206. package/dist/workspace/delivery-metrics.schema.json +519 -0
  207. package/dist/workspace/flags-read.d.ts +37 -0
  208. package/dist/workspace/flags-read.d.ts.map +1 -0
  209. package/dist/workspace/flags-read.js +103 -0
  210. package/dist/workspace/flags.d.ts +100 -0
  211. package/dist/workspace/flags.d.ts.map +1 -0
  212. package/dist/workspace/flags.js +98 -0
  213. package/dist/workspace/graph-cli.js +1 -1
  214. package/dist/workspace/intent-cli.d.ts +11 -2
  215. package/dist/workspace/intent-cli.d.ts.map +1 -1
  216. package/dist/workspace/intent-cli.js +54 -5
  217. package/dist/workspace/intent-trace.d.ts +219 -0
  218. package/dist/workspace/intent-trace.d.ts.map +1 -0
  219. package/dist/workspace/intent-trace.js +314 -0
  220. package/dist/workspace/intent.d.ts +30 -6
  221. package/dist/workspace/intent.d.ts.map +1 -1
  222. package/dist/workspace/intent.js +141 -21
  223. package/dist/workspace/intent.schema.json +702 -6
  224. package/dist/workspace/overlap.d.ts +146 -0
  225. package/dist/workspace/overlap.d.ts.map +1 -0
  226. package/dist/workspace/overlap.js +276 -0
  227. package/dist/workspace/reason-codes.d.ts +2 -0
  228. package/dist/workspace/reason-codes.d.ts.map +1 -1
  229. package/dist/workspace/reason-codes.js +3 -0
  230. package/dist/workspace/records.d.ts +15 -2
  231. package/dist/workspace/records.d.ts.map +1 -1
  232. package/dist/workspace/records.js +32 -0
  233. package/dist/workspace/records.schema.json +21 -2
  234. package/dist/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
  235. package/dist/workspace/reference-kinds/flag/flag.schema.json +53 -0
  236. package/dist/workspace/releases.d.ts +9 -0
  237. package/dist/workspace/releases.d.ts.map +1 -1
  238. package/dist/workspace/releases.js +9 -0
  239. package/dist/workspace/releases.schema.json +123 -1
  240. package/dist/workspace/run-event.schema.json +10 -3
  241. package/dist/workspace/status-gates.d.ts +8 -0
  242. package/dist/workspace/status-gates.d.ts.map +1 -1
  243. package/dist/workspace/status.d.ts +78 -0
  244. package/dist/workspace/status.d.ts.map +1 -1
  245. package/dist/workspace/status.js +170 -3
  246. package/dist/workspace/status.schema.json +198 -1
  247. package/dist/workspace/wip.d.ts.map +1 -1
  248. package/dist/workspace/wip.js +11 -3
  249. package/package.json +1 -1
  250. package/src/build-params.test.ts +46 -0
  251. package/src/build-params.ts +55 -1
  252. package/src/change-set-graph.ts +10 -2
  253. package/src/change-set.ts +14 -3
  254. package/src/cli/build-params-cli.ts +22 -9
  255. package/src/cli/commands/build.ts +6 -3
  256. package/src/cli/handlers/approve-release.test.ts +5 -1
  257. package/src/cli/handlers/approve-revoked.test.ts +155 -0
  258. package/src/cli/handlers/approve.ts +47 -0
  259. package/src/cli/handlers/build.test.ts +15 -0
  260. package/src/cli/handlers/build.ts +17 -4
  261. package/src/cli/handlers/fan-out.test.ts +180 -1
  262. package/src/cli/handlers/fan-out.ts +38 -3
  263. package/src/cli/handlers/intent-trace.e2e.test.ts +201 -0
  264. package/src/cli/handlers/lifecycle-gc.test.ts +126 -0
  265. package/src/cli/handlers/lifecycle-gc.ts +146 -0
  266. package/src/cli/handlers/pr.test.ts +148 -1
  267. package/src/cli/handlers/pr.ts +139 -28
  268. package/src/cli/handlers/promote.test.ts +280 -2
  269. package/src/cli/handlers/promote.ts +210 -34
  270. package/src/cli/handlers/release-implicit.e2e.test.ts +12 -4
  271. package/src/cli/handlers/release-join.e2e.test.ts +185 -0
  272. package/src/cli/handlers/release-publish-targets.e2e.test.ts +295 -0
  273. package/src/cli/handlers/release-verify.e2e.test.ts +117 -0
  274. package/src/cli/handlers/release-workstation-ci.e2e.test.ts +135 -0
  275. package/src/cli/handlers/release.e2e.test.ts +146 -32
  276. package/src/cli/handlers/release.ts +415 -28
  277. package/src/cli/handlers/run-auto-release.test.ts +9 -0
  278. package/src/cli/handlers/run-release.test.ts +55 -0
  279. package/src/cli/handlers/run.ts +69 -5
  280. package/src/cli/main.test.ts +1 -0
  281. package/src/cli/main.ts +61 -10
  282. package/src/cli/parse-args.ts +19 -2
  283. package/src/cli/registry.ts +15 -3
  284. package/src/cli/run-events.ts +5 -2
  285. package/src/components/auto-release.test.ts +9 -0
  286. package/src/components/auto-release.ts +3 -0
  287. package/src/components/capability.ts +9 -0
  288. package/src/components/driver.test.ts +24 -0
  289. package/src/components/driver.ts +36 -0
  290. package/src/components/fan-out-inputs.test.ts +85 -0
  291. package/src/components/fan-out-inputs.ts +192 -0
  292. package/src/components/fan-out-record.test.ts +10 -0
  293. package/src/components/fan-out-record.ts +19 -0
  294. package/src/components/fan-out-run.ts +48 -0
  295. package/src/components/fan-out.ts +4 -0
  296. package/src/components/pr-pipeline.ts +35 -4
  297. package/src/components/promote.ts +68 -2
  298. package/src/components/release-compile.ts +17 -3
  299. package/src/components/release-gate.ts +18 -4
  300. package/src/components/wave-plan.ts +15 -2
  301. package/src/config.ts +8 -0
  302. package/src/flag-params.test.ts +144 -0
  303. package/src/flag-params.ts +134 -0
  304. package/src/lifecycle/__fixtures__/publish-fakes.ts +351 -0
  305. package/src/lifecycle/change-set-store.ts +2 -1
  306. package/src/lifecycle/delivery-metrics.ts +263 -0
  307. package/src/lifecycle/deploy-outcome.ts +147 -0
  308. package/src/lifecycle/gate-change-set.ts +37 -6
  309. package/src/lifecycle/gate-ledger.ts +2 -2
  310. package/src/lifecycle/git.ts +61 -8
  311. package/src/lifecycle/index.ts +4 -0
  312. package/src/lifecycle/mixed-environment.test.ts +97 -0
  313. package/src/lifecycle/mixed-environment.ts +204 -0
  314. package/src/lifecycle/publish-attachments.ts +196 -0
  315. package/src/lifecycle/publish-credentials.ts +84 -0
  316. package/src/lifecycle/publish-declaration.ts +95 -0
  317. package/src/lifecycle/publish-forge.ts +325 -0
  318. package/src/lifecycle/publish-npm.ts +259 -0
  319. package/src/lifecycle/publish-oci.ts +396 -0
  320. package/src/lifecycle/publish-record.ts +113 -0
  321. package/src/lifecycle/publish-resume.test.ts +168 -0
  322. package/src/lifecycle/publish-targets.test.ts +494 -0
  323. package/src/lifecycle/publish-targets.ts +100 -0
  324. package/src/lifecycle/release-cut.test.ts +74 -2
  325. package/src/lifecycle/release-cut.ts +158 -22
  326. package/src/lifecycle/release-flag.test.ts +112 -0
  327. package/src/lifecycle/release-join.test.ts +68 -0
  328. package/src/lifecycle/release-join.ts +182 -0
  329. package/src/lifecycle/release-publish.test.ts +225 -0
  330. package/src/lifecycle/release-publish.ts +568 -0
  331. package/src/lifecycle/release-revocation.ts +147 -0
  332. package/src/lifecycle/release-store.ts +15 -4
  333. package/src/lifecycle/release-verify.test.ts +110 -0
  334. package/src/lifecycle/release-verify.ts +120 -0
  335. package/src/lifecycle/release-workstation.test.ts +204 -0
  336. package/src/lifecycle/release-workstation.ts +216 -0
  337. package/src/lifecycle/retention-growth.e2e.test.ts +279 -0
  338. package/src/lifecycle/retention-policy.ts +63 -0
  339. package/src/lifecycle/retention.test.ts +363 -0
  340. package/src/lifecycle/retention.ts +508 -0
  341. package/src/plan-summary.test.ts +20 -0
  342. package/src/plan-summary.ts +8 -1
  343. package/src/pr-loop.ts +25 -4
  344. package/src/pr-report-url.test.ts +131 -0
  345. package/src/pr-report-url.ts +209 -0
  346. package/src/provenance.ts +2 -2
  347. package/src/run-event-store.ts +63 -3
  348. package/src/run-event-stream.ts +4 -1
  349. package/src/run-event.ts +21 -1
  350. package/src/workspace/__fixtures__/flag-workspace.ts +132 -0
  351. package/src/workspace/__fixtures__/older-records/change-set-984534ea9.json +100 -0
  352. package/src/workspace/__fixtures__/older-records/older-records.json +326 -0
  353. package/src/workspace/change-set.schema.json +5 -1
  354. package/src/workspace/check.schema.json +4 -2
  355. package/src/workspace/checks/records.ts +35 -1
  356. package/src/workspace/checks.ts +2 -1
  357. package/src/workspace/ci-green.ts +14 -3
  358. package/src/workspace/declaration.schema.json +64 -0
  359. package/src/workspace/declaration.test.ts +28 -0
  360. package/src/workspace/declaration.ts +38 -0
  361. package/src/workspace/declared-kinds.ts +40 -1
  362. package/src/workspace/delivery-metrics.schema.json +519 -0
  363. package/src/workspace/delivery-metrics.test.ts +236 -0
  364. package/src/workspace/delivery-metrics.ts +286 -0
  365. package/src/workspace/flags-read.ts +121 -0
  366. package/src/workspace/flags.test.ts +141 -0
  367. package/src/workspace/flags.ts +157 -0
  368. package/src/workspace/graph-cli.ts +1 -1
  369. package/src/workspace/intent-cli.ts +46 -5
  370. package/src/workspace/intent-trace.test.ts +173 -0
  371. package/src/workspace/intent-trace.ts +484 -0
  372. package/src/workspace/intent.schema.json +702 -6
  373. package/src/workspace/intent.ts +148 -25
  374. package/src/workspace/older-records.test.ts +412 -0
  375. package/src/workspace/overlap.test.ts +165 -0
  376. package/src/workspace/overlap.ts +340 -0
  377. package/src/workspace/read-contract.e2e.test.ts +2 -1
  378. package/src/workspace/reason-codes.test.ts +5 -0
  379. package/src/workspace/reason-codes.ts +3 -0
  380. package/src/workspace/record-assets.test.ts +2 -1
  381. package/src/workspace/records-contract.e2e.test.ts +2 -1
  382. package/src/workspace/records.schema.json +21 -2
  383. package/src/workspace/records.ts +36 -2
  384. package/src/workspace/reference-kinds/flag/flag.kind.mjs +32 -0
  385. package/src/workspace/reference-kinds/flag/flag.schema.json +53 -0
  386. package/src/workspace/releases.schema.json +123 -1
  387. package/src/workspace/releases.ts +11 -0
  388. package/src/workspace/run-event.schema.json +10 -3
  389. package/src/workspace/status-contract.test.ts +29 -0
  390. package/src/workspace/status-gates.ts +8 -0
  391. package/src/workspace/status-mixed.test.ts +152 -0
  392. package/src/workspace/status-revoked.test.ts +153 -0
  393. package/src/workspace/status.schema.json +198 -1
  394. package/src/workspace/status.ts +254 -3
  395. package/src/workspace/wip.ts +11 -2
@@ -0,0 +1,139 @@
1
+ /**
2
+ * The four DORA metrics of one environment's deploy records (#4039): how
3
+ * often it deploys, the lead time from commit to running release, the change
4
+ * failure rate and the time to restore.
5
+ *
6
+ * Everything here is pure. The caller reads the ledgers, the release files
7
+ * and the ci tags, and hands this module one environment's records with
8
+ * lookups for the rest; `workspace/delivery-metrics.ts` does that for
9
+ * `chant workspace metrics`.
10
+ *
11
+ * A deploy is one record in `<env>/releases.jsonl`: one component deployed
12
+ * once. A redeploy, which puts the running release back, is counted apart and
13
+ * is not a deploy for the metrics. A deploy fails when, within the failure window after it, the commit
14
+ * it deployed is revoked (a counted `ci/revoked/<sha>` tag, #4033) or the
15
+ * environment is rolled back from it. Which records are rollbacks, and which
16
+ * put the current release back, is decided in {@link rollbackOf} and
17
+ * {@link isRedeploy} and nowhere else, so a new kind of rollback record
18
+ * (#4035) changes those two functions only.
19
+ */
20
+ import type { ReleaseRecord, ReleaseRef } from "./release-ledger.js";
21
+ /** The failure window when the declaration's `metrics.failureWindowDays` is not set. */
22
+ export declare const DEFAULT_FAILURE_WINDOW_DAYS = 7;
23
+ /**
24
+ * The earlier deploy a rollback record restores, or null when the record is
25
+ * not a rollback. Today a rollback is a record `chant components rollback`
26
+ * wrote, which names what it restores in `restores` (#2531). Every rule below
27
+ * that asks whether a record rolled an environment back asks this function.
28
+ */
29
+ export declare function rollbackOf(record: Pick<ReleaseRecord, "restores">): ReleaseRef | null;
30
+ /**
31
+ * Whether the record put the current release back (`chant components
32
+ * redeploy`, #2604). A redeploy deploys the same release again, so it neither
33
+ * restores a failed deploy nor stands between a deploy and its rollback.
34
+ */
35
+ export declare function isRedeploy(record: Pick<ReleaseRecord, "redeploys">): boolean;
36
+ /** A counted revoked tag on a commit, with the time it was made, or null for a lightweight tag. */
37
+ export interface CommitRevocation {
38
+ tag: string;
39
+ tagged: string | null;
40
+ }
41
+ /** What the caller knows beyond the records, as lookups. */
42
+ export interface MetricsLookups {
43
+ /** The release a deploy record names: its `releaseDigest`, else the one its release-gate admission names. Undefined when it names none. */
44
+ releaseOf: (record: ReleaseRecord) => string | undefined;
45
+ /** The commit a release was cut from, or null when its file can't be read here. */
46
+ commitOfRelease: (releaseDigest: string) => string | null;
47
+ /** The release's label, or null. */
48
+ labelOf: (releaseDigest: string) => string | null;
49
+ /** The counted revoked tag on a commit, or null when the commit is not revoked. */
50
+ revocationOf: (commit: string) => CommitRevocation | null;
51
+ /** The commit's committer time in milliseconds, or null when the commit is not in this repository. */
52
+ commitTime: (commit: string) => number | null;
53
+ }
54
+ /** The span of time the metrics count deploys in. */
55
+ export interface MetricsWindow {
56
+ /** ISO-8601, inclusive. */
57
+ since: string;
58
+ /** ISO-8601, inclusive. */
59
+ until: string;
60
+ }
61
+ /** A record named the way `restores` names one. */
62
+ export interface DeployRef {
63
+ runId: string;
64
+ timestamp: string;
65
+ }
66
+ /** One failed deploy, and how it was restored. */
67
+ export interface DeployFailure {
68
+ component: string;
69
+ timestamp: string;
70
+ runId: string;
71
+ /** The release the deploy came from, or null for a deploy made from no release. */
72
+ releaseDigest: string | null;
73
+ label: string | null;
74
+ /** The commit it deployed: the release's commit, or the record's `gitSha` for a deploy made from no release. */
75
+ commit: string;
76
+ /** Why it counts as failed: `revoked`, `rolled-back`, or both. */
77
+ causes: Array<"revoked" | "rolled-back">;
78
+ /** The revoked tag on the commit, when that is a cause. */
79
+ revoked: CommitRevocation | null;
80
+ /** The rollback record that rolled the environment back from it, when that is a cause. */
81
+ rolledBackBy: DeployRef | null;
82
+ /** The next deploy of the component in the environment whose commit is not revoked, or null while there is none. */
83
+ restoredBy: DeployRef | null;
84
+ /** Seconds from the failed deploy to `restoredBy`, or null while it is not restored. */
85
+ restoreSeconds: number | null;
86
+ }
87
+ /** The four metrics of one environment. */
88
+ export interface EnvironmentMetrics {
89
+ env: string;
90
+ deployments: {
91
+ /** Deploy records in the window, one per component deployed, leaving out redeploys. Rollbacks count. */
92
+ count: number;
93
+ /** Redeploys in the window: records that put the running release back, counted apart from `count`. */
94
+ redeploys: number;
95
+ /** Distinct `runId` values among them, so a run that deploys several components counts once. */
96
+ runs: number;
97
+ /** Of `count`, the deploys made from a release. */
98
+ fromRelease: number;
99
+ /** `count` over the window in weeks, to two decimals. */
100
+ perWeek: number;
101
+ };
102
+ leadTime: {
103
+ /** Changes whose first deploy here falls in the window and whose commit time is known. */
104
+ changes: number;
105
+ /** Of `changes`, releases (the first deploy naming the release). */
106
+ fromRelease: number;
107
+ /** Of `changes`, commits deployed from no release (the first deploy with that `gitSha`). */
108
+ fromCommit: number;
109
+ /** Changes left out because their commit is not in this repository. */
110
+ unknown: number;
111
+ /** The median, in seconds, or null when `changes` is 0. */
112
+ medianSeconds: number | null;
113
+ };
114
+ changeFailure: {
115
+ deployments: number;
116
+ failed: number;
117
+ /** Failed deploys whose commit was revoked within the window after them. */
118
+ revoked: number;
119
+ /** Failed deploys the environment was rolled back from within the window after them. */
120
+ rolledBack: number;
121
+ /** `failed` over `deployments`, to four decimals, or null with no deployments. */
122
+ rate: number | null;
123
+ };
124
+ restore: {
125
+ restored: number;
126
+ open: number;
127
+ medianSeconds: number | null;
128
+ };
129
+ /** The failed deploys in the window, oldest first. */
130
+ failures: DeployFailure[];
131
+ }
132
+ /**
133
+ * The metrics of one environment's records. `records` is the whole ledger of
134
+ * the environment, every component, in ledger order: deploys before the
135
+ * window still decide lead times, and deploys after a failure decide its
136
+ * restore. Only deploys whose `timestamp` falls in `window` are counted.
137
+ */
138
+ export declare function environmentMetrics(env: string, records: readonly ReleaseRecord[], lookups: MetricsLookups, window: MetricsWindow, failureWindowDays?: number): EnvironmentMetrics;
139
+ //# sourceMappingURL=delivery-metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-metrics.d.ts","sourceRoot":"","sources":["../../src/lifecycle/delivery-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,wFAAwF;AACxF,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAI7C;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,GAAG,UAAU,GAAG,IAAI,CAErF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG,OAAO,CAE5E;AAED,mGAAmG;AACnG,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,4DAA4D;AAC5D,MAAM,WAAW,cAAc;IAC7B,2IAA2I;IAC3I,SAAS,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,MAAM,GAAG,SAAS,CAAC;IACzD,mFAAmF;IACnF,eAAe,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC1D,oCAAoC;IACpC,OAAO,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAClD,mFAAmF;IACnF,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,gBAAgB,GAAG,IAAI,CAAC;IAC1D,sGAAsG;IACtG,UAA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R,0FAA0F;QAC1F,OAAO,EAAE,MAAM,CAAC;QAChB,oEAAoE;QACpE,WAAW,EAAE,MAAM,CAAC;QACpB,4FAA4F;QAC5F,UAAU,EAAE,MAAM,CAAC;QACnB,uEAAuE;QACvE,OAAO,EAAE,MAAM,CAAC;QAChB,2DAA2D;QAC3D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;IACF,aAAa,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,4EAA4E;QAC5E,OAAO,EAAE,MAAM,CAAC;QAChB,wFAAwF;QACxF,UAAU,EAAE,MAAM,CAAC;QACnB,kFAAkF;QAClF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,CAAC;IACF,OAAO,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;IACF,sDAAsD;IACtD,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAYD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,SAAS,aAAa,EAAE,EACjC,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,aAAa,EACrB,iBAAiB,GAAE,MAAoC,GACtD,kBAAkB,CA4FpB"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * The four DORA metrics of one environment's deploy records (#4039): how
3
+ * often it deploys, the lead time from commit to running release, the change
4
+ * failure rate and the time to restore.
5
+ *
6
+ * Everything here is pure. The caller reads the ledgers, the release files
7
+ * and the ci tags, and hands this module one environment's records with
8
+ * lookups for the rest; `workspace/delivery-metrics.ts` does that for
9
+ * `chant workspace metrics`.
10
+ *
11
+ * A deploy is one record in `<env>/releases.jsonl`: one component deployed
12
+ * once. A redeploy, which puts the running release back, is counted apart and
13
+ * is not a deploy for the metrics. A deploy fails when, within the failure window after it, the commit
14
+ * it deployed is revoked (a counted `ci/revoked/<sha>` tag, #4033) or the
15
+ * environment is rolled back from it. Which records are rollbacks, and which
16
+ * put the current release back, is decided in {@link rollbackOf} and
17
+ * {@link isRedeploy} and nowhere else, so a new kind of rollback record
18
+ * (#4035) changes those two functions only.
19
+ */
20
+ /** The failure window when the declaration's `metrics.failureWindowDays` is not set. */
21
+ export const DEFAULT_FAILURE_WINDOW_DAYS = 7;
22
+ const DAY_MS = 86400000;
23
+ /**
24
+ * The earlier deploy a rollback record restores, or null when the record is
25
+ * not a rollback. Today a rollback is a record `chant components rollback`
26
+ * wrote, which names what it restores in `restores` (#2531). Every rule below
27
+ * that asks whether a record rolled an environment back asks this function.
28
+ */
29
+ export function rollbackOf(record) {
30
+ return record.restores ?? null;
31
+ }
32
+ /**
33
+ * Whether the record put the current release back (`chant components
34
+ * redeploy`, #2604). A redeploy deploys the same release again, so it neither
35
+ * restores a failed deploy nor stands between a deploy and its rollback.
36
+ */
37
+ export function isRedeploy(record) {
38
+ return record.redeploys !== undefined;
39
+ }
40
+ function median(values) {
41
+ if (values.length === 0)
42
+ return null;
43
+ const s = [...values].sort((a, b) => a - b);
44
+ const mid = Math.floor(s.length / 2);
45
+ return Math.round(s.length % 2 === 1 ? s[mid] : (s[mid - 1] + s[mid]) / 2);
46
+ }
47
+ const at = (iso) => Date.parse(iso);
48
+ const ref = (r) => ({ runId: r.runId, timestamp: r.timestamp });
49
+ /**
50
+ * The metrics of one environment's records. `records` is the whole ledger of
51
+ * the environment, every component, in ledger order: deploys before the
52
+ * window still decide lead times, and deploys after a failure decide its
53
+ * restore. Only deploys whose `timestamp` falls in `window` are counted.
54
+ */
55
+ export function environmentMetrics(env, records, lookups, window, failureWindowDays = DEFAULT_FAILURE_WINDOW_DAYS) {
56
+ // Ledger order breaks timestamp ties, as `latestPerComponent` does.
57
+ const sorted = records.map((r, i) => ({ r, i })).sort((a, b) => at(a.r.timestamp) - at(b.r.timestamp) || a.i - b.i).map((x) => x.r);
58
+ const since = at(window.since);
59
+ const until = at(window.until);
60
+ const failureMs = failureWindowDays * DAY_MS;
61
+ const inWindow = (r) => at(r.timestamp) >= since && at(r.timestamp) <= until;
62
+ const facts = sorted.map((r) => {
63
+ const releaseDigest = lookups.releaseOf(r) ?? null;
64
+ const commit = (releaseDigest !== null ? lookups.commitOfRelease(releaseDigest) : null) ?? r.gitSha;
65
+ return { r, releaseDigest, commit, revocation: lookups.revocationOf(commit) };
66
+ });
67
+ // A redeploy puts the running release back: it is counted apart, and
68
+ // neither fails nor restores on its own.
69
+ const deployments = facts.filter((f) => inWindow(f.r) && !isRedeploy(f.r));
70
+ const failures = [];
71
+ for (const [i, f] of facts.entries()) {
72
+ if (!inWindow(f.r) || isRedeploy(f.r))
73
+ continue;
74
+ const t = at(f.r.timestamp);
75
+ const later = facts.slice(i + 1).filter((g) => g.r.component === f.r.component);
76
+ // Revoked within the window after the deploy. A tag with no time, or one
77
+ // made before the deploy, revokes what was deployed all the same.
78
+ const revoked = f.revocation !== null && (f.revocation.tagged === null || at(f.revocation.tagged) - t <= failureMs) ? f.revocation : null;
79
+ // Rolled back from it: the next deploy of the component that is not a
80
+ // redeploy is a rollback, within the window.
81
+ const next = later.find((g) => !isRedeploy(g.r));
82
+ const rolledBack = next !== undefined && rollbackOf(next.r) !== null && at(next.r.timestamp) - t <= failureMs ? next.r : null;
83
+ if (!revoked && !rolledBack)
84
+ continue;
85
+ const restore = later.find((g) => !isRedeploy(g.r) && g.revocation === null);
86
+ failures.push({
87
+ component: f.r.component,
88
+ timestamp: f.r.timestamp,
89
+ runId: f.r.runId,
90
+ releaseDigest: f.releaseDigest,
91
+ label: f.releaseDigest !== null ? lookups.labelOf(f.releaseDigest) : null,
92
+ commit: f.commit,
93
+ causes: [...(revoked ? ["revoked"] : []), ...(rolledBack ? ["rolled-back"] : [])],
94
+ revoked,
95
+ rolledBackBy: rolledBack ? ref(rolledBack) : null,
96
+ restoredBy: restore ? ref(restore.r) : null,
97
+ restoreSeconds: restore ? Math.round((at(restore.r.timestamp) - t) / 1000) : null,
98
+ });
99
+ }
100
+ // Lead time: one change per release, or per commit deployed from no
101
+ // release, timed at its first deploy in this environment.
102
+ const firstDeploy = new Map();
103
+ for (const f of facts) {
104
+ const key = f.releaseDigest !== null ? `release:${f.releaseDigest}` : `commit:${f.r.gitSha}`;
105
+ if (!firstDeploy.has(key))
106
+ firstDeploy.set(key, f);
107
+ }
108
+ const leads = [];
109
+ let fromRelease = 0;
110
+ let unknown = 0;
111
+ for (const f of firstDeploy.values()) {
112
+ if (!inWindow(f.r))
113
+ continue;
114
+ const committed = lookups.commitTime(f.commit);
115
+ if (committed === null) {
116
+ unknown++;
117
+ continue;
118
+ }
119
+ leads.push(Math.max(0, (at(f.r.timestamp) - committed) / 1000));
120
+ if (f.releaseDigest !== null)
121
+ fromRelease++;
122
+ }
123
+ const weeks = Math.max(until - since, DAY_MS) / (7 * DAY_MS);
124
+ const restored = failures.filter((x) => x.restoreSeconds !== null);
125
+ return {
126
+ env,
127
+ deployments: {
128
+ count: deployments.length,
129
+ redeploys: facts.filter((f) => inWindow(f.r) && isRedeploy(f.r)).length,
130
+ runs: new Set(deployments.map((f) => f.r.runId)).size,
131
+ fromRelease: deployments.filter((f) => f.releaseDigest !== null).length,
132
+ perWeek: Math.round((deployments.length / weeks) * 100) / 100,
133
+ },
134
+ leadTime: { changes: leads.length, fromRelease, fromCommit: leads.length - fromRelease, unknown, medianSeconds: median(leads) },
135
+ changeFailure: {
136
+ deployments: deployments.length,
137
+ failed: failures.length,
138
+ revoked: failures.filter((x) => x.revoked !== null).length,
139
+ rolledBack: failures.filter((x) => x.rolledBackBy !== null).length,
140
+ rate: deployments.length === 0 ? null : Math.round((failures.length / deployments.length) * 10000) / 10000,
141
+ },
142
+ restore: { restored: restored.length, open: failures.length - restored.length, medianSeconds: median(restored.map((x) => x.restoreSeconds)) },
143
+ failures,
144
+ };
145
+ }
@@ -0,0 +1,81 @@
1
+ /**
2
+ * What a promote, rollback or redeploy left behind when it did not deploy
3
+ * every component it planned (#4035).
4
+ *
5
+ * The release ledger records a component only once its deploy succeeded, so
6
+ * after a run that applied partly it still names the earlier release for
7
+ * every component that failed, and nothing says that component may be
8
+ * running part of the new one. A deploy outcome is the record of that run:
9
+ * one line per run in `<env>/outcomes.jsonl` on `chant/lifecycle`, beside
10
+ * the environment's `releases.jsonl` and under the same member prefix,
11
+ * naming each planned component and what happened to it.
12
+ *
13
+ * It is written only when the run ended with some components deployed and
14
+ * others not, or with a component that failed. A run that stopped at a gate
15
+ * before deploying anything changed nothing in the environment; its pending
16
+ * gate is what `workspace status` shows for it.
17
+ *
18
+ * The file is append-only, like the release ledger. Whether the environment
19
+ * is still mixed is derived when it is read ({@link ./mixed-environment.ts}):
20
+ * a component the outcome names as failed or gated stays unsettled until the
21
+ * release ledger has a newer record of it, which a redeploy, a rollback or
22
+ * the same promote run again writes.
23
+ */
24
+ import type { PromotionPlan } from "../components/promote.js";
25
+ import type { DriverRunResult } from "../components/driver.js";
26
+ /** The file a deploy outcome is appended to, under the environment's directory. */
27
+ export declare const OUTCOMES_FILE = "outcomes.jsonl";
28
+ /** What a run did to one component it planned. */
29
+ export type DeployOutcomeState = "deployed" | "failed" | "gated" | "not-run";
30
+ export interface DeployOutcomeComponent {
31
+ component: string;
32
+ /** `deployed` (a release record was written), `failed`, `gated` (stopped at a gate after the steps before it ran), or `not-run`. */
33
+ outcome: DeployOutcomeState;
34
+ /** The artifact digest the run was deploying. */
35
+ digest: string;
36
+ /** The release the run was deploying for this component, or null when it named none. */
37
+ releaseDigest: string | null;
38
+ }
39
+ /** One line of `<env>/outcomes.jsonl`. */
40
+ export interface DeployOutcome {
41
+ version: 1;
42
+ env: string;
43
+ verb: "promote" | "rollback" | "redeploy";
44
+ /** The run id the run's release records carry. */
45
+ runId: string;
46
+ /** The timestamp the run's release records carry. */
47
+ timestamp: string;
48
+ actor: string;
49
+ /** The release the run deployed under (`--release`), or null. */
50
+ releaseDigest: string | null;
51
+ /** How the run ended. */
52
+ status: "fail" | "gated";
53
+ components: DeployOutcomeComponent[];
54
+ }
55
+ /**
56
+ * The outcome to record for a run, or null when there is nothing to record:
57
+ * every planned component deployed, or the run stopped at a gate with
58
+ * nothing deployed and nothing failed.
59
+ */
60
+ export declare function deployOutcomeOf(input: {
61
+ verb: DeployOutcome["verb"];
62
+ plan: PromotionPlan;
63
+ run: Pick<DriverRunResult, "status" | "results">;
64
+ /** The release the run deployed under, if any. */
65
+ releaseDigest: string | null;
66
+ runId: string;
67
+ timestamp: string;
68
+ actor: string;
69
+ }): DeployOutcome | null;
70
+ /** Parse the lines of an `outcomes.jsonl`, oldest first. A line that is not an outcome is counted and skipped. */
71
+ export declare function parseDeployOutcomes(text: string | null): {
72
+ outcomes: DeployOutcome[];
73
+ malformed: number;
74
+ };
75
+ /** Append one outcome to `<env>/outcomes.jsonl`. Does not push; the caller pushes with the release records. */
76
+ export declare function appendDeployOutcome(outcome: DeployOutcome, opts?: {
77
+ cwd?: string;
78
+ }): Promise<string>;
79
+ /** Every outcome recorded for `env`, oldest first, read where `readReleaseLedger` reads; `[]` when none is. */
80
+ export declare function readDeployOutcomes(env: string, opts?: import("./git.js").LedgerLocation): Promise<DeployOutcome[]>;
81
+ //# sourceMappingURL=deploy-outcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-outcome.d.ts","sourceRoot":"","sources":["../../src/lifecycle/deploy-outcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,mFAAmF;AACnF,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C,kDAAkD;AAClD,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7E,MAAM,WAAW,sBAA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E,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAG1G;AAED,+GAA+G;AAC/G,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAGrH"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * What a promote, rollback or redeploy left behind when it did not deploy
3
+ * every component it planned (#4035).
4
+ *
5
+ * The release ledger records a component only once its deploy succeeded, so
6
+ * after a run that applied partly it still names the earlier release for
7
+ * every component that failed, and nothing says that component may be
8
+ * running part of the new one. A deploy outcome is the record of that run:
9
+ * one line per run in `<env>/outcomes.jsonl` on `chant/lifecycle`, beside
10
+ * the environment's `releases.jsonl` and under the same member prefix,
11
+ * naming each planned component and what happened to it.
12
+ *
13
+ * It is written only when the run ended with some components deployed and
14
+ * others not, or with a component that failed. A run that stopped at a gate
15
+ * before deploying anything changed nothing in the environment; its pending
16
+ * gate is what `workspace status` shows for it.
17
+ *
18
+ * The file is append-only, like the release ledger. Whether the environment
19
+ * is still mixed is derived when it is read ({@link ./mixed-environment.ts}):
20
+ * a component the outcome names as failed or gated stays unsettled until the
21
+ * release ledger has a newer record of it, which a redeploy, a rollback or
22
+ * the same promote run again writes.
23
+ */
24
+ import { sortedJsonReplacer } from "../utils.js";
25
+ /** The file a deploy outcome is appended to, under the environment's directory. */
26
+ export const OUTCOMES_FILE = "outcomes.jsonl";
27
+ /**
28
+ * The outcome to record for a run, or null when there is nothing to record:
29
+ * every planned component deployed, or the run stopped at a gate with
30
+ * nothing deployed and nothing failed.
31
+ */
32
+ export function deployOutcomeOf(input) {
33
+ const { plan, run } = input;
34
+ if (run.status === "ok")
35
+ return null;
36
+ const components = plan.items.map((item) => {
37
+ const result = run.results.find((r) => r.component === item.component);
38
+ const outcome = !result ? "not-run" : result.status === "ok" ? "deployed" : result.status === "gated" ? "gated" : "failed";
39
+ return {
40
+ component: item.component,
41
+ outcome,
42
+ digest: item.digest,
43
+ releaseDigest: input.releaseDigest ?? item.source.releaseDigest ?? null,
44
+ };
45
+ });
46
+ const deployed = components.some((c) => c.outcome === "deployed");
47
+ const failed = components.some((c) => c.outcome === "failed");
48
+ if (!deployed && !failed)
49
+ return null;
50
+ return {
51
+ version: 1,
52
+ env: plan.to,
53
+ verb: input.verb,
54
+ runId: input.runId,
55
+ timestamp: input.timestamp,
56
+ actor: input.actor,
57
+ releaseDigest: input.releaseDigest,
58
+ status: run.status,
59
+ components,
60
+ };
61
+ }
62
+ const STATES = ["deployed", "failed", "gated", "not-run"];
63
+ function isOutcome(v) {
64
+ const o = v;
65
+ return (o !== null &&
66
+ typeof o === "object" &&
67
+ o.version === 1 &&
68
+ typeof o.env === "string" &&
69
+ typeof o.runId === "string" &&
70
+ typeof o.timestamp === "string" &&
71
+ Array.isArray(o.components) &&
72
+ o.components.every((c) => c && typeof c.component === "string" && STATES.includes(c.outcome) && typeof c.digest === "string"));
73
+ }
74
+ /** Parse the lines of an `outcomes.jsonl`, oldest first. A line that is not an outcome is counted and skipped. */
75
+ export function parseDeployOutcomes(text) {
76
+ const outcomes = [];
77
+ let malformed = 0;
78
+ for (const line of (text ?? "").split("\n").map((l) => l.trim()).filter(Boolean)) {
79
+ try {
80
+ const parsed = JSON.parse(line);
81
+ if (isOutcome(parsed))
82
+ outcomes.push(parsed);
83
+ else
84
+ malformed++;
85
+ }
86
+ catch {
87
+ malformed++;
88
+ }
89
+ }
90
+ return { outcomes, malformed };
91
+ }
92
+ /** Append one outcome to `<env>/outcomes.jsonl`. Does not push; the caller pushes with the release records. */
93
+ export async function appendDeployOutcome(outcome, opts) {
94
+ const { appendLedgerLine } = await import("./git.js");
95
+ return appendLedgerLine(outcome.env, OUTCOMES_FILE, JSON.stringify(outcome, sortedJsonReplacer), "Deploy outcome", opts);
96
+ }
97
+ /** Every outcome recorded for `env`, oldest first, read where `readReleaseLedger` reads; `[]` when none is. */
98
+ export async function readDeployOutcomes(env, opts) {
99
+ const { readBlobFromPath } = await import("./git.js");
100
+ return parseDeployOutcomes(await readBlobFromPath(env, OUTCOMES_FILE, opts)).outcomes;
101
+ }
@@ -10,14 +10,22 @@
10
10
  * (`../change-set-graph.ts`), and stores the document under its digest
11
11
  * (`./change-set-store.ts`).
12
12
  *
13
+ * Each entry mapped onto a node that has a source location also records that
14
+ * file from the repository root as `source` (#4025), which the overlap report
15
+ * in `workspace status` attributes the entry to work items by.
16
+ *
13
17
  * The graph is read only when the digest is not stored yet. A graph that
14
18
  * can't be read never stops the gate: the document is stored with `graph:
15
19
  * null` and every `node` null, and the caller gets a warning to print.
16
20
  */
17
21
  import type { ChangeSetDocument, ChangeSetGraph } from "../change-set.js";
18
- /** Reads the node ids of the graph of the project at `projectDir`. */
22
+ /**
23
+ * Reads the node ids of the graph of the project at `projectDir`, with each
24
+ * node's source file (relative to `projectDir`) when the graph gives one.
25
+ */
19
26
  export type GraphIdReader = (projectDir: string) => Promise<{
20
27
  ids: string[];
28
+ sources?: Record<string, string>;
21
29
  } | {
22
30
  error: string;
23
31
  }>;
@@ -29,6 +37,7 @@ export type GraphIdReader = (projectDir: string) => Promise<{
29
37
  */
30
38
  export declare function readGraphIds(projectDir: string, args?: readonly string[]): Promise<{
31
39
  ids: string[];
40
+ sources: Record<string, string>;
32
41
  } | {
33
42
  error: string;
34
43
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"gate-change-set.d.ts","sourceRoot":"","sources":["../../src/lifecycle/gate-change-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIvE,sEAAsE;AACtE,MAAM,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,K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,11 +10,16 @@
10
10
  * (`../change-set-graph.ts`), and stores the document under its digest
11
11
  * (`./change-set-store.ts`).
12
12
  *
13
+ * Each entry mapped onto a node that has a source location also records that
14
+ * file from the repository root as `source` (#4025), which the overlap report
15
+ * in `workspace status` attributes the entry to work items by.
16
+ *
13
17
  * The graph is read only when the digest is not stored yet. A graph that
14
18
  * can't be read never stops the gate: the document is stored with `graph:
15
19
  * null` and every `node` null, and the caller gets a warning to print.
16
20
  */
17
- import { spawn } from "node:child_process";
21
+ import { execFileSync, spawn } from "node:child_process";
22
+ import { posix } from "node:path";
18
23
  import { mapChangeSetToGraph } from "../change-set-graph.js";
19
24
  import { persistChangeSet, readStoredChangeSet } from "./change-set-store.js";
20
25
  import { resolveMemberLedger } from "./member-ledger.js";
@@ -55,7 +60,11 @@ export async function readGraphIds(projectDir, args = []) {
55
60
  const read = readMemberIr(out.stdout);
56
61
  if ("reason" in read)
57
62
  return { error: read.reason.message };
58
- return { ids: read.ir.nodes.map((n) => n.id) };
63
+ const sources = {};
64
+ for (const n of read.ir.nodes)
65
+ if (n.sourceLoc?.file)
66
+ sources[n.id] = n.sourceLoc.file;
67
+ return { ids: read.ir.nodes.map((n) => n.id), sources };
59
68
  }
60
69
  let graphReaderOverride;
61
70
  /**
@@ -71,6 +80,29 @@ export function setGraphIdReader(reader) {
71
80
  export function gateGraphReader(args = []) {
72
81
  return graphReaderOverride ?? ((dir) => readGraphIds(dir, args));
73
82
  }
83
+ /**
84
+ * Each node's source file as a path from the repository root (#4025): the
85
+ * graph gives it relative to the member's directory at `cwd`. Undefined when
86
+ * the graph gives none or `cwd` is in no git repository.
87
+ */
88
+ function repoSources(cwd, sources) {
89
+ if (!sources || Object.keys(sources).length === 0)
90
+ return undefined;
91
+ let prefix;
92
+ try {
93
+ prefix = execFileSync("git", ["rev-parse", "--show-prefix"], { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
94
+ }
95
+ catch {
96
+ return undefined;
97
+ }
98
+ const out = new Map();
99
+ for (const [id, file] of Object.entries(sources)) {
100
+ const path = posix.normalize(posix.join(prefix, file.split("\\").join("/")));
101
+ if (!path.startsWith("../") && path !== "..")
102
+ out.set(id, path);
103
+ }
104
+ return out;
105
+ }
74
106
  /**
75
107
  * Store `doc` under its digest in the member's ledger at `cwd`, mapped onto
76
108
  * the member's graph, unless it is stored already. Does not push; the gate's
@@ -90,7 +122,7 @@ export async function storeGateChangeSet(input) {
90
122
  if ("error" in read)
91
123
  warning = read.error;
92
124
  else
93
- nodes = { member, at: input.at ?? null, ids: read.ids };
125
+ nodes = { member, at: input.at ?? null, ids: read.ids, sources: repoSources(cwd, read.sources) };
94
126
  }
95
127
  catch (err) {
96
128
  warning = err instanceof Error ? err.message : String(err);
@@ -2,6 +2,7 @@ import { type GateOrigin } from "./gate-origin.js";
2
2
  import type { GateApprover, GatePolicyDecision, ResolvedGateApproval } from "../op/gate-approval.js";
3
3
  import type { GateApprovalSource } from "../op/op-waves.js";
4
4
  import type { GateRunLocator } from "../op/gate-run-locator.js";
5
+ import { type LedgerLocation } from "./git.js";
5
6
  export { DEFAULT_GATE_EXPIRY, isApprovalUrl, resolveApprovalUrl } from "./gate-pending.js";
6
7
  export { isPendingGateExpired, latestPendingGate, latestResolutionForPlan, latestResolutionSince, type PlanBoundResolution, } from "./gate-ledger-select.js";
7
8
  /** The directory on the `chant/lifecycle` branch that holds gate ledgers, under a member's prefix when it has one. */
@@ -390,9 +391,7 @@ export declare function appendPendingGate(input: PendingGateInput, opts?: {
390
391
  * graceful-degradation stance `readConvergeLedger` takes. Returns empty arrays
391
392
  * (never throws) when `op` has nothing recorded yet.
392
393
  */
393
- export declare function readGateLedger(op: string, opts?: {
394
- cwd?: string;
395
- }): Promise<{
394
+ export declare function readGateLedger(op: string, opts?: LedgerLocation): Promise<{
396
395
  resolutions: GateResolutionRecord[];
397
396
  pending: PendingGateRecord[];
398
397
  malformed: number;
@@ -1 +1 @@
1
- {"version":3,"file":"gate-ledger.d.ts","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