@intentius/chant 0.124.88 → 0.124.90

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 (377) hide show
  1. package/dist/actor.d.ts +36 -1
  2. package/dist/actor.d.ts.map +1 -1
  3. package/dist/actor.js +39 -1
  4. package/dist/chant-install.d.ts.map +1 -1
  5. package/dist/chant-install.js +1 -2
  6. package/dist/ci-base.d.ts +30 -0
  7. package/dist/ci-base.d.ts.map +1 -0
  8. package/dist/ci-base.js +33 -0
  9. package/dist/ci-comment-commands.d.ts +193 -0
  10. package/dist/ci-comment-commands.d.ts.map +1 -0
  11. package/dist/ci-comment-commands.js +353 -0
  12. package/dist/ci-comment-replies.d.ts +40 -0
  13. package/dist/ci-comment-replies.d.ts.map +1 -0
  14. package/dist/ci-comment-replies.js +59 -0
  15. package/dist/ci-evidence-from-job.d.ts +25 -0
  16. package/dist/ci-evidence-from-job.d.ts.map +1 -1
  17. package/dist/ci-evidence-from-job.js +43 -2
  18. package/dist/ci-evidence-jobs.d.ts +30 -1
  19. package/dist/ci-evidence-jobs.d.ts.map +1 -1
  20. package/dist/ci-evidence-jobs.js +46 -3
  21. package/dist/ci-image.d.ts +21 -4
  22. package/dist/ci-image.d.ts.map +1 -1
  23. package/dist/ci-image.js +62 -10
  24. package/dist/ci-job-guard.d.ts +42 -45
  25. package/dist/ci-job-guard.d.ts.map +1 -1
  26. package/dist/ci-job-guard.js +206 -3
  27. package/dist/ci-note-commands.d.ts +104 -4
  28. package/dist/ci-note-commands.d.ts.map +1 -1
  29. package/dist/ci-note-commands.js +131 -38
  30. package/dist/ci-product-words.d.ts +42 -0
  31. package/dist/ci-product-words.d.ts.map +1 -1
  32. package/dist/ci-product-words.js +25 -0
  33. package/dist/ci-product.d.ts +72 -1
  34. package/dist/ci-product.d.ts.map +1 -1
  35. package/dist/ci-product.js +73 -6
  36. package/dist/cli/commands/build.d.ts.map +1 -1
  37. package/dist/cli/commands/build.js +29 -2
  38. package/dist/cli/handlers/approve.d.ts.map +1 -1
  39. package/dist/cli/handlers/approve.js +2 -1
  40. package/dist/cli/handlers/ci-check.d.ts +1 -1
  41. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  42. package/dist/cli/handlers/ci-check.js +17 -7
  43. package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
  44. package/dist/cli/handlers/ci-evidence.js +33 -7
  45. package/dist/cli/handlers/components.d.ts.map +1 -1
  46. package/dist/cli/handlers/components.js +3 -1
  47. package/dist/cli/handlers/generated-check.d.ts +8 -0
  48. package/dist/cli/handlers/generated-check.d.ts.map +1 -1
  49. package/dist/cli/handlers/generated-check.js +31 -1
  50. package/dist/cli/handlers/lock.d.ts.map +1 -1
  51. package/dist/cli/handlers/lock.js +121 -4
  52. package/dist/cli/handlers/pr-comment.d.ts +33 -0
  53. package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
  54. package/dist/cli/handlers/pr-comment.js +201 -0
  55. package/dist/cli/handlers/pr-env.d.ts.map +1 -1
  56. package/dist/cli/handlers/pr-env.js +6 -3
  57. package/dist/cli/handlers/pr-notes.d.ts.map +1 -1
  58. package/dist/cli/handlers/pr-notes.js +23 -1
  59. package/dist/cli/handlers/pr.d.ts +23 -1
  60. package/dist/cli/handlers/pr.d.ts.map +1 -1
  61. package/dist/cli/handlers/pr.js +71 -23
  62. package/dist/cli/handlers/promote.d.ts.map +1 -1
  63. package/dist/cli/handlers/promote.js +2 -1
  64. package/dist/cli/handlers/release.d.ts.map +1 -1
  65. package/dist/cli/handlers/release.js +11 -2
  66. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  67. package/dist/cli/handlers/run-wave.js +180 -4
  68. package/dist/cli/handlers/run.d.ts.map +1 -1
  69. package/dist/cli/handlers/run.js +2 -1
  70. package/dist/cli/main.d.ts.map +1 -1
  71. package/dist/cli/main.js +41 -2
  72. package/dist/cli/parse-args.d.ts.map +1 -1
  73. package/dist/cli/parse-args.js +31 -0
  74. package/dist/cli/registry.d.ts +19 -1
  75. package/dist/cli/registry.d.ts.map +1 -1
  76. package/dist/components/auto-release.d.ts.map +1 -1
  77. package/dist/components/auto-release.js +2 -1
  78. package/dist/components/pr-checks.d.ts +97 -6
  79. package/dist/components/pr-checks.d.ts.map +1 -1
  80. package/dist/components/pr-checks.js +107 -13
  81. package/dist/components/pr-pipeline.d.ts +19 -14
  82. package/dist/components/pr-pipeline.d.ts.map +1 -1
  83. package/dist/components/pr-pipeline.js +7 -13
  84. package/dist/components/product-pipeline.d.ts +96 -3
  85. package/dist/components/product-pipeline.d.ts.map +1 -1
  86. package/dist/components/product-pipeline.js +120 -14
  87. package/dist/components/product-plan.d.ts +203 -6
  88. package/dist/components/product-plan.d.ts.map +1 -1
  89. package/dist/components/product-plan.js +250 -43
  90. package/dist/drift-record.d.ts +7 -0
  91. package/dist/drift-record.d.ts.map +1 -1
  92. package/dist/drift-record.js +19 -0
  93. package/dist/floor-table.data.d.ts.map +1 -1
  94. package/dist/floor-table.data.js +63 -31
  95. package/dist/forge-check/contract.d.ts +11 -1
  96. package/dist/forge-check/contract.d.ts.map +1 -1
  97. package/dist/forge-check/contract.js +4 -1
  98. package/dist/forge-check/index.d.ts +2 -0
  99. package/dist/forge-check/index.d.ts.map +1 -1
  100. package/dist/forge-check/index.js +2 -0
  101. package/dist/gate-resume-run.d.ts +9 -1
  102. package/dist/gate-resume-run.d.ts.map +1 -1
  103. package/dist/gate-resume-run.js +26 -3
  104. package/dist/generated-check.d.ts +18 -4
  105. package/dist/generated-check.d.ts.map +1 -1
  106. package/dist/generated-check.js +37 -5
  107. package/dist/image-pins.d.ts +26 -0
  108. package/dist/image-pins.d.ts.map +1 -0
  109. package/dist/image-pins.js +19 -0
  110. package/dist/lexicon.d.ts +93 -4
  111. package/dist/lexicon.d.ts.map +1 -1
  112. package/dist/lifecycle/gate-applied.d.ts +9 -0
  113. package/dist/lifecycle/gate-applied.d.ts.map +1 -1
  114. package/dist/lifecycle/git.d.ts +11 -0
  115. package/dist/lifecycle/git.d.ts.map +1 -1
  116. package/dist/lifecycle/git.js +30 -3
  117. package/dist/lifecycle/publish-npm.d.ts +11 -0
  118. package/dist/lifecycle/publish-npm.d.ts.map +1 -1
  119. package/dist/lifecycle/publish-npm.js +27 -1
  120. package/dist/lifecycle/reach-locks.d.ts +131 -0
  121. package/dist/lifecycle/reach-locks.d.ts.map +1 -0
  122. package/dist/lifecycle/reach-locks.js +118 -0
  123. package/dist/lifecycle/release-cut.d.ts +3 -1
  124. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  125. package/dist/lifecycle/release-cut.js +15 -0
  126. package/dist/lifecycle/release-images.d.ts.map +1 -1
  127. package/dist/lifecycle/release-images.js +1 -2
  128. package/dist/notify-product.d.ts +12 -3
  129. package/dist/notify-product.d.ts.map +1 -1
  130. package/dist/notify-product.js +10 -6
  131. package/dist/op/activities/source-release.d.ts.map +1 -1
  132. package/dist/op/activities/source-release.js +2 -1
  133. package/dist/op/activities/source-rollback.d.ts.map +1 -1
  134. package/dist/op/activities/source-rollback.js +2 -1
  135. package/dist/op/apply-status.d.ts +84 -0
  136. package/dist/op/apply-status.d.ts.map +1 -0
  137. package/dist/op/apply-status.js +106 -0
  138. package/dist/op/before-merge-decide.d.ts +102 -0
  139. package/dist/op/before-merge-decide.d.ts.map +1 -0
  140. package/dist/op/before-merge-decide.js +142 -0
  141. package/dist/op/before-merge-done.d.ts +56 -0
  142. package/dist/op/before-merge-done.d.ts.map +1 -0
  143. package/dist/op/before-merge-done.js +69 -0
  144. package/dist/op/before-merge-store.d.ts +20 -0
  145. package/dist/op/before-merge-store.d.ts.map +1 -0
  146. package/dist/op/before-merge-store.js +48 -0
  147. package/dist/op/before-merge.d.ts +150 -0
  148. package/dist/op/before-merge.d.ts.map +1 -0
  149. package/dist/op/before-merge.js +207 -0
  150. package/dist/op/follow-on-run.d.ts +117 -0
  151. package/dist/op/follow-on-run.d.ts.map +1 -0
  152. package/dist/op/follow-on-run.js +154 -0
  153. package/dist/op/follow-on-store.d.ts +17 -0
  154. package/dist/op/follow-on-store.d.ts.map +1 -0
  155. package/dist/op/follow-on-store.js +54 -0
  156. package/dist/op/gate.d.ts +6 -0
  157. package/dist/op/gate.d.ts.map +1 -1
  158. package/dist/op/gate.js +10 -1
  159. package/dist/op/index.d.ts +5 -1
  160. package/dist/op/index.d.ts.map +1 -1
  161. package/dist/op/index.js +2 -0
  162. package/dist/op/op-waves-after-plan.d.ts +13 -0
  163. package/dist/op/op-waves-after-plan.d.ts.map +1 -1
  164. package/dist/op/op-waves-evidence-jobs.d.ts +10 -2
  165. package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
  166. package/dist/op/op-waves-evidence-jobs.js +19 -5
  167. package/dist/op/op-waves-follow-on.d.ts +162 -0
  168. package/dist/op/op-waves-follow-on.d.ts.map +1 -0
  169. package/dist/op/op-waves-follow-on.js +355 -0
  170. package/dist/op/op-waves-render-spec.d.ts +100 -0
  171. package/dist/op/op-waves-render-spec.d.ts.map +1 -0
  172. package/dist/op/op-waves-render-spec.js +162 -0
  173. package/dist/op/op-waves-run.d.ts +148 -6
  174. package/dist/op/op-waves-run.d.ts.map +1 -1
  175. package/dist/op/op-waves-run.js +873 -100
  176. package/dist/op/op-waves-split.d.ts +122 -0
  177. package/dist/op/op-waves-split.d.ts.map +1 -0
  178. package/dist/op/op-waves-split.js +166 -0
  179. package/dist/op/op-waves.d.ts +24 -0
  180. package/dist/op/op-waves.d.ts.map +1 -1
  181. package/dist/op/op-waves.js +18 -1
  182. package/dist/op/schedule-overdue.d.ts +15 -1
  183. package/dist/op/schedule-overdue.d.ts.map +1 -1
  184. package/dist/op/schedule-overdue.js +77 -5
  185. package/dist/op/stage-hooks.d.ts +36 -1
  186. package/dist/op/stage-hooks.d.ts.map +1 -1
  187. package/dist/op/stage-hooks.js +17 -3
  188. package/dist/op/wave-stop.d.ts +67 -0
  189. package/dist/op/wave-stop.d.ts.map +1 -0
  190. package/dist/op/wave-stop.js +129 -0
  191. package/dist/planned-files.d.ts +76 -0
  192. package/dist/planned-files.d.ts.map +1 -0
  193. package/dist/planned-files.js +108 -0
  194. package/dist/pr-forge-job.d.ts +22 -0
  195. package/dist/pr-forge-job.d.ts.map +1 -0
  196. package/dist/pr-forge-job.js +46 -0
  197. package/dist/pr-loop.d.ts +3 -6
  198. package/dist/pr-loop.d.ts.map +1 -1
  199. package/dist/pr-loop.js +4 -81
  200. package/dist/pr-plan-note.d.ts +97 -0
  201. package/dist/pr-plan-note.d.ts.map +1 -1
  202. package/dist/pr-plan-note.js +94 -1
  203. package/dist/pr-post.d.ts +28 -3
  204. package/dist/pr-post.d.ts.map +1 -1
  205. package/dist/pr-post.js +146 -13
  206. package/dist/pr-status.d.ts +16 -0
  207. package/dist/pr-status.d.ts.map +1 -0
  208. package/dist/pr-status.js +90 -0
  209. package/dist/ref-gate-init.d.ts +16 -2
  210. package/dist/ref-gate-init.d.ts.map +1 -1
  211. package/dist/ref-gate-init.js +24 -13
  212. package/dist/release-floors.d.ts +39 -1
  213. package/dist/release-floors.d.ts.map +1 -1
  214. package/dist/release-floors.js +63 -25
  215. package/dist/render-module.d.ts +15 -0
  216. package/dist/render-module.d.ts.map +1 -0
  217. package/dist/render-module.js +73 -0
  218. package/dist/state-migration.d.ts.map +1 -1
  219. package/dist/state-migration.js +1 -2
  220. package/dist/wave-blocked.d.ts +7 -1
  221. package/dist/wave-blocked.d.ts.map +1 -1
  222. package/dist/wave-blocked.js +7 -2
  223. package/dist/wave-runtime.mjs +366 -350
  224. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  225. package/dist/workspace/ci-green-cli.js +3 -2
  226. package/dist/workspace/release-train.d.ts.map +1 -1
  227. package/dist/workspace/release-train.js +2 -1
  228. package/dist/workspace/release-workflow.d.ts +4 -3
  229. package/dist/workspace/release-workflow.d.ts.map +1 -1
  230. package/dist/workspace/release-workflow.js +10 -7
  231. package/dist/workspace/trust/check-evidence-report.d.ts +7 -2
  232. package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
  233. package/dist/workspace/trust/check-evidence-report.js +15 -8
  234. package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
  235. package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
  236. package/dist/workspace/trust/ref-gate-cli.js +30 -10
  237. package/dist/workspace/workspace-run.d.ts.map +1 -1
  238. package/dist/workspace/workspace-run.js +2 -1
  239. package/package.json +1 -1
  240. package/src/actor.test.ts +68 -2
  241. package/src/actor.ts +61 -1
  242. package/src/chant-install.test.ts +2 -3
  243. package/src/chant-install.ts +1 -2
  244. package/src/ci-base.test.ts +41 -0
  245. package/src/ci-base.ts +43 -0
  246. package/src/ci-comment-commands.test.ts +439 -0
  247. package/src/ci-comment-commands.ts +428 -0
  248. package/src/ci-comment-replies.ts +78 -0
  249. package/src/ci-commit.test.ts +2 -3
  250. package/src/ci-evidence-from-job.test.ts +18 -0
  251. package/src/ci-evidence-from-job.ts +58 -2
  252. package/src/ci-evidence-jobs.ts +50 -5
  253. package/src/ci-image.test.ts +130 -10
  254. package/src/ci-image.ts +85 -12
  255. package/src/ci-job-guard.before-merge.test.ts +148 -0
  256. package/src/ci-job-guard.follow-on-record.test.ts +137 -0
  257. package/src/ci-job-guard.follow-on.test.ts +144 -0
  258. package/src/ci-job-guard.ts +221 -3
  259. package/src/ci-note-commands.test.ts +76 -1
  260. package/src/ci-note-commands.ts +198 -46
  261. package/src/ci-product-words.ts +59 -0
  262. package/src/ci-product.ts +90 -6
  263. package/src/cli/commands/build.test.ts +41 -0
  264. package/src/cli/commands/build.ts +27 -2
  265. package/src/cli/handlers/approve.ts +2 -1
  266. package/src/cli/handlers/ci-check.ts +19 -7
  267. package/src/cli/handlers/ci-evidence.ts +29 -8
  268. package/src/cli/handlers/components.ts +3 -1
  269. package/src/cli/handlers/generated-check.ts +31 -1
  270. package/src/cli/handlers/lock-reach.test.ts +103 -0
  271. package/src/cli/handlers/lock.ts +100 -4
  272. package/src/cli/handlers/pr-comment.ts +187 -0
  273. package/src/cli/handlers/pr-env.ts +6 -3
  274. package/src/cli/handlers/pr-notes.ts +30 -6
  275. package/src/cli/handlers/pr-record.test.ts +1 -1
  276. package/src/cli/handlers/pr.ts +64 -21
  277. package/src/cli/handlers/promote.ts +2 -1
  278. package/src/cli/handlers/release.e2e.test.ts +35 -0
  279. package/src/cli/handlers/release.ts +14 -2
  280. package/src/cli/handlers/run-wave.ts +170 -4
  281. package/src/cli/handlers/run.ts +2 -1
  282. package/src/cli/main.ts +41 -2
  283. package/src/cli/parse-args.ts +23 -0
  284. package/src/cli/registry.ts +19 -1
  285. package/src/components/auto-release.ts +2 -1
  286. package/src/components/pr-checks.ts +165 -17
  287. package/src/components/pr-pipeline.ts +22 -18
  288. package/src/components/product-pipeline.apply-status.test.ts +50 -0
  289. package/src/components/product-pipeline.ts +204 -17
  290. package/src/components/product-plan.test.ts +60 -4
  291. package/src/components/product-plan.ts +367 -50
  292. package/src/drift-record.test.ts +20 -0
  293. package/src/drift-record.ts +16 -0
  294. package/src/floor-table.data.ts +63 -31
  295. package/src/forge-check/contract.ts +12 -1
  296. package/src/forge-check/forge-check.test.ts +17 -0
  297. package/src/forge-check/index.ts +2 -0
  298. package/src/gate-resume-run.ts +27 -3
  299. package/src/generated-check.e2e.test.ts +21 -1
  300. package/src/generated-check.test.ts +66 -0
  301. package/src/generated-check.ts +51 -10
  302. package/src/image-pins.ts +31 -0
  303. package/src/lexicon.ts +89 -1
  304. package/src/lifecycle/gate-applied.ts +7 -0
  305. package/src/lifecycle/git.test.ts +48 -0
  306. package/src/lifecycle/git.ts +27 -4
  307. package/src/lifecycle/publish-npm.ts +31 -1
  308. package/src/lifecycle/reach-locks.test.ts +87 -0
  309. package/src/lifecycle/reach-locks.ts +169 -0
  310. package/src/lifecycle/release-cut.ts +17 -1
  311. package/src/lifecycle/release-images.test.ts +56 -0
  312. package/src/lifecycle/release-images.ts +1 -2
  313. package/src/notify-product.ts +19 -8
  314. package/src/op/activities/source-release.ts +2 -1
  315. package/src/op/activities/source-rollback.ts +2 -1
  316. package/src/op/apply-status.test.ts +83 -0
  317. package/src/op/apply-status.ts +132 -0
  318. package/src/op/before-merge-decide.ts +190 -0
  319. package/src/op/before-merge-done.ts +99 -0
  320. package/src/op/before-merge-store.ts +44 -0
  321. package/src/op/before-merge.test.ts +201 -0
  322. package/src/op/before-merge.ts +266 -0
  323. package/src/op/follow-on-run.ts +206 -0
  324. package/src/op/follow-on-store.ts +54 -0
  325. package/src/op/gate-resume.test.ts +27 -0
  326. package/src/op/gate.ts +16 -1
  327. package/src/op/index.ts +15 -0
  328. package/src/op/op-waves-after-plan.ts +13 -0
  329. package/src/op/op-waves-evidence-jobs.ts +21 -7
  330. package/src/op/op-waves-follow-on-record.test.ts +152 -0
  331. package/src/op/op-waves-follow-on.test.ts +247 -0
  332. package/src/op/op-waves-follow-on.ts +385 -0
  333. package/src/op/op-waves-notify-words.test.ts +18 -0
  334. package/src/op/op-waves-render-spec.test.ts +159 -0
  335. package/src/op/op-waves-render-spec.ts +171 -0
  336. package/src/op/op-waves-run.ts +973 -94
  337. package/src/op/op-waves-split-product.test.ts +288 -0
  338. package/src/op/op-waves-split-step.test.ts +298 -0
  339. package/src/op/op-waves-split.test.ts +196 -0
  340. package/src/op/op-waves-split.ts +189 -0
  341. package/src/op/op-waves.ts +31 -3
  342. package/src/op/schedule-overdue.test.ts +72 -1
  343. package/src/op/schedule-overdue.ts +84 -6
  344. package/src/op/stage-hooks.ts +52 -4
  345. package/src/op/wave-stop.test.ts +72 -0
  346. package/src/op/wave-stop.ts +139 -0
  347. package/src/planned-files.test.ts +80 -0
  348. package/src/planned-files.ts +134 -0
  349. package/src/pr-forge-job.test.ts +53 -0
  350. package/src/pr-forge-job.ts +46 -0
  351. package/src/pr-loop-narrowed.test.ts +2 -1
  352. package/src/pr-loop-words.test.ts +2 -1
  353. package/src/pr-loop.test.ts +1 -2
  354. package/src/pr-loop.ts +4 -80
  355. package/src/pr-plan-note.ts +155 -3
  356. package/src/pr-post-replan.test.ts +144 -0
  357. package/src/pr-post-subject.test.ts +230 -0
  358. package/src/pr-post.test.ts +2 -1
  359. package/src/pr-post.ts +151 -15
  360. package/src/pr-status.ts +91 -0
  361. package/src/ref-gate-init.ts +30 -11
  362. package/src/release-floors.ts +81 -25
  363. package/src/render-module.ts +73 -0
  364. package/src/state-migration-record.test.ts +2 -3
  365. package/src/state-migration.ts +1 -2
  366. package/src/wave-blocked.ts +9 -4
  367. package/src/workspace/ci-green-cli.ts +3 -2
  368. package/src/workspace/ci-green-workflow.test.ts +32 -1
  369. package/src/workspace/release-train.ts +2 -1
  370. package/src/workspace/release-workflow.test.ts +36 -5
  371. package/src/workspace/release-workflow.ts +10 -7
  372. package/src/workspace/trust/check-evidence-report.ts +15 -8
  373. package/src/workspace/trust/check-evidence.test.ts +5 -0
  374. package/src/workspace/trust/ref-gate-cli.ts +30 -8
  375. package/src/workspace/trust/ref-gate-pieces.test.ts +46 -1
  376. package/src/workspace/trust/ref-gate.test.ts +10 -0
  377. package/src/workspace/workspace-run.ts +2 -1
@@ -0,0 +1,144 @@
1
+ /**
2
+ * #4963: what pr-post does for the product plan's re-plan and for
3
+ * sql-yodeler's notes. A re-plan narrowed to an argument the change does not
4
+ * reach gets a "not affected" reply in place of the note and the status, as
5
+ * terragucci's plan-note job replied; a `PrReport` carries the product's
6
+ * marker as a hand-off does; and a hand-off may carry the product's own note
7
+ * text, defused and cut, under chant's marker and the product's.
8
+ */
9
+ import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
+ import { tmpdir } from "node:os";
11
+ import { join } from "node:path";
12
+ import { afterAll, describe, expect, test } from "vitest";
13
+ import { postPlanReport } from "./pr-post";
14
+ import { prNoteMarker, type PrReport } from "./pr-loop";
15
+ import { planBodyHandoff, planNoteHandoff, PR_PLAN_NOTE_FILE, type PrPlanNote } from "./pr-plan-note";
16
+ import { withProductWords } from "./ci-product-words";
17
+ import { GITHUB_COMMENT_LIMIT } from "./plan-summary";
18
+ import type { ForgeStatus, PrForge } from "./pr-forge";
19
+ import { TERRAGUCCI, TERRAGUCCI_NOTE } from "./__fixtures__/product-words";
20
+
21
+ const NOTE = JSON.parse(readFileSync(join(import.meta.dirname, "__fixtures__", "pr-loop", "terragucci-plan.note.json"), "utf-8")) as PrPlanNote;
22
+ const REPORT = JSON.parse(readFileSync(join(import.meta.dirname, "__fixtures__", "pr-loop", "pr-plan.golden.json"), "utf-8")) as PrReport;
23
+ const HEAD = NOTE.head;
24
+ const dirs: string[] = [];
25
+ afterAll(() => {
26
+ for (const d of dirs) rmSync(d, { recursive: true, force: true });
27
+ });
28
+
29
+ function dirWith(file: string, doc: unknown): string {
30
+ const dir = mkdtempSync(join(tmpdir(), "chant-pr-post-replan-"));
31
+ dirs.push(dir);
32
+ writeFileSync(join(dir, file), JSON.stringify(doc));
33
+ return dir;
34
+ }
35
+
36
+ function fakeForge(): { forge: PrForge; statuses: ForgeStatus[]; notes: Array<{ marker: string; body: string }>; comments: Array<{ pr: number; body: string }> } {
37
+ const statuses: ForgeStatus[] = [];
38
+ const notes: Array<{ marker: string; body: string }> = [];
39
+ const comments: Array<{ pr: number; body: string }> = [];
40
+ const forge = {
41
+ kind: "github",
42
+ host: "github.com",
43
+ async setStatus(_sha: string, status: ForgeStatus) {
44
+ statuses.push(status);
45
+ },
46
+ async upsertNote(_pr: number, marker: string, body: string) {
47
+ notes.push({ marker, body });
48
+ return "1";
49
+ },
50
+ async findComment() {
51
+ return undefined;
52
+ },
53
+ async addComment(pr: number, body: string) {
54
+ comments.push({ pr, body });
55
+ return { id: 1 };
56
+ },
57
+ } as unknown as PrForge;
58
+ return { forge, statuses, notes, comments };
59
+ }
60
+
61
+ const at = { pr: 7, env: "default", state: "success" as const, description: "nothing to plan" };
62
+ const markerWords = { ...TERRAGUCCI_NOTE, productMarker: "terragucci:plan" };
63
+ const nothing: PrPlanNote = { ...NOTE, nothing: true };
64
+
65
+ describe("a re-plan narrowed to an argument the change does not reach (#4963)", () => {
66
+ test("gets a not-affected reply, and the note and the status stay as they were", async () => {
67
+ const { forge, statuses, notes, comments } = fakeForge();
68
+ const r = await withProductWords(TERRAGUCCI, () => postPlanReport({ forge, dir: dirWith(PR_PLAN_NOTE_FILE, planNoteHandoff(nothing, at)), pr: 7, head: HEAD, env: "default", result: "success", notAffected: "live/db" }));
69
+ expect(comments).toEqual([{ pr: 7, body: "terragucci: live/db is not affected by this pull request, so nothing was planned." }]);
70
+ expect(notes).toEqual([]);
71
+ expect(statuses).toEqual([]);
72
+ expect(r).toMatchObject({ noted: false, warnings: [] });
73
+ });
74
+
75
+ test("a PrReport that says nothing gets the same reply", async () => {
76
+ const { forge, comments, notes } = fakeForge();
77
+ await withProductWords(TERRAGUCCI, () => postPlanReport({ forge, dir: dirWith("pr-plan.json", { ...REPORT, status: "nothing" }), pr: REPORT.pr!, head: REPORT.head, env: REPORT.env, notAffected: "live/db" }));
78
+ expect(comments).toHaveLength(1);
79
+ expect(notes).toEqual([]);
80
+ });
81
+
82
+ test("a plan that reaches the argument, an empty argument, or one that is not a plain word posts the note as before", async () => {
83
+ for (const [note, arg] of [[NOTE, "live/db"], [nothing, ""], [nothing, "a b"], [nothing, "$(x)"]] as const) {
84
+ const { forge, comments, notes } = fakeForge();
85
+ await withProductWords(TERRAGUCCI, () => postPlanReport({ forge, dir: dirWith(PR_PLAN_NOTE_FILE, planNoteHandoff(note, at)), pr: 7, head: HEAD, env: "default", notAffected: arg }));
86
+ expect(comments).toEqual([]);
87
+ expect(notes).toHaveLength(1);
88
+ }
89
+ });
90
+
91
+ test("a failed re-plan job posts its failure, not the reply", async () => {
92
+ const { forge, comments, statuses } = fakeForge();
93
+ await withProductWords(TERRAGUCCI, () => postPlanReport({ forge, dir: dirWith(PR_PLAN_NOTE_FILE, planNoteHandoff(nothing, at)), pr: 7, head: HEAD, env: "default", result: "failure", notAffected: "live/db" }));
94
+ expect(comments).toEqual([]);
95
+ expect(statuses[0]!.state).toBe("failure");
96
+ });
97
+ });
98
+
99
+ describe("the product's marker on a PrReport (#4963)", () => {
100
+ test("goes under chant's marker when the words name a productMarker, and the report's marker is plain words", async () => {
101
+ const { forge, notes } = fakeForge();
102
+ await postPlanReport({ forge, dir: dirWith("pr-plan.json", { ...REPORT, marker: "env=prod subject=abc_1" }), pr: REPORT.pr!, head: REPORT.head, env: REPORT.env, noteWords: { productMarker: "yodel:plan" } });
103
+ const lines = notes[0]!.body.split("\n");
104
+ expect(lines[0]).toBe(prNoteMarker(REPORT.env));
105
+ expect(lines[1]).toBe("<!-- yodel:plan env=prod subject=abc_1 -->");
106
+ });
107
+
108
+ test("a marker that is not plain words, or no productMarker, leaves the note as before", async () => {
109
+ const plain = fakeForge();
110
+ await postPlanReport({ forge: plain.forge, dir: dirWith("pr-plan.json", REPORT), pr: REPORT.pr!, head: REPORT.head, env: REPORT.env });
111
+ for (const [marker, noteWords] of [["env=prod --> <!-- x", { productMarker: "yodel:plan" }], ["env=prod", {}]] as const) {
112
+ const { forge, notes } = fakeForge();
113
+ await postPlanReport({ forge, dir: dirWith("pr-plan.json", { ...REPORT, marker }), pr: REPORT.pr!, head: REPORT.head, env: REPORT.env, noteWords });
114
+ expect(notes[0]!.body).toBe(plain.notes[0]!.body);
115
+ }
116
+ });
117
+ });
118
+
119
+ describe("a hand-off of the product's own note text (#4963)", () => {
120
+ const bodyAt = { pr: 7, head: HEAD, env: "default", member: "prod", state: "pending" as const, description: "the tenant set waits for an approval", marker: "env=prod" };
121
+
122
+ test("posts the body under chant's marker and the product's line, defused, with the notices under it", async () => {
123
+ const { forge, notes, statuses } = fakeForge();
124
+ const body = "### yodel plan for `prod`\n\n3 tenants, 2 migrations pending <!-- yodel:plan env=staging -->\n";
125
+ const r = await postPlanReport({ forge, dir: dirWith(PR_PLAN_NOTE_FILE, planBodyHandoff(body, bodyAt)), pr: 7, head: HEAD, env: "default", member: "prod", noteWords: { productMarker: "yodel:plan" }, notices: ["Op `yodel-drift` is overdue"] });
126
+ expect(r).toMatchObject({ state: "pending", noted: true });
127
+ expect(statuses[0]).toMatchObject({ context: "chant/plan/prod", state: "pending", description: "the tenant set waits for an approval" });
128
+ expect(notes[0]!.body).toBe(`${prNoteMarker("default", "prod")}\n<!-- yodel:plan env=prod -->\n### yodel plan for \`prod\`\n\n3 tenants, 2 migrations pending &lt;!-- yodel:plan env=staging -->\n\n> Op \`yodel-drift\` is overdue\n`);
129
+ });
130
+
131
+ test("a body past the forge's limit is cut to it", async () => {
132
+ const { forge, notes } = fakeForge();
133
+ await postPlanReport({ forge, dir: dirWith(PR_PLAN_NOTE_FILE, planBodyHandoff("x".repeat(GITHUB_COMMENT_LIMIT * 2), bodyAt)), pr: 7, head: HEAD, env: "default", member: "prod" });
134
+ expect(notes[0]!.body.length).toBeLessThanOrEqual(GITHUB_COMMENT_LIMIT);
135
+ });
136
+
137
+ test("a hand-off with both a note and a body is refused", async () => {
138
+ const { forge, notes, statuses } = fakeForge();
139
+ const r = await postPlanReport({ forge, dir: dirWith(PR_PLAN_NOTE_FILE, { ...planBodyHandoff("x", bodyAt), note: NOTE }), pr: 7, head: HEAD, env: "default", member: "prod" });
140
+ expect(r.refused).toMatch(/both a note and a body/);
141
+ expect(notes).toEqual([]);
142
+ expect(statuses[0]!.state).toBe("failure");
143
+ });
144
+ });
@@ -0,0 +1,230 @@
1
+ /**
2
+ * #4972: the note job compares the plan's subject with the previous note's.
3
+ * A plan verb hands its subject (an id and named parts) in the plan note
4
+ * hand-off; `pr-post` keeps it in a hidden line of the note, and on the
5
+ * next post reads the previous note of the same environment and member,
6
+ * and when the id differs adds a line in the note words saying what
7
+ * changed. The plan job reads no note, so this works on GitHub, Forgejo and
8
+ * GitLab (`pr-post --open`, from a pipeline of the target branch).
9
+ */
10
+ import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
11
+ import { tmpdir } from "node:os";
12
+ import { join } from "node:path";
13
+ import { afterAll, describe, expect, test } from "vitest";
14
+ import { postOpenPlanReports, postPlanReport, prNoteSubjectMarker, subjectInNote } from "./pr-post";
15
+ import { prNoteMarker } from "./pr-loop";
16
+ import { planBodyHandoff, planNoteHandoff, PLAN_SUBJECT_LIMIT, PR_PLAN_NOTE_FILE, sinceLastLine, subjectChanges, type PrPlanNote, type PrPlanNoteWords, type PrPlanSubject } from "./pr-plan-note";
17
+ import type { ForgeStatus, PrForge } from "./pr-forge";
18
+
19
+ const NOTE = JSON.parse(readFileSync(join(import.meta.dirname, "__fixtures__", "pr-loop", "terragucci-plan.note.json"), "utf-8")) as PrPlanNote;
20
+ const HEAD = NOTE.head;
21
+ const dirs: string[] = [];
22
+ afterAll(() => {
23
+ for (const d of dirs) rmSync(d, { recursive: true, force: true });
24
+ });
25
+
26
+ function dirWith(doc: unknown): string {
27
+ const dir = mkdtempSync(join(tmpdir(), "chant-pr-post-subject-"));
28
+ dirs.push(dir);
29
+ writeFileSync(join(dir, PR_PLAN_NOTE_FILE), JSON.stringify(doc));
30
+ return dir;
31
+ }
32
+
33
+ /** A forge that keeps each note by its marker, so a second post reads the first. */
34
+ function keepingForge(kind: "github" | "forgejo" | "gitlab" = "github") {
35
+ const notes = new Map<string, string>();
36
+ const asked: string[] = [];
37
+ const statuses: ForgeStatus[] = [];
38
+ const forge = {
39
+ kind,
40
+ host: kind === "gitlab" ? "gitlab.com" : kind === "forgejo" ? "codeberg.org" : "github.com",
41
+ async setStatus(_sha: string, status: ForgeStatus) {
42
+ statuses.push(status);
43
+ },
44
+ async upsertNote(_pr: number, marker: string, body: string) {
45
+ notes.set(marker, body);
46
+ return "1";
47
+ },
48
+ async findComment(_pr: number, marker: string) {
49
+ asked.push(marker);
50
+ const body = notes.get(marker);
51
+ return body === undefined ? undefined : { id: 1, body };
52
+ },
53
+ } as unknown as PrForge;
54
+ return { forge, notes, asked, statuses };
55
+ }
56
+
57
+ /** sql-yodeler's words for what moved (its diffSubjects and describeMove), as note words. */
58
+ const YODEL_WORDS: PrPlanNoteWords = {
59
+ productMarker: "yodel:plan",
60
+ subjectParts: {
61
+ environment: { changed: "environment: the environment changed: {items}" },
62
+ applied: { added: "history changed: applied since: {items}", gone: "history changed: no longer recorded applied: {items}", changed: "history changed: recorded checksum changed (yodel repair): {items}" },
63
+ pending: { added: "pending migrations changed: new pending migrations: {items}", gone: "pending migrations changed: no longer pending (gone from the directory): {items}", changed: "pending migrations changed: files changed: {items}" },
64
+ live: { changed: "live schema changed: an object in the environment's live schema is not as it was" },
65
+ },
66
+ };
67
+
68
+ const FIRST: PrPlanSubject = { id: "sha256:aaa111", parts: { environment: "prod", "applied/001_init": "c1", "pending/002_users": "c2", live: "f1" } };
69
+ const SECOND: PrPlanSubject = { id: "sha256:bbb222", parts: { environment: "prod", "applied/001_init": "c1", "pending/002_users": "c2x", "pending/003_orders": "c3", live: "f2" } };
70
+ const at = (subject?: PrPlanSubject) => ({ pr: 7, env: "default", member: "prod", state: "pending" as const, description: "waits for approval", marker: "env=prod", ...(subject ? { subject } : {}) });
71
+ // chant's own words adopt no older marker, so the only note read is the comparison's and the upsert's.
72
+ const post = (forge: PrForge, doc: unknown, extra: Partial<Parameters<typeof postPlanReport>[0]> = {}) =>
73
+ postPlanReport({ forge, dir: dirWith(doc), pr: 7, head: HEAD, env: "default", member: "prod", noteWords: YODEL_WORDS, ...extra });
74
+
75
+ describe("the note keeps the plan's subject (#4972)", () => {
76
+ test("in a hidden chant line the next post reads back, with no line said on the first post", async () => {
77
+ const { forge, notes, asked } = keepingForge();
78
+ const r = await post(forge, planNoteHandoff(NOTE, at(FIRST)));
79
+ expect(r).toMatchObject({ noted: true, warnings: [] });
80
+ const body = notes.get(prNoteMarker("default", "prod"))!;
81
+ expect(body).toContain(`\n${prNoteSubjectMarker(FIRST)}\n`);
82
+ expect(subjectInNote(body)).toEqual(FIRST);
83
+ expect(body).not.toContain("Since the previous version");
84
+ expect(asked).toEqual([prNoteMarker("default", "prod")]);
85
+ });
86
+
87
+ test("a hand-off without a subject reads no previous note and keeps no line", async () => {
88
+ const { forge, notes, asked } = keepingForge();
89
+ await post(forge, planNoteHandoff(NOTE, at()));
90
+ expect(asked).toEqual([]);
91
+ expect(notes.get(prNoteMarker("default", "prod"))).not.toContain("chant-pr-subject");
92
+ });
93
+ });
94
+
95
+ describe("pr-post says what changed since the previous note (#4972)", () => {
96
+ for (const kind of ["github", "forgejo"] as const) {
97
+ test(`${kind}: a plan whose id moved gets the line in the product's words, part by part`, async () => {
98
+ const { forge, notes } = keepingForge(kind);
99
+ await post(forge, planNoteHandoff(NOTE, at(FIRST)));
100
+ await post(forge, planNoteHandoff(NOTE, at(SECOND)));
101
+ const body = notes.get(prNoteMarker("default", "prod"))!;
102
+ expect(body).toContain(
103
+ "Since the previous version of this note (`sha256:aaa111`): pending migrations changed: new pending migrations: 003_orders; pending migrations changed: files changed: 002_users; live schema changed: an object in the environment's live schema is not as it was.",
104
+ );
105
+ expect(subjectInNote(body)).toEqual(SECOND);
106
+ });
107
+ }
108
+
109
+ test("the same id says nothing", async () => {
110
+ const { forge, notes } = keepingForge();
111
+ await post(forge, planNoteHandoff(NOTE, at(FIRST)));
112
+ await post(forge, planNoteHandoff(NOTE, at(FIRST)));
113
+ expect(notes.get(prNoteMarker("default", "prod"))).not.toContain("Since the previous version");
114
+ });
115
+
116
+ test("a body hand-off gets the line as a notice under its body", async () => {
117
+ const { forge, notes } = keepingForge();
118
+ await post(forge, planBodyHandoff("### yodel plan for `prod`\n", { ...at(FIRST), head: HEAD }));
119
+ await post(forge, planBodyHandoff("### yodel plan for `prod`\n", { ...at({ id: "sha256:ccc", parts: { ...FIRST.parts, "applied/002_users": "c2" } }), head: HEAD }));
120
+ const body = notes.get(prNoteMarker("default", "prod"))!;
121
+ expect(body).toMatch(/^<!-- chant-pr:[^\n]*-->\n<!-- yodel:plan env=prod -->\n### yodel plan for `prod`\n\n> Since the previous version of this note \(`sha256:aaa111`\): history changed: applied since: 002_users\.\n<!-- chant-pr-subject:[A-Za-z0-9_-]+ -->\n$/);
122
+ });
123
+
124
+ test("only the same environment and member's note is compared", async () => {
125
+ const { forge, notes } = keepingForge();
126
+ await post(forge, planNoteHandoff(NOTE, at(FIRST)));
127
+ await post(forge, planNoteHandoff(NOTE, { ...at(SECOND), member: "staging" }), { member: "staging" });
128
+ expect(notes.get(prNoteMarker("default", "staging"))).not.toContain("Since the previous version");
129
+ });
130
+
131
+ test("a subject with no parts says only that the plan changed, in the words' sinceLastOnly", async () => {
132
+ const { forge, notes } = keepingForge();
133
+ await post(forge, planNoteHandoff(NOTE, at({ id: "d1" })));
134
+ await post(forge, planNoteHandoff(NOTE, at({ id: "d2" })), { noteWords: { ...YODEL_WORDS, sinceLastOnly: "Moved since `{previous}`." } });
135
+ expect(notes.get(prNoteMarker("default", "prod"))).toContain("Moved since `d1`.");
136
+ });
137
+
138
+ test("a subject too long for its line is kept by its id alone, and the next line says only that it changed", async () => {
139
+ const { forge, notes } = keepingForge();
140
+ const parts = Object.fromEntries(Array.from({ length: 400 }, (_, i) => [`applied/m${i}`, "x".repeat(64)]));
141
+ await post(forge, planNoteHandoff(NOTE, at({ id: "big1", parts })));
142
+ const kept = subjectInNote(notes.get(prNoteMarker("default", "prod"))!);
143
+ expect(kept).toEqual({ id: "big1" });
144
+ expect(prNoteSubjectMarker({ id: "big1", parts })!.length).toBeLessThanOrEqual(PLAN_SUBJECT_LIMIT);
145
+ await post(forge, planNoteHandoff(NOTE, at({ id: "big2", parts })));
146
+ expect(notes.get(prNoteMarker("default", "prod"))).toContain("The plan changed since the previous version of this note (`big1`).");
147
+ });
148
+
149
+ test("a forge that refuses the read is a warning, and the note is posted", async () => {
150
+ const { forge, notes } = keepingForge();
151
+ (forge as { findComment: unknown }).findComment = async () => {
152
+ throw new Error("403");
153
+ };
154
+ const r = await post(forge, planNoteHandoff(NOTE, at(FIRST)));
155
+ expect(r.noted).toBe(true);
156
+ expect(r.warnings).toEqual([expect.stringMatching(/could not read the previous note on #7.*403/)]);
157
+ expect(notes.size).toBe(1);
158
+ });
159
+ });
160
+
161
+ describe("the subject is the change's, so it is checked (#4972)", () => {
162
+ test("a subject that is not plain words is refused, and no note is posted", async () => {
163
+ for (const subject of [{ id: "a --> <!-- x" }, { id: "@someone" }, { id: "ok", parts: { "pending/a": "x y" } }, { id: "ok", parts: { "a/b/c": "x" } }, { parts: {} }, "sha"]) {
164
+ const { forge, notes, statuses } = keepingForge();
165
+ const r = await post(forge, { ...planNoteHandoff(NOTE, at()), subject });
166
+ expect(r.refused).toMatch(/the plan note's subject/);
167
+ expect(notes.size).toBe(0);
168
+ expect(statuses[0]!.state).toBe("failure");
169
+ }
170
+ });
171
+
172
+ test("a subject line forged in the product's body is defused and never read back", async () => {
173
+ const { forge, notes } = keepingForge();
174
+ const forged = prNoteSubjectMarker({ id: "forged" })!;
175
+ await post(forge, planBodyHandoff(`text\n${forged}\n`, { ...at(), head: HEAD }));
176
+ const body = notes.get(prNoteMarker("default", "prod"))!;
177
+ expect(body).toContain(`&lt;!--${forged.slice(4)}`);
178
+ expect(subjectInNote(body)).toBeUndefined();
179
+ });
180
+ });
181
+
182
+ describe("GitLab: pr-post --open compares in the target branch's pipeline (#4972)", () => {
183
+ test("each merge request's note says what changed since its previous one, with no plan-job token", async () => {
184
+ const { forge: base, notes } = keepingForge("gitlab");
185
+ let artifact = JSON.stringify(planNoteHandoff(NOTE, at(FIRST)));
186
+ let posted: string | undefined;
187
+ const forge = {
188
+ ...base,
189
+ kind: "gitlab",
190
+ host: "gitlab.com",
191
+ async mergeRequestJobs() {
192
+ return [{ pr: 7, head: HEAD, id: 101, status: "success", url: "https://gitlab.com/j/101" }];
193
+ },
194
+ async jobArtifact(_id: number, path: string) {
195
+ return path.endsWith(PR_PLAN_NOTE_FILE) ? artifact : undefined;
196
+ },
197
+ async statusUrl() {
198
+ return posted;
199
+ },
200
+ } as unknown as PrForge;
201
+ // The note words come from the pipeline's CHANT_PLAN_NOTE_WORDS, as the generated GitLab note job sets it.
202
+ const open = () => {
203
+ process.env.CHANT_PLAN_NOTE_WORDS = JSON.stringify(YODEL_WORDS);
204
+ return postOpenPlanReports({ forge, branch: "main", job: "prod-plan", artifactDir: ".chant/pr", env: "default", member: "prod" }).finally(() => {
205
+ delete process.env.CHANT_PLAN_NOTE_WORDS;
206
+ });
207
+ };
208
+ await open();
209
+ artifact = JSON.stringify(planNoteHandoff(NOTE, at(SECOND)));
210
+ posted = undefined;
211
+ const { warnings } = await open();
212
+ expect(warnings).toEqual([]);
213
+ expect(notes.get(prNoteMarker("default", "prod"))).toContain("Since the previous version of this note (`sha256:aaa111`): pending migrations changed: new pending migrations: 003_orders;");
214
+ });
215
+ });
216
+
217
+ describe("subjectChanges and sinceLastLine (#4972)", () => {
218
+ test("chant's words name each group's parts added, gone and changed", () => {
219
+ expect(subjectChanges({ env: "a", "x/1": "p", "x/2": "q" }, { env: "b", "x/1": "p2", "x/3": "r" })).toEqual(["env: a -> b changed", "x: 3 added", "x: 2 gone", "x: 1 changed"]);
220
+ });
221
+
222
+ test("an item's words read its values", () => {
223
+ expect(subjectChanges({ "done/m1": "1" }, { "done/m1": "1,2" }, { done: { changed: "ran part way since: {items}", item: "{item} (statements {after} done now)" } })).toEqual(["ran part way since: m1 (statements 1,2 done now)"]);
224
+ });
225
+
226
+ test("the same id is no line, another is chant's line by default", () => {
227
+ expect(sinceLastLine({ id: "a" }, { id: "a" })).toBeUndefined();
228
+ expect(sinceLastLine({ id: "a", parts: { p: "1" } }, { id: "b", parts: { p: "2" } })).toBe("Since the previous version of this note (`a`): p: 1 -> 2 changed.");
229
+ });
230
+ });
@@ -12,7 +12,8 @@ import { afterAll, describe, expect, test, vi } from "vitest";
12
12
  import type { CommandContext } from "./cli/registry";
13
13
  import { parseArgs } from "./cli/parse-args";
14
14
  import { postOpenPlanReports, postPlanReport, readPlanReport } from "./pr-post";
15
- import { prNoteMarker, prStatusState, type PrReport } from "./pr-loop";
15
+ import { prNoteMarker, type PrReport } from "./pr-loop";
16
+ import { prStatusState } from "./pr-status";
16
17
  import type { ForgeStatus, PrForge } from "./pr-forge";
17
18
 
18
19
  const FIXTURE = join(import.meta.dirname, "__fixtures__", "pr-loop", "pr-plan.golden.json");