@intentius/chant 0.124.88 → 0.124.89

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 (303) 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 +177 -0
  10. package/dist/ci-comment-commands.d.ts.map +1 -0
  11. package/dist/ci-comment-commands.js +325 -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-note-commands.d.ts +63 -3
  25. package/dist/ci-note-commands.d.ts.map +1 -1
  26. package/dist/ci-note-commands.js +69 -35
  27. package/dist/ci-product-words.d.ts +42 -0
  28. package/dist/ci-product-words.d.ts.map +1 -1
  29. package/dist/ci-product-words.js +25 -0
  30. package/dist/ci-product.d.ts +31 -0
  31. package/dist/ci-product.d.ts.map +1 -1
  32. package/dist/ci-product.js +34 -4
  33. package/dist/cli/commands/build.d.ts.map +1 -1
  34. package/dist/cli/commands/build.js +29 -2
  35. package/dist/cli/handlers/approve.d.ts.map +1 -1
  36. package/dist/cli/handlers/approve.js +2 -1
  37. package/dist/cli/handlers/ci-check.d.ts +1 -1
  38. package/dist/cli/handlers/ci-check.d.ts.map +1 -1
  39. package/dist/cli/handlers/ci-check.js +17 -7
  40. package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
  41. package/dist/cli/handlers/ci-evidence.js +33 -7
  42. package/dist/cli/handlers/components.d.ts.map +1 -1
  43. package/dist/cli/handlers/components.js +3 -1
  44. package/dist/cli/handlers/generated-check.d.ts +8 -0
  45. package/dist/cli/handlers/generated-check.d.ts.map +1 -1
  46. package/dist/cli/handlers/generated-check.js +31 -1
  47. package/dist/cli/handlers/lock.d.ts.map +1 -1
  48. package/dist/cli/handlers/lock.js +121 -4
  49. package/dist/cli/handlers/pr-comment.d.ts +21 -0
  50. package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
  51. package/dist/cli/handlers/pr-comment.js +112 -0
  52. package/dist/cli/handlers/pr-env.d.ts.map +1 -1
  53. package/dist/cli/handlers/pr-env.js +6 -3
  54. package/dist/cli/handlers/pr.d.ts +23 -1
  55. package/dist/cli/handlers/pr.d.ts.map +1 -1
  56. package/dist/cli/handlers/pr.js +55 -9
  57. package/dist/cli/handlers/promote.d.ts.map +1 -1
  58. package/dist/cli/handlers/promote.js +2 -1
  59. package/dist/cli/handlers/release.d.ts.map +1 -1
  60. package/dist/cli/handlers/release.js +11 -2
  61. package/dist/cli/handlers/run-wave.d.ts.map +1 -1
  62. package/dist/cli/handlers/run-wave.js +28 -2
  63. package/dist/cli/handlers/run.d.ts.map +1 -1
  64. package/dist/cli/handlers/run.js +2 -1
  65. package/dist/cli/main.d.ts.map +1 -1
  66. package/dist/cli/main.js +24 -2
  67. package/dist/cli/parse-args.d.ts.map +1 -1
  68. package/dist/cli/parse-args.js +16 -0
  69. package/dist/cli/registry.d.ts +11 -0
  70. package/dist/cli/registry.d.ts.map +1 -1
  71. package/dist/components/auto-release.d.ts.map +1 -1
  72. package/dist/components/auto-release.js +2 -1
  73. package/dist/components/pr-checks.d.ts +70 -6
  74. package/dist/components/pr-checks.d.ts.map +1 -1
  75. package/dist/components/pr-checks.js +74 -13
  76. package/dist/components/pr-pipeline.d.ts +16 -12
  77. package/dist/components/pr-pipeline.d.ts.map +1 -1
  78. package/dist/components/pr-pipeline.js +3 -11
  79. package/dist/components/product-pipeline.d.ts +42 -1
  80. package/dist/components/product-pipeline.d.ts.map +1 -1
  81. package/dist/components/product-pipeline.js +64 -12
  82. package/dist/components/product-plan.d.ts +190 -5
  83. package/dist/components/product-plan.d.ts.map +1 -1
  84. package/dist/components/product-plan.js +220 -39
  85. package/dist/drift-record.d.ts +7 -0
  86. package/dist/drift-record.d.ts.map +1 -1
  87. package/dist/drift-record.js +19 -0
  88. package/dist/floor-table.data.d.ts.map +1 -1
  89. package/dist/floor-table.data.js +54 -31
  90. package/dist/forge-check/contract.d.ts +11 -1
  91. package/dist/forge-check/contract.d.ts.map +1 -1
  92. package/dist/forge-check/contract.js +4 -1
  93. package/dist/forge-check/index.d.ts +2 -0
  94. package/dist/forge-check/index.d.ts.map +1 -1
  95. package/dist/forge-check/index.js +2 -0
  96. package/dist/gate-resume-run.d.ts +9 -1
  97. package/dist/gate-resume-run.d.ts.map +1 -1
  98. package/dist/gate-resume-run.js +26 -3
  99. package/dist/generated-check.d.ts +18 -4
  100. package/dist/generated-check.d.ts.map +1 -1
  101. package/dist/generated-check.js +37 -5
  102. package/dist/image-pins.d.ts +26 -0
  103. package/dist/image-pins.d.ts.map +1 -0
  104. package/dist/image-pins.js +19 -0
  105. package/dist/lexicon.d.ts +11 -0
  106. package/dist/lexicon.d.ts.map +1 -1
  107. package/dist/lifecycle/git.d.ts +11 -0
  108. package/dist/lifecycle/git.d.ts.map +1 -1
  109. package/dist/lifecycle/git.js +30 -3
  110. package/dist/lifecycle/publish-npm.d.ts +11 -0
  111. package/dist/lifecycle/publish-npm.d.ts.map +1 -1
  112. package/dist/lifecycle/publish-npm.js +27 -1
  113. package/dist/lifecycle/reach-locks.d.ts +131 -0
  114. package/dist/lifecycle/reach-locks.d.ts.map +1 -0
  115. package/dist/lifecycle/reach-locks.js +118 -0
  116. package/dist/lifecycle/release-cut.d.ts +3 -1
  117. package/dist/lifecycle/release-cut.d.ts.map +1 -1
  118. package/dist/lifecycle/release-cut.js +15 -0
  119. package/dist/lifecycle/release-images.d.ts.map +1 -1
  120. package/dist/lifecycle/release-images.js +1 -2
  121. package/dist/notify-product.d.ts +12 -3
  122. package/dist/notify-product.d.ts.map +1 -1
  123. package/dist/notify-product.js +10 -6
  124. package/dist/op/activities/source-release.d.ts.map +1 -1
  125. package/dist/op/activities/source-release.js +2 -1
  126. package/dist/op/activities/source-rollback.d.ts.map +1 -1
  127. package/dist/op/activities/source-rollback.js +2 -1
  128. package/dist/op/index.d.ts +2 -0
  129. package/dist/op/index.d.ts.map +1 -1
  130. package/dist/op/index.js +1 -0
  131. package/dist/op/op-waves-evidence-jobs.d.ts +6 -1
  132. package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
  133. package/dist/op/op-waves-evidence-jobs.js +9 -3
  134. package/dist/op/op-waves-render-spec.d.ts +100 -0
  135. package/dist/op/op-waves-render-spec.d.ts.map +1 -0
  136. package/dist/op/op-waves-render-spec.js +162 -0
  137. package/dist/op/op-waves-run.d.ts +2 -0
  138. package/dist/op/op-waves-run.d.ts.map +1 -1
  139. package/dist/op/op-waves-run.js +2 -1
  140. package/dist/op/op-waves.d.ts +4 -0
  141. package/dist/op/op-waves.d.ts.map +1 -1
  142. package/dist/op/op-waves.js +4 -1
  143. package/dist/op/schedule-overdue.d.ts.map +1 -1
  144. package/dist/op/schedule-overdue.js +59 -3
  145. package/dist/op/wave-stop.d.ts +64 -0
  146. package/dist/op/wave-stop.d.ts.map +1 -0
  147. package/dist/op/wave-stop.js +127 -0
  148. package/dist/planned-files.d.ts +76 -0
  149. package/dist/planned-files.d.ts.map +1 -0
  150. package/dist/planned-files.js +108 -0
  151. package/dist/pr-forge-job.d.ts +22 -0
  152. package/dist/pr-forge-job.d.ts.map +1 -0
  153. package/dist/pr-forge-job.js +46 -0
  154. package/dist/pr-loop.d.ts +3 -6
  155. package/dist/pr-loop.d.ts.map +1 -1
  156. package/dist/pr-loop.js +4 -81
  157. package/dist/pr-plan-note.d.ts +97 -0
  158. package/dist/pr-plan-note.d.ts.map +1 -1
  159. package/dist/pr-plan-note.js +94 -1
  160. package/dist/pr-post.d.ts +28 -3
  161. package/dist/pr-post.d.ts.map +1 -1
  162. package/dist/pr-post.js +145 -13
  163. package/dist/pr-status.d.ts +16 -0
  164. package/dist/pr-status.d.ts.map +1 -0
  165. package/dist/pr-status.js +90 -0
  166. package/dist/ref-gate-init.d.ts +16 -2
  167. package/dist/ref-gate-init.d.ts.map +1 -1
  168. package/dist/ref-gate-init.js +24 -13
  169. package/dist/release-floors.d.ts +37 -1
  170. package/dist/release-floors.d.ts.map +1 -1
  171. package/dist/release-floors.js +61 -25
  172. package/dist/render-module.d.ts +15 -0
  173. package/dist/render-module.d.ts.map +1 -0
  174. package/dist/render-module.js +73 -0
  175. package/dist/state-migration.d.ts.map +1 -1
  176. package/dist/state-migration.js +1 -2
  177. package/dist/wave-runtime.mjs +304 -301
  178. package/dist/workspace/ci-green-cli.d.ts.map +1 -1
  179. package/dist/workspace/ci-green-cli.js +3 -2
  180. package/dist/workspace/release-train.d.ts.map +1 -1
  181. package/dist/workspace/release-train.js +2 -1
  182. package/dist/workspace/release-workflow.d.ts +4 -3
  183. package/dist/workspace/release-workflow.d.ts.map +1 -1
  184. package/dist/workspace/release-workflow.js +10 -7
  185. package/dist/workspace/trust/check-evidence-report.d.ts +7 -2
  186. package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
  187. package/dist/workspace/trust/check-evidence-report.js +15 -8
  188. package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
  189. package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
  190. package/dist/workspace/trust/ref-gate-cli.js +30 -10
  191. package/dist/workspace/workspace-run.d.ts.map +1 -1
  192. package/dist/workspace/workspace-run.js +2 -1
  193. package/package.json +1 -1
  194. package/src/actor.test.ts +68 -2
  195. package/src/actor.ts +61 -1
  196. package/src/chant-install.test.ts +2 -3
  197. package/src/chant-install.ts +1 -2
  198. package/src/ci-base.test.ts +41 -0
  199. package/src/ci-base.ts +43 -0
  200. package/src/ci-comment-commands.test.ts +376 -0
  201. package/src/ci-comment-commands.ts +389 -0
  202. package/src/ci-comment-replies.ts +78 -0
  203. package/src/ci-commit.test.ts +2 -3
  204. package/src/ci-evidence-from-job.test.ts +18 -0
  205. package/src/ci-evidence-from-job.ts +58 -2
  206. package/src/ci-evidence-jobs.ts +50 -5
  207. package/src/ci-image.test.ts +130 -9
  208. package/src/ci-image.ts +85 -12
  209. package/src/ci-note-commands.ts +104 -41
  210. package/src/ci-product-words.ts +59 -0
  211. package/src/ci-product.ts +40 -4
  212. package/src/cli/commands/build.test.ts +41 -0
  213. package/src/cli/commands/build.ts +27 -2
  214. package/src/cli/handlers/approve.ts +2 -1
  215. package/src/cli/handlers/ci-check.ts +19 -7
  216. package/src/cli/handlers/ci-evidence.ts +29 -8
  217. package/src/cli/handlers/components.ts +3 -1
  218. package/src/cli/handlers/generated-check.ts +31 -1
  219. package/src/cli/handlers/lock-reach.test.ts +103 -0
  220. package/src/cli/handlers/lock.ts +100 -4
  221. package/src/cli/handlers/pr-comment.ts +104 -0
  222. package/src/cli/handlers/pr-env.ts +6 -3
  223. package/src/cli/handlers/pr-record.test.ts +1 -1
  224. package/src/cli/handlers/pr.ts +50 -10
  225. package/src/cli/handlers/promote.ts +2 -1
  226. package/src/cli/handlers/release.e2e.test.ts +35 -0
  227. package/src/cli/handlers/release.ts +14 -2
  228. package/src/cli/handlers/run-wave.ts +28 -2
  229. package/src/cli/handlers/run.ts +2 -1
  230. package/src/cli/main.ts +24 -2
  231. package/src/cli/parse-args.ts +12 -0
  232. package/src/cli/registry.ts +11 -0
  233. package/src/components/auto-release.ts +2 -1
  234. package/src/components/pr-checks.ts +112 -17
  235. package/src/components/pr-pipeline.ts +17 -15
  236. package/src/components/product-pipeline.ts +93 -11
  237. package/src/components/product-plan.test.ts +40 -2
  238. package/src/components/product-plan.ts +331 -45
  239. package/src/drift-record.test.ts +20 -0
  240. package/src/drift-record.ts +16 -0
  241. package/src/floor-table.data.ts +54 -31
  242. package/src/forge-check/contract.ts +12 -1
  243. package/src/forge-check/forge-check.test.ts +17 -0
  244. package/src/forge-check/index.ts +2 -0
  245. package/src/gate-resume-run.ts +27 -3
  246. package/src/generated-check.e2e.test.ts +21 -1
  247. package/src/generated-check.test.ts +66 -0
  248. package/src/generated-check.ts +51 -10
  249. package/src/image-pins.ts +31 -0
  250. package/src/lexicon.ts +11 -0
  251. package/src/lifecycle/git.test.ts +48 -0
  252. package/src/lifecycle/git.ts +27 -4
  253. package/src/lifecycle/publish-npm.ts +31 -1
  254. package/src/lifecycle/reach-locks.test.ts +87 -0
  255. package/src/lifecycle/reach-locks.ts +169 -0
  256. package/src/lifecycle/release-cut.ts +17 -1
  257. package/src/lifecycle/release-images.test.ts +56 -0
  258. package/src/lifecycle/release-images.ts +1 -2
  259. package/src/notify-product.ts +19 -8
  260. package/src/op/activities/source-release.ts +2 -1
  261. package/src/op/activities/source-rollback.ts +2 -1
  262. package/src/op/gate-resume.test.ts +27 -0
  263. package/src/op/index.ts +10 -0
  264. package/src/op/op-waves-evidence-jobs.ts +10 -4
  265. package/src/op/op-waves-notify-words.test.ts +18 -0
  266. package/src/op/op-waves-render-spec.test.ts +160 -0
  267. package/src/op/op-waves-render-spec.ts +171 -0
  268. package/src/op/op-waves-run.ts +2 -1
  269. package/src/op/op-waves.ts +5 -2
  270. package/src/op/schedule-overdue.test.ts +43 -0
  271. package/src/op/schedule-overdue.ts +57 -3
  272. package/src/op/wave-stop.test.ts +72 -0
  273. package/src/op/wave-stop.ts +137 -0
  274. package/src/planned-files.test.ts +80 -0
  275. package/src/planned-files.ts +134 -0
  276. package/src/pr-forge-job.test.ts +53 -0
  277. package/src/pr-forge-job.ts +46 -0
  278. package/src/pr-loop-narrowed.test.ts +2 -1
  279. package/src/pr-loop-words.test.ts +2 -1
  280. package/src/pr-loop.test.ts +1 -2
  281. package/src/pr-loop.ts +4 -80
  282. package/src/pr-plan-note.ts +155 -3
  283. package/src/pr-post-replan.test.ts +144 -0
  284. package/src/pr-post-subject.test.ts +230 -0
  285. package/src/pr-post.test.ts +2 -1
  286. package/src/pr-post.ts +150 -15
  287. package/src/pr-status.ts +91 -0
  288. package/src/ref-gate-init.ts +30 -11
  289. package/src/release-floors.ts +78 -25
  290. package/src/render-module.ts +73 -0
  291. package/src/state-migration-record.test.ts +2 -3
  292. package/src/state-migration.ts +1 -2
  293. package/src/workspace/ci-green-cli.ts +3 -2
  294. package/src/workspace/ci-green-workflow.test.ts +32 -1
  295. package/src/workspace/release-train.ts +2 -1
  296. package/src/workspace/release-workflow.test.ts +36 -5
  297. package/src/workspace/release-workflow.ts +10 -7
  298. package/src/workspace/trust/check-evidence-report.ts +15 -8
  299. package/src/workspace/trust/check-evidence.test.ts +5 -0
  300. package/src/workspace/trust/ref-gate-cli.ts +30 -8
  301. package/src/workspace/trust/ref-gate-pieces.test.ts +46 -1
  302. package/src/workspace/trust/ref-gate.test.ts +10 -0
  303. package/src/workspace/workspace-run.ts +2 -1
@@ -62,7 +62,73 @@ export interface PrPlanNoteHandoff {
62
62
  * one space, at most {@link PRODUCT_MARKER_LIMIT} characters.
63
63
  */
64
64
  marker?: string;
65
+ /**
66
+ * What the plan is taken over (#4972), such as sql-yodeler's plan digest
67
+ * and its subject's parts: `pr-post` compares it with the subject it kept
68
+ * in the previous note for the same environment and member, says what
69
+ * changed when its id differs, and keeps this one in the new note.
70
+ */
71
+ subject?: PrPlanSubject;
72
+ }
73
+ /**
74
+ * A plan's subject (#4972), as a plan verb hands it to the note job, which
75
+ * compares it with the previous note's, so the plan job needs no forge
76
+ * token to read the previous note on any forge. Both are the change's code,
77
+ * so each word is checked against {@link PLAN_SUBJECT_WORD}.
78
+ */
79
+ export interface PrPlanSubject {
80
+ /** The plan as one word, such as its digest: a different id is a changed plan. */
81
+ id: string;
82
+ /**
83
+ * The parts the id is taken over, each `<group>` or `<group>/<item>` to a
84
+ * word (a checksum, a list joined by commas): `pr-post` names the parts
85
+ * added, gone and changed, group by group, in the note words'
86
+ * `subjectParts`. Absent: the line says only that the plan changed.
87
+ */
88
+ parts?: Record<string, string>;
89
+ }
90
+ /** A word of a plan subject (#4972): letters, digits and `_.,:+=-`, at most 1024 characters, nothing that ends a comment or mentions anyone. */
91
+ export declare const PLAN_SUBJECT_WORD: RegExp;
92
+ /** A plan subject part's key (#4972): `<group>` or `<group>/<item>`. */
93
+ export declare const PLAN_SUBJECT_KEY: RegExp;
94
+ /** The most characters the note's kept subject line holds (#4972); a subject with more parts is kept by its id alone. */
95
+ export declare const PLAN_SUBJECT_LIMIT = 16384;
96
+ /** Why `subject` is not a {@link PrPlanSubject} (#4972), or undefined when it is one. */
97
+ export declare function planSubjectProblem(subject: unknown): string | undefined;
98
+ /** How the note words name one group's changes (#4972), each over `{group}` and `{items}`, the group's items as `item` writes them, joined by ", ". */
99
+ export interface PrPlanSubjectPartWords {
100
+ added?: string;
101
+ gone?: string;
102
+ changed?: string;
103
+ /** One item, over `{item}`, `{before}` and `{after}`. Default `{item}`, or for a part with no item `{before} -> {after}` (changed), `{after}` (added), `{before}` (gone). */
104
+ item?: string;
65
105
  }
106
+ /**
107
+ * A product's plan note hand-off whose note is the product's own text
108
+ * (#4963), in place of a {@link PrPlanNote}: sql-yodeler's tenant set note,
109
+ * which chant's note cannot carry yet. `pr-post` checks it as it checks a
110
+ * {@link PrPlanNoteHandoff}, writes every `<!--` in `body` as `&lt;!--`,
111
+ * puts chant's marker and the product's line (`marker`) above it, adds the
112
+ * overdue Ops and the note job's notices under it, and cuts it to the
113
+ * forge's limit.
114
+ */
115
+ export interface PrPlanBodyHandoff extends Omit<PrPlanNoteHandoff, "note"> {
116
+ /** The note's markdown, at most {@link PLAN_BODY_LIMIT} characters. */
117
+ body: string;
118
+ }
119
+ /** The most characters a {@link PrPlanBodyHandoff.body} holds (#4963). */
120
+ export declare const PLAN_BODY_LIMIT = 1000000;
121
+ /** The hand-off for a product's own note text (#4963), as a plan verb writes it to {@link PR_PLAN_NOTE_FILE}. */
122
+ export declare function planBodyHandoff(body: string, at: {
123
+ pr: number;
124
+ head: string;
125
+ env: string;
126
+ member?: string;
127
+ state: PrPlanNoteHandoff["state"];
128
+ description: string;
129
+ marker?: string;
130
+ subject?: PrPlanSubject;
131
+ }): PrPlanBodyHandoff;
66
132
  /** The most characters a hand-off's {@link PrPlanNoteHandoff.marker} holds (#4931). */
67
133
  export declare const PRODUCT_MARKER_LIMIT = 4096;
68
134
  /** What a hand-off's marker may hold (#4931): no `-->`, no `<` or `>`, nothing that ends the comment or starts another. */
@@ -79,6 +145,7 @@ export declare function planNoteHandoff(note: PrPlanNote, at: {
79
145
  state: PrPlanNoteHandoff["state"];
80
146
  description: string;
81
147
  marker?: string;
148
+ subject?: PrPlanSubject;
82
149
  }): PrPlanNoteHandoff;
83
150
  /** One change line of a group, as chant's plan summary groups them. */
84
151
  export interface PrPlanNoteChange {
@@ -305,7 +372,37 @@ export interface PrPlanNoteWords {
305
372
  * note by it. Absent: a hand-off's marker is dropped.
306
373
  */
307
374
  productMarker?: string;
375
+ /**
376
+ * The line `pr-post` adds when a hand-off's subject differs from the
377
+ * previous note's (#4972), over `{previous}` (the previous subject's id)
378
+ * and `{changes}` (what changed, part by part, joined by "; "). Default
379
+ * "Since the previous version of this note (`{previous}`): {changes}.".
380
+ */
381
+ sinceLast?: string;
382
+ /**
383
+ * The line when no part says what changed (#4972): the subject has no
384
+ * parts, or the previous note kept its id alone. Over `{previous}`.
385
+ * Default "The plan changed since the previous version of this note (`{previous}`).".
386
+ */
387
+ sinceLastOnly?: string;
388
+ /** How `{changes}` names each group of the subject's parts (#4972), by group. Default "{group}: {items} added" (gone, changed). */
389
+ subjectParts?: Record<string, PrPlanSubjectPartWords>;
308
390
  }
391
+ /** The {@link PrPlanNoteWords.sinceLast} default (#4972). */
392
+ export declare const SINCE_LAST_LINE = "Since the previous version of this note (`{previous}`): {changes}.";
393
+ /** The {@link PrPlanNoteWords.sinceLastOnly} default (#4972). */
394
+ export declare const SINCE_LAST_ONLY_LINE = "The plan changed since the previous version of this note (`{previous}`).";
395
+ /**
396
+ * What changed from `before` to `after`, group by group (#4972): each
397
+ * group's added, gone and changed parts in the note words, groups in the
398
+ * order `after` names them, then those only `before` names.
399
+ */
400
+ export declare function subjectChanges(before: Record<string, string>, after: Record<string, string>, words?: Record<string, PrPlanSubjectPartWords>): string[];
401
+ /**
402
+ * The line for a plan whose subject is no longer `previous`'s (#4972), in
403
+ * the note words, or undefined when the ids are the same.
404
+ */
405
+ export declare function sinceLastLine(previous: PrPlanSubject, now: PrPlanSubject, words?: Pick<PrPlanNoteWords, "sinceLast" | "sinceLastOnly" | "subjectParts">): string | undefined;
309
406
  /** Options for {@link renderPlanNote}. */
310
407
  export interface PlanNoteOptions {
311
408
  /** The most characters the note may hold. Default GitHub's 65,536. */
@@ -1 +1 @@
1
- {"version":3,"file":"pr-plan-note.d.ts","sourceRoot":"","sources":["../src/pr-plan-note.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE5E,OAAO,EAAiD,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAExG,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAE7C,sDAAsD;AACtD,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,OAAO,qBAAqB,CAAC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,mDAA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IAAI,UAAU,CAEhE;AAYD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAE5D;AAED,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAK1D;AAED,2GAA2G;AAC3G,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;CAAE,GAAG,MAAM,CAEtK;AAmBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CAqOxF"}
@@ -35,6 +35,37 @@ export const PR_PLAN_NOTE_CONTRACT = 1;
35
35
  * it with `pr-post`.
36
36
  */
37
37
  export const PR_PLAN_NOTE_FILE = "pr-plan-note.json";
38
+ /** A word of a plan subject (#4972): letters, digits and `_.,:+=-`, at most 1024 characters, nothing that ends a comment or mentions anyone. */
39
+ export const PLAN_SUBJECT_WORD = /^[A-Za-z0-9_.,:+=-]{1,1024}$/;
40
+ /** A plan subject part's key (#4972): `<group>` or `<group>/<item>`. */
41
+ export const PLAN_SUBJECT_KEY = /^[A-Za-z0-9_.:+=-]{1,128}(\/[A-Za-z0-9_.,:+=-]{1,256})?$/;
42
+ /** The most characters the note's kept subject line holds (#4972); a subject with more parts is kept by its id alone. */
43
+ export const PLAN_SUBJECT_LIMIT = 16384;
44
+ /** Why `subject` is not a {@link PrPlanSubject} (#4972), or undefined when it is one. */
45
+ export function planSubjectProblem(subject) {
46
+ if (!subject || typeof subject !== "object" || Array.isArray(subject))
47
+ return "is not an object";
48
+ const s = subject;
49
+ if (typeof s.id !== "string" || !PLAN_SUBJECT_WORD.test(s.id))
50
+ return "has no id of letters, digits and _.,:+=-";
51
+ if (s.parts === undefined)
52
+ return undefined;
53
+ if (!s.parts || typeof s.parts !== "object" || Array.isArray(s.parts))
54
+ return "has parts that are not an object";
55
+ for (const [k, v] of Object.entries(s.parts)) {
56
+ if (!PLAN_SUBJECT_KEY.test(k))
57
+ return `has a part ${JSON.stringify(k.slice(0, 64))} that is not <group> or <group>/<item>`;
58
+ if (typeof v !== "string" || !PLAN_SUBJECT_WORD.test(v))
59
+ return `has a part ${k} whose value is not a word of letters, digits and _.,:+=-`;
60
+ }
61
+ return undefined;
62
+ }
63
+ /** The most characters a {@link PrPlanBodyHandoff.body} holds (#4963). */
64
+ export const PLAN_BODY_LIMIT = 1000000;
65
+ /** The hand-off for a product's own note text (#4963), as a plan verb writes it to {@link PR_PLAN_NOTE_FILE}. */
66
+ export function planBodyHandoff(body, at) {
67
+ return { kind: "plan-note-handoff", contract: PR_PLAN_NOTE_CONTRACT, pr: at.pr, head: at.head, env: at.env, ...(at.member !== undefined ? { member: at.member } : {}), state: at.state, description: at.description, body, ...(at.marker !== undefined ? { marker: at.marker } : {}), ...(at.subject !== undefined ? { subject: at.subject } : {}) };
68
+ }
38
69
  /** The most characters a hand-off's {@link PrPlanNoteHandoff.marker} holds (#4931). */
39
70
  export const PRODUCT_MARKER_LIMIT = 4096;
40
71
  /** What a hand-off's marker may hold (#4931): no `-->`, no `<` or `>`, nothing that ends the comment or starts another. */
@@ -47,7 +78,69 @@ export function productMarkerLine(name, body) {
47
78
  }
48
79
  /** The hand-off for `note` (#4799), as a product's plan verb writes it to {@link PR_PLAN_NOTE_FILE}. */
49
80
  export function planNoteHandoff(note, at) {
50
- return { kind: "plan-note-handoff", contract: PR_PLAN_NOTE_CONTRACT, pr: at.pr, head: note.head, env: at.env, ...(at.member !== undefined ? { member: at.member } : {}), state: at.state, description: at.description, note, ...(at.marker !== undefined ? { marker: at.marker } : {}) };
81
+ return { kind: "plan-note-handoff", contract: PR_PLAN_NOTE_CONTRACT, pr: at.pr, head: note.head, env: at.env, ...(at.member !== undefined ? { member: at.member } : {}), state: at.state, description: at.description, note, ...(at.marker !== undefined ? { marker: at.marker } : {}), ...(at.subject !== undefined ? { subject: at.subject } : {}) };
82
+ }
83
+ /** The {@link PrPlanNoteWords.sinceLast} default (#4972). */
84
+ export const SINCE_LAST_LINE = "Since the previous version of this note (`{previous}`): {changes}.";
85
+ /** The {@link PrPlanNoteWords.sinceLastOnly} default (#4972). */
86
+ export const SINCE_LAST_ONLY_LINE = "The plan changed since the previous version of this note (`{previous}`).";
87
+ /**
88
+ * What changed from `before` to `after`, group by group (#4972): each
89
+ * group's added, gone and changed parts in the note words, groups in the
90
+ * order `after` names them, then those only `before` names.
91
+ */
92
+ export function subjectChanges(before, after, words = {}) {
93
+ const groupOf = (k) => {
94
+ const at = k.indexOf("/");
95
+ return at < 0 ? [k, ""] : [k.slice(0, at), k.slice(at + 1)];
96
+ };
97
+ const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
98
+ const groups = [];
99
+ for (const k of [...Object.keys(after), ...Object.keys(before)]) {
100
+ const [g] = groupOf(k);
101
+ if (!groups.includes(g))
102
+ groups.push(g);
103
+ }
104
+ const fill = (t, v) => t.replace(/\{(group|items|item|before|after)\}/g, (_, n) => v[n] ?? "");
105
+ const out = [];
106
+ for (const group of groups) {
107
+ const w = has(words, group) ? words[group] : {};
108
+ const kinds = { added: [], gone: [], changed: [] };
109
+ const say = (kind, item, b, a) => {
110
+ const dflt = item !== "" ? "{item}" : kind === "changed" ? "{before} -> {after}" : kind === "added" ? "{after}" : "{before}";
111
+ kinds[kind].push(fill(w.item ?? dflt, { item, before: b, after: a, group }));
112
+ };
113
+ for (const k of Object.keys(after)) {
114
+ const [g, item] = groupOf(k);
115
+ if (g !== group)
116
+ continue;
117
+ if (!has(before, k))
118
+ say("added", item, "", after[k]);
119
+ else if (before[k] !== after[k])
120
+ say("changed", item, before[k], after[k]);
121
+ }
122
+ for (const k of Object.keys(before)) {
123
+ const [g, item] = groupOf(k);
124
+ if (g === group && !has(after, k))
125
+ say("gone", item, before[k], "");
126
+ }
127
+ for (const kind of ["added", "gone", "changed"]) {
128
+ if (kinds[kind].length > 0)
129
+ out.push(fill(w[kind] ?? `{group}: {items} ${kind}`, { group, items: kinds[kind].join(", ") }));
130
+ }
131
+ }
132
+ return out;
133
+ }
134
+ /**
135
+ * The line for a plan whose subject is no longer `previous`'s (#4972), in
136
+ * the note words, or undefined when the ids are the same.
137
+ */
138
+ export function sinceLastLine(previous, now, words = {}) {
139
+ if (previous.id === now.id)
140
+ return undefined;
141
+ const changes = previous.parts && now.parts ? subjectChanges(previous.parts, now.parts, words.subjectParts) : [];
142
+ const fill = (t) => t.replace(/\{(previous|changes)\}/g, (_, n) => (n === "previous" ? previous.id : changes.join("; ")));
143
+ return changes.length > 0 ? fill(words.sinceLast ?? SINCE_LAST_LINE) : fill(words.sinceLastOnly ?? SINCE_LAST_ONLY_LINE);
51
144
  }
52
145
  const NOTE_WORDS = {
53
146
  footer: "",
package/dist/pr-post.d.ts CHANGED
@@ -34,7 +34,7 @@ import { type CiProductWords } from "./ci-product-words.js";
34
34
  import { type ControlEdgeFacts } from "./control/edges.js";
35
35
  import type { OpRunRecordInput } from "./op/runtime.js";
36
36
  import type { RunOrigin } from "./lifecycle/release-ledger.js";
37
- import { type PrPlanNoteHandoff, type PrPlanNoteWords } from "./pr-plan-note.js";
37
+ import { type PrPlanBodyHandoff, type PrPlanNoteHandoff, type PrPlanNoteWords, type PrPlanSubject } from "./pr-plan-note.js";
38
38
  /** The plan report's file under the report directory. */
39
39
  export declare const PR_PLAN_REPORT_FILE = "pr-plan.json";
40
40
  /** What {@link postPlanReport} posts for. */
@@ -98,6 +98,14 @@ export interface PlanPostInput {
98
98
  * pushes. `keep` returns a warning to say, when there is one.
99
99
  */
100
100
  recordRun?: PlanRunRecorder;
101
+ /**
102
+ * The one argument a re-plan was narrowed to (#4963), such as a
103
+ * terragucci root: when the report or the hand-off says the change
104
+ * reaches nothing, the pull request gets a reply that the argument is not
105
+ * affected, and the note and the status stay as they were. Ignored when
106
+ * empty or not one plain word.
107
+ */
108
+ notAffected?: string;
101
109
  }
102
110
  /** How the note job keeps the plan job's run record (#4899). */
103
111
  export interface PlanRunRecorder {
@@ -131,11 +139,22 @@ export declare function readPlanReport(input: Pick<PlanPostInput, "dir" | "pr" |
131
139
  * The note for `report`, rendered here, with every `<!--` after the marker
132
140
  * line written as `&lt;!--`, so the note carries no hidden marker but its own.
133
141
  */
134
- export declare function planNoteFor(report: PrReport, forge: Pick<PrForge, "kind" | "host">, marker: string, baseTip?: string): string;
142
+ export declare function planNoteFor(report: PrReport, forge: Pick<PrForge, "kind" | "host">, marker: string, baseTip?: string, own?: string): string;
135
143
  /** The hidden line a note carries with the target branch's commit it was posted against (#4628). */
136
144
  export declare function prNoteTipMarker(sha: string): string;
137
145
  /** The hidden line a note marked stale carries, with the commit it was marked at (#4628). */
138
146
  export declare function prNoteStaleMarker(sha: string): string;
147
+ /**
148
+ * The hidden line a note keeps its plan's subject in (#4972): base64url of
149
+ * the subject's JSON, `{ id }` alone when its parts would make the line
150
+ * longer than {@link PLAN_SUBJECT_LIMIT}. Undefined when even that is.
151
+ */
152
+ export declare function prNoteSubjectMarker(subject: PrPlanSubject): string | undefined;
153
+ /**
154
+ * The subject a note kept (#4972), checked again: the line was chant's, but
155
+ * what it holds came from an earlier plan job. Undefined when there is none.
156
+ */
157
+ export declare function subjectInNote(body: string): PrPlanSubject | undefined;
139
158
  /** The note as the job summary shows it (#4628): the hidden lines dropped. */
140
159
  export declare function planNoteSummary(note: string): string;
141
160
  /**
@@ -149,10 +168,16 @@ export declare function postPlanReport(input: PlanPostInput): Promise<PlanPostRe
149
168
  * one the caller ran, as {@link readPlanReport} checks a report.
150
169
  */
151
170
  export declare function readPlanNoteHandoff(input: Pick<PlanPostInput, "dir" | "pr" | "head" | "env" | "member">): {
152
- handoff: PrPlanNoteHandoff;
171
+ handoff: PrPlanNoteHandoff | PrPlanBodyHandoff;
153
172
  } | {
154
173
  refused: string;
155
174
  };
175
+ /**
176
+ * The note for a hand-off of the product's own text (#4963): chant's
177
+ * marker, the product's line, the body with every `<!--` defused, the
178
+ * notices as quoted lines under it, the tip line, cut to the forge's limit.
179
+ */
180
+ export declare function planBodyHandoffNote(handoff: PrPlanBodyHandoff, forge: Pick<PrForge, "kind">, marker: string, noteWords?: PrPlanNoteWords, baseTip?: string, notices?: readonly string[]): string;
156
181
  /** The notices in the file `CHANT_PLAN_NOTE_NOTICES` names (#4931), one a line, or none when unset or unreadable. */
157
182
  export declare function noticesFromEnv(env?: NodeJS.ProcessEnv): string[];
158
183
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pr-post.d.ts","sourceRoot":"","sources":["../src/pr-post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,EAAmF,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3I,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAmC,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAkD,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAA2K,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEvP,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD,6CAA6C;AAC7C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAA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kC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+FAA+F;IAC/F,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiD/G"}
package/dist/pr-post.js CHANGED
@@ -31,14 +31,15 @@
31
31
  import { appendFileSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
32
32
  import { tmpdir } from "node:os";
33
33
  import { join } from "node:path";
34
- import { prNoteMarker, prStatusContext, prStatusDescription, prStatusState, renderPrNote } from "./pr-loop.js";
34
+ import { prNoteMarker, prStatusContext, renderPrNote } from "./pr-loop.js";
35
+ import { prStatusDescription, prStatusState } from "./pr-status.js";
35
36
  import { forgePrincipalOf } from "./pr-forge.js";
36
- import { GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "./plan-summary.js";
37
+ import { fitNote, GITHUB_COMMENT_LIMIT, GITLAB_NOTE_LIMIT } from "./plan-summary.js";
37
38
  import { activeProductWords, commentLine } from "./ci-product-words.js";
38
39
  import { controlEdgeFactsFromEnv, remarkCrossStackEdges } from "./control/edges.js";
39
40
  import { CHECK_EVIDENCE_FILE, checkEvidenceNoteLine, openEvidenceFor } from "./workspace/trust/check-evidence-report.js";
40
41
  import { PLAN_RUN_RECORD_FILE, readPlanRunRecord } from "./pr-plan-record.js";
41
- import { isPlanNote, planNoteMarker, PR_PLAN_NOTE_CONTRACT, PR_PLAN_NOTE_FILE, PRODUCT_MARKER_BODY, PRODUCT_MARKER_LIMIT, PRODUCT_MARKER_NAME, productMarkerLine, renderPlanNote } from "./pr-plan-note.js";
42
+ import { isPlanNote, PLAN_BODY_LIMIT, PLAN_SUBJECT_LIMIT, planNoteMarker, planSubjectProblem, PR_PLAN_NOTE_CONTRACT, PR_PLAN_NOTE_FILE, PRODUCT_MARKER_BODY, PRODUCT_MARKER_LIMIT, PRODUCT_MARKER_NAME, productMarkerLine, renderPlanNote, sinceLastLine } from "./pr-plan-note.js";
42
43
  /** The plan report's file under the report directory. */
43
44
  export const PR_PLAN_REPORT_FILE = "pr-plan.json";
44
45
  const SHA = /^[0-9a-f]{40}$/;
@@ -80,7 +81,7 @@ export function readPlanReport(input) {
80
81
  * The note for `report`, rendered here, with every `<!--` after the marker
81
82
  * line written as `&lt;!--`, so the note carries no hidden marker but its own.
82
83
  */
83
- export function planNoteFor(report, forge, marker, baseTip) {
84
+ export function planNoteFor(report, forge, marker, baseTip, own) {
84
85
  const note = renderPrNote(report, {
85
86
  limit: forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT,
86
87
  approver: forgePrincipalOf(forge.kind, forge.host, "<your-login>"),
@@ -89,7 +90,42 @@ export function planNoteFor(report, forge, marker, baseTip) {
89
90
  const rest = (at < 0 ? "" : note.slice(at + 1)).split("<!--").join("&lt;!--");
90
91
  // #4628: the tip line is written after the defusing, from the caller's sha, never the report's.
91
92
  const tip = baseTip && SHA.test(baseTip) ? `${rest.endsWith("\n") ? "" : "\n"}${prNoteTipMarker(baseTip)}\n` : "";
92
- return `${marker}\n${rest}${tip}`;
93
+ // #4963: the product's own line, already checked, under chant's marker.
94
+ return `${marker}\n${own ? `${own}\n` : ""}${rest}${tip}`;
95
+ }
96
+ /**
97
+ * The product's hidden line for a report or a hand-off (#4931, #4963): from
98
+ * the pipeline's `productMarker` and the file's `marker`, checked against
99
+ * {@link PRODUCT_MARKER_BODY}. Undefined when either is missing or the
100
+ * marker is not plain words.
101
+ */
102
+ function productLineOf(name, marker) {
103
+ if (name === undefined || !PRODUCT_MARKER_NAME.test(name) || typeof marker !== "string" || marker.length > PRODUCT_MARKER_LIMIT)
104
+ return undefined;
105
+ if (marker !== "" && !PRODUCT_MARKER_BODY.test(marker))
106
+ return undefined;
107
+ return productMarkerLine(name, marker);
108
+ }
109
+ /** The one plain word a re-plan was narrowed to (#4963), or undefined. */
110
+ function narrowedTo(input) {
111
+ const a = input.notAffected?.trim();
112
+ return a && /^[A-Za-z0-9_.\/@+=,:-]+$/.test(a) ? a : undefined;
113
+ }
114
+ /**
115
+ * The reply for a re-plan narrowed to an argument the change does not
116
+ * reach (#4963), in place of the note and the status, as terragucci's
117
+ * plan-note job replied (plan-note.ts).
118
+ */
119
+ async function replyNotAffected(input, argument, state, warnings) {
120
+ const description = `${argument} is not affected by this pull request, so nothing was planned.`;
121
+ try {
122
+ await input.forge.addComment(input.pr, `${activeProductWords().product}: ${description}`);
123
+ }
124
+ catch (err) {
125
+ warnings.push(`could not reply on #${input.pr}: ${err instanceof Error ? err.message : String(err)}`);
126
+ }
127
+ const recorded = await keepRunRecord(input, warnings);
128
+ return { state, description: cut(description), noted: false, ...(recorded ? { recorded } : {}), warnings };
93
129
  }
94
130
  /** The hidden line a note carries with the target branch's commit it was posted against (#4628). */
95
131
  export function prNoteTipMarker(sha) {
@@ -99,6 +135,55 @@ export function prNoteTipMarker(sha) {
99
135
  export function prNoteStaleMarker(sha) {
100
136
  return `<!-- chant-pr-stale:${sha} -->`;
101
137
  }
138
+ /**
139
+ * The hidden line a note keeps its plan's subject in (#4972): base64url of
140
+ * the subject's JSON, `{ id }` alone when its parts would make the line
141
+ * longer than {@link PLAN_SUBJECT_LIMIT}. Undefined when even that is.
142
+ */
143
+ export function prNoteSubjectMarker(subject) {
144
+ const line = (s) => `<!-- chant-pr-subject:${Buffer.from(JSON.stringify(s), "utf8").toString("base64url")} -->`;
145
+ const full = line(subject);
146
+ if (full.length <= PLAN_SUBJECT_LIMIT)
147
+ return full;
148
+ const bare = line({ id: subject.id });
149
+ return bare.length <= PLAN_SUBJECT_LIMIT ? bare : undefined;
150
+ }
151
+ const SUBJECT_LINE = /^<!-- chant-pr-subject:([A-Za-z0-9_-]+) -->$/m;
152
+ /**
153
+ * The subject a note kept (#4972), checked again: the line was chant's, but
154
+ * what it holds came from an earlier plan job. Undefined when there is none.
155
+ */
156
+ export function subjectInNote(body) {
157
+ const m = SUBJECT_LINE.exec(body.replace(/\r\n/g, "\n"));
158
+ if (!m?.[1] || m[1].length > PLAN_SUBJECT_LIMIT)
159
+ return undefined;
160
+ try {
161
+ const s = JSON.parse(Buffer.from(m[1], "base64url").toString("utf8"));
162
+ return planSubjectProblem(s) === undefined ? s : undefined;
163
+ }
164
+ catch {
165
+ return undefined;
166
+ }
167
+ }
168
+ /**
169
+ * The line saying what changed since the previous note (#4972): the
170
+ * previous note of the same environment and member is read with the job's
171
+ * token, and its kept subject compared with the hand-off's. Undefined when
172
+ * there is no previous note, it kept no subject, or the id is the same. A
173
+ * forge that refuses the read is a warning.
174
+ */
175
+ async function sinceLastOf(input, subject, words, warnings) {
176
+ let found;
177
+ try {
178
+ found = await input.forge.findComment(input.pr, prNoteMarker(input.env, input.member));
179
+ }
180
+ catch (err) {
181
+ warnings.push(`could not read the previous note on #${input.pr}, so the note does not say what changed since it: ${err instanceof Error ? err.message : String(err)}`);
182
+ return undefined;
183
+ }
184
+ const previous = found ? subjectInNote(found.body) : undefined;
185
+ return previous ? sinceLastLine(previous, subject, words ?? {}) : undefined;
186
+ }
102
187
  const TIP_LINE = /<!-- chant-pr-tip:([0-9a-f]{40}) -->/;
103
188
  const STALE_LINE = /<!-- chant-pr-stale:([0-9a-f]{40}) -->/;
104
189
  const STALE_PREFIX = "> Stale: ";
@@ -135,6 +220,10 @@ export async function postPlanReport(input) {
135
220
  }
136
221
  else {
137
222
  let report = read.report;
223
+ // #4963: a re-plan narrowed to an argument the change does not reach.
224
+ const narrowed = narrowedTo(input);
225
+ if (narrowed && report.status === "nothing" && !failedJob)
226
+ return replyNotAffected(input, narrowed, "success", warnings);
138
227
  if (input.overdue) {
139
228
  const { overdue: _forged, ...rest } = report;
140
229
  const found = await input.overdue().catch(() => []);
@@ -149,8 +238,10 @@ export async function postPlanReport(input) {
149
238
  state = prStatusState(report);
150
239
  description = prStatusDescription(report);
151
240
  // A member the change does not reach has nothing to say on the pull request (as pr-plan's own publish).
241
+ // #4963: the report's own `marker`, under the pipeline's productMarker, as a hand-off's.
242
+ const own = productLineOf((input.noteWords ?? noteWordsFromEnv())?.productMarker, read.report.marker);
152
243
  if (!(input.member && report.status === "nothing" && !report.overdue?.length && !report.migrations?.length))
153
- note = planNoteFor(report, input.forge, prNoteMarker(input.env, input.member), input.baseTip);
244
+ note = planNoteFor(report, input.forge, prNoteMarker(input.env, input.member), input.baseTip, own);
154
245
  }
155
246
  catch (err) {
156
247
  refused = `the plan report does not render: ${err instanceof Error ? err.message : String(err)}`;
@@ -276,15 +367,43 @@ export function readPlanNoteHandoff(input) {
276
367
  return { refused: `the plan note's state ${JSON.stringify(r.state)} is not success, failure or pending` };
277
368
  if (typeof r.description !== "string")
278
369
  return { refused: "the plan note has no description" };
279
- if (!isPlanNote(r.note) || r.note.head !== r.head || !Array.isArray(r.note.waves) || !Array.isArray(r.note.groups) || !Array.isArray(r.note.named)) {
370
+ // #4963: the product's own text in place of a plan note.
371
+ if (r.body !== undefined) {
372
+ if (r.note !== undefined)
373
+ return { refused: "the plan note gives both a note and a body; give one" };
374
+ if (typeof r.body !== "string" || r.body.length > PLAN_BODY_LIMIT)
375
+ return { refused: `the plan note's body is not text of at most ${PLAN_BODY_LIMIT} characters` };
376
+ }
377
+ else if (!isPlanNote(r.note) || r.note.head !== r.head || !Array.isArray(r.note.waves) || !Array.isArray(r.note.groups) || !Array.isArray(r.note.named)) {
280
378
  return { refused: "the plan note's note is not a plan note for its head" };
281
379
  }
282
380
  // #4931: the product's hidden line is the change's too, so it holds only plain words.
283
381
  if (r.marker !== undefined && (typeof r.marker !== "string" || r.marker.length > PRODUCT_MARKER_LIMIT || (r.marker !== "" && !PRODUCT_MARKER_BODY.test(r.marker)))) {
284
382
  return { refused: `the plan note's marker is not words of letters, digits and _.,/@+=:- of at most ${PRODUCT_MARKER_LIMIT} characters` };
285
383
  }
384
+ // #4972: the subject is kept in the note and said back in a later one, so it holds only plain words too.
385
+ const subjectProblem = r.subject !== undefined ? planSubjectProblem(r.subject) : undefined;
386
+ if (subjectProblem)
387
+ return { refused: `the plan note's subject ${subjectProblem}` };
286
388
  return { handoff: doc };
287
389
  }
390
+ /**
391
+ * The note for a hand-off of the product's own text (#4963): chant's
392
+ * marker, the product's line, the body with every `<!--` defused, the
393
+ * notices as quoted lines under it, the tip line, cut to the forge's limit.
394
+ */
395
+ export function planBodyHandoffNote(handoff, forge, marker, noteWords, baseTip, notices = []) {
396
+ const limit = forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT;
397
+ const line = productLineOf(noteWords?.productMarker, handoff.marker);
398
+ const head = `${marker}\n${line ? `${line}\n` : ""}`;
399
+ const said = notices.length > 0 ? `\n${notices.map((n) => `> ${n.split("<!--").join("&lt;!--")}`).join("\n")}\n` : "";
400
+ const tip = baseTip && SHA.test(baseTip) ? `${prNoteTipMarker(baseTip)}\n` : "";
401
+ // #4972: the subject, kept for the next note to compare with.
402
+ const kept = handoff.subject ? prNoteSubjectMarker(handoff.subject) : undefined;
403
+ const subject = kept ? `${kept}\n` : "";
404
+ const body = handoff.body.split("<!--").join("&lt;!--").replace(/\n*$/, "\n");
405
+ return `${head}${fitNote(body, { limit: Math.max(0, limit - head.length - said.length - tip.length - subject.length) })}${said}${tip}${subject}`;
406
+ }
288
407
  /** The notices in the file `CHANT_PLAN_NOTE_NOTICES` names (#4931), one a line, or none when unset or unreadable. */
289
408
  export function noticesFromEnv(env = process.env) {
290
409
  const file = env.CHANT_PLAN_NOTE_NOTICES;
@@ -318,7 +437,10 @@ function noteWordsFromEnv() {
318
437
  */
319
438
  export function planNoteHandoffNote(handoff, forge, marker, noteWords, baseTip) {
320
439
  const words = activeProductWords();
321
- const rendered = renderPlanNote(handoff.note, { limit: forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT, words, ...(noteWords ? { note: noteWords } : {}) });
440
+ // #4972: the subject, kept for the next note to compare with, within the forge's limit.
441
+ const kept = handoff.subject ? prNoteSubjectMarker(handoff.subject) : undefined;
442
+ const limit = (forge.kind === "gitlab" ? GITLAB_NOTE_LIMIT : GITHUB_COMMENT_LIMIT) - (kept ? kept.length + 1 : 0);
443
+ const rendered = renderPlanNote(handoff.note, { limit, words, ...(noteWords ? { note: noteWords } : {}) });
322
444
  let body = rendered.split("<!--").join("&lt;!--");
323
445
  const n = handoff.note;
324
446
  const previews = n.previews ?? [];
@@ -328,7 +450,8 @@ export function planNoteHandoffNote(handoff, forge, marker, noteWords, baseTip)
328
450
  // #4931: the product's own line, from the pipeline's name and the hand-off's checked body, under chant's marker.
329
451
  const name = noteWords?.productMarker;
330
452
  const own = name !== undefined && PRODUCT_MARKER_NAME.test(name) && handoff.marker !== undefined ? `${productMarkerLine(name, handoff.marker)}\n` : "";
331
- return `${marker}\n${own}${body}${tip}`;
453
+ const subject = kept ? `${body.endsWith("\n") || tip ? "" : "\n"}${kept}\n` : "";
454
+ return `${marker}\n${own}${body}${tip}${subject}`;
332
455
  }
333
456
  /** {@link postPlanReport} for a product's plan note hand-off (#4799). */
334
457
  async function postPlanNoteHandoff(input) {
@@ -348,14 +471,23 @@ async function postPlanNoteHandoff(input) {
348
471
  else {
349
472
  state = read.handoff.state;
350
473
  description = read.handoff.description;
474
+ const h = read.handoff;
475
+ // #4963: a re-plan narrowed to an argument the change does not reach.
476
+ const narrowed = narrowedTo(input);
477
+ if (narrowed && "note" in h && h.note.nothing === true && !failedJob)
478
+ return replyNotAffected(input, narrowed, state, warnings);
351
479
  // #4931: the overdue Ops (#4289), asked here with the job's token, and the note job's own notices, under the counts.
352
- const given = read.handoff.note.notices ?? [];
480
+ const given = "note" in h ? (h.note.notices ?? []) : [];
353
481
  // An Op the product's own notices already call overdue is not said twice.
354
482
  const overdue = input.overdue ? (await input.overdue().catch(() => [])).filter((o) => !given.some((g) => g.includes(`\`${o.op}\``) && g.includes("overdue"))).map((o) => o.message) : [];
355
- const added = [...overdue, ...(input.notices ?? noticesFromEnv())].filter((n, i, all) => !given.includes(n) && all.indexOf(n) === i);
356
- const handoff = added.length > 0 ? { ...read.handoff, note: { ...read.handoff.note, notices: [...given, ...added] } } : read.handoff;
483
+ const noteWords = input.noteWords ?? noteWordsFromEnv();
484
+ // #4972: what changed since the previous note, from the subject it kept, read here with the job's token.
485
+ const since = h.subject ? await sinceLastOf(input, h.subject, noteWords, warnings) : undefined;
486
+ const added = [...(since ? [since] : []), ...overdue, ...(input.notices ?? noticesFromEnv())].filter((n, i, all) => !given.includes(n) && all.indexOf(n) === i);
357
487
  try {
358
- note = planNoteHandoffNote(handoff, input.forge, prNoteMarker(input.env, input.member), input.noteWords ?? noteWordsFromEnv(), input.baseTip);
488
+ note = "note" in h
489
+ ? planNoteHandoffNote(added.length > 0 ? { ...h, note: { ...h.note, notices: [...given, ...added] } } : h, input.forge, prNoteMarker(input.env, input.member), noteWords, input.baseTip)
490
+ : planBodyHandoffNote(h, input.forge, prNoteMarker(input.env, input.member), noteWords, input.baseTip, added);
359
491
  }
360
492
  catch (err) {
361
493
  refused = `the plan note does not render: ${err instanceof Error ? err.message : String(err)}`;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The pull-request loop's commit status (#3183): its description and its
3
+ * state, from the report `chant components pr-plan` and `pr-apply` write.
4
+ *
5
+ * They lived in `./pr-loop.ts` until #4966 moved them here, so the bundle
6
+ * a product builds from `pr-loop.ts` and `pr-forge.ts` (the report, the note
7
+ * and the forge clients, `pr-loop-bundle.test.ts`) keeps room under its
8
+ * ceiling. chant's own handlers post the status; no product reads these.
9
+ */
10
+ import { type CiProductWords } from "./ci-product-words.js";
11
+ import { type PrReport } from "./pr-loop.js";
12
+ /** A commit status's description, at most 140 characters (GitHub's limit). */
13
+ export declare function prStatusDescription(report: PrReport, words?: CiProductWords): string;
14
+ /** The commit status state for a report: success, failure, or pending while it waits on approval. */
15
+ export declare function prStatusState(report: PrReport): "success" | "failure" | "pending";
16
+ //# sourceMappingURL=pr-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pr-status.d.ts","sourceRoot":"","sources":["../src/pr-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE7D,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,GAAE,cAAqC,GAAG,MAAM,CAgE1G;AAED,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CASjF"}