@feigi/fleet-ctl 3.23.36 → 3.23.37

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 (204) hide show
  1. package/package.json +1 -1
  2. package/scripts/main-checkout.mjs +1 -1
  3. package/scripts/member-write-guard.mjs +1 -1
  4. package/scripts/repo-root.mjs +1 -1
  5. package/skills/run-team/references/reaping.md +1 -1
  6. package/scripts/agent-test-dir-prose.test.mjs +0 -59
  7. package/scripts/agent-test.test.mjs +0 -1640
  8. package/scripts/ambient-git-vars-mjs-prose.test.mjs +0 -397
  9. package/scripts/ambient-git-vars-prose.test.mjs +0 -192
  10. package/scripts/ancestry-check-position-prose.test.mjs +0 -175
  11. package/scripts/apply-ruleset.test.mjs +0 -421
  12. package/scripts/arg-header-probes-prose.test.mjs +0 -394
  13. package/scripts/arg.test.mjs +0 -1354
  14. package/scripts/board-cli.test.mjs +0 -710
  15. package/scripts/board-identity.test.mjs +0 -429
  16. package/scripts/board-liveness-banner.test.mjs +0 -119
  17. package/scripts/board-prev-shape.test.mjs +0 -228
  18. package/scripts/board-tryparse-null.test.mjs +0 -119
  19. package/scripts/board.test.mjs +0 -3121
  20. package/scripts/brief-after-cut-prose.test.mjs +0 -53
  21. package/scripts/candidates-exit3-prose.test.mjs +0 -302
  22. package/scripts/candidates.test.mjs +0 -2312
  23. package/scripts/caveat-unification-prose.test.mjs +0 -98
  24. package/scripts/cell-readout.test.mjs +0 -615
  25. package/scripts/ci-comment-rot-prose.test.mjs +0 -2025
  26. package/scripts/ci-completes-premise-prose.test.mjs +0 -257
  27. package/scripts/ci-state-prose.test.mjs +0 -113
  28. package/scripts/ci-state.test.mjs +0 -1933
  29. package/scripts/ci-vacuous-green.test.mjs +0 -368
  30. package/scripts/citation-sweep-prose.test.mjs +0 -1712
  31. package/scripts/claim-lifecycle.test.mjs +0 -187
  32. package/scripts/claim-ticket.test.mjs +0 -1122
  33. package/scripts/closing-keyword-prose.test.mjs +0 -193
  34. package/scripts/cockpit-launch-idempotent-prose.test.mjs +0 -165
  35. package/scripts/cockpit-tick-nonblocking.test.mjs +0 -210
  36. package/scripts/compute-board.test.mjs +0 -1214
  37. package/scripts/compute-spend.test.mjs +0 -517
  38. package/scripts/consumer-technology-prose.test.mjs +0 -126
  39. package/scripts/cross-repo-citation-prose.test.mjs +0 -155
  40. package/scripts/cwd-isolation-pins.mjs +0 -83
  41. package/scripts/dedupe-guard-prose.test.mjs +0 -243
  42. package/scripts/delete-merged-branch.test.mjs +0 -576
  43. package/scripts/derive-testcmd.test.mjs +0 -595
  44. package/scripts/diff-stats.test.mjs +0 -404
  45. package/scripts/dispatch-block-golden-prose.test.mjs +0 -1130
  46. package/scripts/dispatch-block-pins-prose.test.mjs +0 -615
  47. package/scripts/dispositions-check.test.mjs +0 -936
  48. package/scripts/dispositions-gate-prose.test.mjs +0 -129
  49. package/scripts/drop-merged-label.test.mjs +0 -479
  50. package/scripts/exec-stub.mjs +0 -93
  51. package/scripts/exec-stub.test.mjs +0 -69
  52. package/scripts/expected-jobs-prose.test.mjs +0 -80
  53. package/scripts/fan-out-authorization-prose.test.mjs +0 -80
  54. package/scripts/filing-bar-seat-prose.test.mjs +0 -242
  55. package/scripts/filing-claim-bar-prose.test.mjs +0 -166
  56. package/scripts/finisher-died-prose.test.mjs +0 -31
  57. package/scripts/finisher-dispatch-premise-prose.test.mjs +0 -312
  58. package/scripts/finisher-halt-prose.test.mjs +0 -106
  59. package/scripts/finisher-name-prose.test.mjs +0 -134
  60. package/scripts/finisher-own-tree-prose.test.mjs +0 -299
  61. package/scripts/finisher-pin-race-prose.test.mjs +0 -339
  62. package/scripts/finisher-test-verdict-prose.test.mjs +0 -102
  63. package/scripts/fix-applier-correction-rules-prose.test.mjs +0 -202
  64. package/scripts/fix-applier-result-file-prose.test.mjs +0 -149
  65. package/scripts/fleet-bootstrap.test.mjs +0 -75
  66. package/scripts/fleet-heartbeat.test.mjs +0 -450
  67. package/scripts/fleet-provenance.test.mjs +0 -138
  68. package/scripts/fleet-run.test.mjs +0 -90
  69. package/scripts/fleet-state.test.mjs +0 -460
  70. package/scripts/fleet-tick-prose.test.mjs +0 -300
  71. package/scripts/fleet-tick.test.mjs +0 -2444
  72. package/scripts/force-with-lease-reason-prose.test.mjs +0 -184
  73. package/scripts/frontmatter-check.test.mjs +0 -436
  74. package/scripts/git-env.test.mjs +0 -149
  75. package/scripts/git-status-untracked-mode-sweep.test.mjs +0 -216
  76. package/scripts/gone-walk.test.mjs +0 -213
  77. package/scripts/gp-sep-invariant-prose.test.mjs +0 -188
  78. package/scripts/head-moved-after-label-prose.test.mjs +0 -233
  79. package/scripts/immutable-body-claim-prose.test.mjs +0 -204
  80. package/scripts/implementer-model-tier.test.mjs +0 -235
  81. package/scripts/inflight-citation-prose.test.mjs +0 -144
  82. package/scripts/inflight-exit2-prose.test.mjs +0 -81
  83. package/scripts/inflight-probe-guard-prose.test.mjs +0 -109
  84. package/scripts/inflight-scan-scope-prose.test.mjs +0 -57
  85. package/scripts/inflight.test.mjs +0 -2882
  86. package/scripts/injection-control-prose.test.mjs +0 -404
  87. package/scripts/install-root-audit.test.mjs +0 -464
  88. package/scripts/instrument-check-prose.test.mjs +0 -235
  89. package/scripts/instruments.test.mjs +0 -787
  90. package/scripts/is-cli.test.mjs +0 -99
  91. package/scripts/issue-tracker-prose.test.mjs +0 -71
  92. package/scripts/json.test.mjs +0 -364
  93. package/scripts/ledger-dispatch.test.mjs +0 -927
  94. package/scripts/ledger-grammar.test.mjs +0 -227
  95. package/scripts/ledger-read-require-file.test.mjs +0 -197
  96. package/scripts/ledger-rotate.test.mjs +0 -142
  97. package/scripts/ledger.test.mjs +0 -3436
  98. package/scripts/line-distance-prose.test.mjs +0 -245
  99. package/scripts/liveness-rationale-prose.test.mjs +0 -83
  100. package/scripts/locale-pin-prose.test.mjs +0 -189
  101. package/scripts/main-checkout.test.mjs +0 -332
  102. package/scripts/member-outcome-prose.test.mjs +0 -167
  103. package/scripts/member-outcomes-header.test.mjs +0 -129
  104. package/scripts/member-outcomes-prose.test.mjs +0 -63
  105. package/scripts/member-outcomes.test.mjs +0 -638
  106. package/scripts/member-prompt-prose.test.mjs +0 -165
  107. package/scripts/member-record.test.mjs +0 -541
  108. package/scripts/member-write-guard.test.mjs +0 -214
  109. package/scripts/merge-commit-probe-prose.test.mjs +0 -122
  110. package/scripts/merge-gate.test.mjs +0 -613
  111. package/scripts/muted-git-guard-sweep.test.mjs +0 -493
  112. package/scripts/net-ssh-precedence-prose.test.mjs +0 -91
  113. package/scripts/net-watchdog-prose.test.mjs +0 -79
  114. package/scripts/net.test.mjs +0 -211
  115. package/scripts/no-ci-gate-prose.test.mjs +0 -108
  116. package/scripts/no-undo-audit.test.mjs +0 -3961
  117. package/scripts/no-wave.test.mjs +0 -138
  118. package/scripts/node-floor-sweep.test.mjs +0 -611
  119. package/scripts/pointer-target-prose.test.mjs +0 -186
  120. package/scripts/pr-cost.test.mjs +0 -521
  121. package/scripts/pr-overlap.test.mjs +0 -692
  122. package/scripts/printf-die-sweep.test.mjs +0 -384
  123. package/scripts/prompt-renderer.mjs +0 -40
  124. package/scripts/prompt-renderer.test.mjs +0 -68
  125. package/scripts/prose-pin.mjs +0 -807
  126. package/scripts/prose-pin.test.mjs +0 -1034
  127. package/scripts/prove-merge.test.mjs +0 -995
  128. package/scripts/pull-table-relabel-prose.test.mjs +0 -60
  129. package/scripts/quiet-payload-prose.test.mjs +0 -222
  130. package/scripts/reap-cherry-check-prose.test.mjs +0 -80
  131. package/scripts/reap.test.mjs +0 -4432
  132. package/scripts/reaping-prose.test.mjs +0 -239
  133. package/scripts/reaping-reap-authorizers-prose.test.mjs +0 -112
  134. package/scripts/reaping-release-authorizers-prose.test.mjs +0 -85
  135. package/scripts/recipe-derivation-prose.test.mjs +0 -112
  136. package/scripts/recipe-prove.test.mjs +0 -1042
  137. package/scripts/refuter-scratch-prose.test.mjs +0 -135
  138. package/scripts/release-label-required-prose.test.mjs +0 -71
  139. package/scripts/release-label-split-prose.test.mjs +0 -184
  140. package/scripts/release-ticket-reap-pairing-prose.test.mjs +0 -63
  141. package/scripts/release-ticket.test.mjs +0 -5099
  142. package/scripts/renovate-release-contract.test.mjs +0 -379
  143. package/scripts/repo-root.test.mjs +0 -873
  144. package/scripts/reporter-output-rule-prose.test.mjs +0 -208
  145. package/scripts/review-agent-report-only.test.mjs +0 -49
  146. package/scripts/review-core-booking.test.mjs +0 -35
  147. package/scripts/review-core-cwd-isolation.test.mjs +0 -374
  148. package/scripts/review-core-reads.test.mjs +0 -478
  149. package/scripts/review-core-refuter-scratch.test.mjs +0 -148
  150. package/scripts/review-core-scratch-refusal.test.mjs +0 -64
  151. package/scripts/review-core-shared-test-run.test.mjs +0 -275
  152. package/scripts/review-core-snapshot-path.test.mjs +0 -830
  153. package/scripts/review-core-specialist-scratch.test.mjs +0 -191
  154. package/scripts/review-core-testcmd.test.mjs +0 -335
  155. package/scripts/review-core-unrun.test.mjs +0 -566
  156. package/scripts/review-core-unverified-discriminant.test.mjs +0 -208
  157. package/scripts/review-eval-resolver-path.test.mjs +0 -55
  158. package/scripts/review-host-fixture.mjs +0 -89
  159. package/scripts/review-in-run-retry.test.mjs +0 -211
  160. package/scripts/review-no-vendor-dispatch.test.mjs +0 -45
  161. package/scripts/review-path-default.test.mjs +0 -796
  162. package/scripts/review-runner-spawns.test.mjs +0 -95
  163. package/scripts/review-runner.test.mjs +0 -166
  164. package/scripts/review-tier-audit.test.mjs +0 -140
  165. package/scripts/run-artifact-pr-prose.test.mjs +0 -341
  166. package/scripts/run-merge-bot-prose.test.mjs +0 -1413
  167. package/scripts/run-team-local-hook.test.mjs +0 -442
  168. package/scripts/scratch-partition-invariant-prose.test.mjs +0 -74
  169. package/scripts/scripts-path-citation-sweep.test.mjs +0 -73
  170. package/scripts/section-between-guard-prose.test.mjs +0 -379
  171. package/scripts/select-dimensions.test.mjs +0 -674
  172. package/scripts/shared-refusal.test.mjs +0 -388
  173. package/scripts/shell-traps-prose.test.mjs +0 -504
  174. package/scripts/shortlist.test.mjs +0 -380
  175. package/scripts/slow-transport.mjs +0 -72
  176. package/scripts/snapshot-repo.test.mjs +0 -1006
  177. package/scripts/snapshot-runner-audience-prose.test.mjs +0 -130
  178. package/scripts/spend-view.test.mjs +0 -312
  179. package/scripts/staleness-qualifier-prose.test.mjs +0 -251
  180. package/scripts/staleness-verdict-prose.test.mjs +0 -142
  181. package/scripts/staleness.test.mjs +0 -893
  182. package/scripts/stalled-member-liveness-prose.test.mjs +0 -219
  183. package/scripts/stash-prohibition-prose.test.mjs +0 -313
  184. package/scripts/strip-comments.mjs +0 -44
  185. package/scripts/temp-dir.mjs +0 -47
  186. package/scripts/ticket-router.test.mjs +0 -981
  187. package/scripts/tier-check.test.mjs +0 -828
  188. package/scripts/tier-outcomes-header.test.mjs +0 -518
  189. package/scripts/tier-outcomes.test.mjs +0 -572
  190. package/scripts/tier-roles.test.mjs +0 -535
  191. package/scripts/tracker-block-copy-prose.test.mjs +0 -288
  192. package/scripts/triage-labels-gloss-prose.test.mjs +0 -97
  193. package/scripts/unattended-git-sweep.test.mjs +0 -142
  194. package/scripts/verify-sha-exit2-prose.test.mjs +0 -269
  195. package/scripts/verify-sha.test.mjs +0 -692
  196. package/scripts/watcher-degraded-block.test.mjs +0 -369
  197. package/scripts/watcher-key-prose.test.mjs +0 -106
  198. package/scripts/within-run-pair-prose.test.mjs +0 -212
  199. package/scripts/worktree-audit.test.mjs +0 -1408
  200. package/scripts/worktree-head-prose.test.mjs +0 -276
  201. package/scripts/worktree-listing-sweep.test.mjs +0 -217
  202. package/scripts/worktree-model-prose.test.mjs +0 -216
  203. package/scripts/worktree-porcelain.mjs +0 -35
  204. package/scripts/worktree-porcelain.test.mjs +0 -102
@@ -1,1712 +0,0 @@
1
- import { test } from "node:test";
2
- import assert from "node:assert/strict";
3
- import { mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
4
- import { tmpdir } from "node:os";
5
- import { join } from "node:path";
6
- import { stripComments } from "./strip-comments.mjs";
7
-
8
- // #516. A scan over every tracked `.mjs`/`.sh`/`.js`/`.yml` file for
9
- // `path.ext:NNN` found 22 line-numbered citations (plus two bare `(:NNN)`
10
- // continuations) and converted every one to name a construct instead — a
11
- // function, a section, a quoted fragment. A line number rots the moment the
12
- // cited file is next touched, silently, because nothing reds when it does;
13
- // that is how #516 itself came to exist. This file is what keeps the OLD
14
- // stale forms from creeping back in one file at a time, the way they crept in
15
- // the first time, and confirms every construct name the sweep introduced is
16
- // still findable somewhere in its file (never pinned to a line — that would
17
- // defeat the point).
18
- //
19
- // Two example strings that LOOK like citations are not: `file.mjs:164` in
20
- // ledger.mjs's prose about search-qualifier smuggling, and `candidates.mjs:164`
21
- // (twice) in ledger.test.mjs, which is that test's own input/assertion
22
- // subject. Neither is touched here — the patterns below are the exact stale
23
- // forms the sweep actually converted, not a general `\.mjs:\d+` ban.
24
- //
25
- // Not #516-only any more. The table is this repo's citation-regression record
26
- // rather than that ticket's frozen inventory: #1136 generalized one entry's ban
27
- // after the number rotted a third time, #1349 retired one whose target no
28
- // longer exists, and #870 adds a pair of citations PR #866 fixed BY HAND
29
- // rather than through a sweep. A citation fixed anywhere in this tree belongs
30
- // here; the alternative is each file growing a private pin that reads its own
31
- // source, which is the per-file creep this file exists to stop.
32
- //
33
- // #1555 widens the subject past line numbers. The select-dimensions.test.mjs
34
- // entry bans a reverted ARGUMENT spelling, not a citation: `lift(SOURCE)`
35
- // where the live code passes `lift(stripComments(SOURCE))`. It belongs here
36
- // because the rot is the same rot — a one-line spelling that still reads
37
- // plausibly, whose revert nothing reds on — and the alternative is the
38
- // private per-file pin the paragraph above rejects. The table's subject is
39
- // the stale FORM; a line number is one kind of stale form.
40
- //
41
- // Both halves here are CITING-side: the stale form must not return, and the
42
- // construct the citation names must still be named. Neither reads the cited
43
- // file, so nothing in this table notices the TARGET losing the construct — the
44
- // direction #870 closes for probe 3's citation, in
45
- // inflight-citation-prose.test.mjs, and leaves open for every entry below
46
- // except where the next two paragraphs say otherwise.
47
- //
48
- // One target-side check runs here, for one citation shape only (#1757): a
49
- // `live` needle that names an ADR by number (`ADR 0010`) is a pointer, and the
50
- // number must still resolve to exactly one `docs/adr/<number>-*.md`. Read off
51
- // the needle itself, never a second list, so the pointer and what it is checked
52
- // against have one spelling between them — the reason inflight-citation-prose's
53
- // WTROOT gives: renumber or move the ADR and this reds; repoint the needle
54
- // alone and the needle reds against the citing file's unchanged prose. The
55
- // pointer names the ADR by number, so a retitle that keeps the number keeps
56
- // the pointer true and stays green.
57
- //
58
- // One construct needle is checked against its target too: ledger.mjs's
59
- // "runDispatch's `keyNum` check", a pointer that names a function and a
60
- // variable inside it. Rename either in the code and the comment points at
61
- // nothing while its needle stays satisfied by the comment's own words, so
62
- // runDispatchKeyNumFault reads comment-stripped ledger.mjs for both. Every
63
- // other construct needle is still never checked against its target.
64
- //
65
- // And two claims are held by what they say, not by how they were spelled:
66
- // ADR 0010's security release (#1928) and its count of releases in the 43
67
- // days the pin sat, which pin-drift.sh restates (#1970). Stale forms here once
68
- // guarded each by the wrong sentence's exact words. A false claim needs no
69
- // particular spelling to return, so securityReleaseFault reads which side of
70
- // the pin the ADR places v26.5.1 on, and windowReleaseCountFault how many
71
- // releases each file puts inside the 43 days. It is the table's stale-form
72
- // rule taken one step further, for a claim whose rewording is as likely as
73
- // its reversion — not a second convention to reach for when a spelling ban
74
- // would do.
75
- const REPO = join(import.meta.dirname, "..");
76
- const read = (...segments) => readFileSync(join(REPO, ...segments), "utf8");
77
-
78
- // Comments wrap; a construct name can land on either side of the wrap. Strip
79
- // the `//` or `#` gutter and collapse whitespace so a presence check does not
80
- // depend on where the line happened to break.
81
- const normalize = (text) => text.replace(/^[ \t]*(?:\/\/|#) ?/gm, "").replace(/\s+/g, " ");
82
-
83
- const ADRS = readdirSync(join(REPO, "..", "docs", "adr"), { withFileTypes: true })
84
- .filter((entry) => entry.isFile())
85
- .map((entry) => entry.name);
86
- const ADR_POINTER = /\bADR (\d{4})\b/g;
87
-
88
- // Null when exactly one `<number>-*.md` answers to the pointer, else the
89
- // reason. Takes a listing rather than reading docs/adr/ itself, so the tests
90
- // below can hand it the renamed, emptied, and doubled trees this repo does
91
- // not hold.
92
- function adrFault(number, names) {
93
- const hits = names.filter((name) => name.startsWith(`${number}-`) && name.endsWith(".md"));
94
- if (hits.length === 1) return null;
95
- return hits.length === 0
96
- ? `no docs/adr/${number}-*.md exists — the ADR was renumbered or moved out of docs/adr/`
97
- : `${hits.length} files answer to ADR ${number} (${hits.join(", ")}) — the pointer no longer names one ruling`;
98
- }
99
-
100
- const ADR_0010 = ["..", "docs", "adr", "0010-the-node-pin-stays-exact-and-a-bot-moves-it.md"];
101
- const PIN_DRIFT_SH = ["..", ".github", "scripts", "pin-drift.sh"];
102
-
103
- // #1928. ADR 0010's security evidence names its one security release past
104
- // `26.5.0`, v26.5.1, and #1874 corrected WHEN it landed: already out when #335
105
- // set the pin, not "since the pin". The spelling ban this replaced refused
106
- // only that sentence; "v26.5.1, which has since landed after the pin was set"
107
- // states the same false claim and passed every test here. So the claim is read
108
- // for what it says. Null when the evidence still says v26.5.1 predates the
109
- // pin, else the reason. Takes the text rather than reading the ADR itself, so
110
- // the tests below can hand it rewordings the ADR does not hold.
111
- //
112
- // The scope is each markdown block — list item or paragraph — naming
113
- // "security", never the document: the release-list bullet above it says
114
- // v26.5.1 was "already out when the pin was set" as well, and read file-wide
115
- // that sentence vouches for a security bullet claiming the opposite. Inside
116
- // the scope, each clause (cut at `, ; : ( ) — –` and sentence ends) is read
117
- // for what it places relative to the pin: the order word nearest before a
118
- // `pin…` mention decides — "already", "before", "predates", "prior to",
119
- // "earlier than", "ahead of" put the release before it; "since", "after",
120
- // "postdates", "later than" after it — and "in", "within", "inside" or
121
- // "during" the N days (or the window) places it after the pin too. A negation
122
- // in the same breath as that word flips the side, scanned back only to the
123
- // nearest `and`/`but`/`so`/`yet` or the clause start — so a `not` attached to
124
- // an earlier, unrelated verb ("does not affect us and landed after…") can't
125
- // reach across it, and `not…until` reads as naming the word after `until`,
126
- // not negating it ("didn't land until after" stays after). "none landed in
127
- // the 43 days after" is a before-the-pin claim; nearest, not first, is what
128
- // lets "since" be a conjunction — "since it predates the pin" is read at
129
- // "predates". Any after-the-pin clause reds, even beside a before-the-pin
130
- // one, and a scope with no before-the-pin clause reds.
131
- //
132
- // THE CEILING. It knows those words and nothing else. A true reword outside
133
- // them — "out by the time #335 pinned it", or the pin as the subject, "the pin
134
- // came after v26.5.1" — reds, the loud direction; a false claim outside them
135
- // passes only if the scope also keeps a clause that still reads before the
136
- // pin. It reads no date, so it holds the ADR to #1874's measurement, and it
137
- // cannot notice a double negation. Every block naming "security" is in scope,
138
- // so a later amendment that names it and places any release after the pin
139
- // reds too — a claim of the same shape, and worth the same re-read.
140
- const PIN_ORDER = new RegExp(
141
- [
142
- String.raw`\b(?<before>already|before|predat\w*|prior\s+to|earlier\s+than|ahead\s+of)\b`,
143
- String.raw`\b(?<after>since|after|postdat\w*|later\s+than)\b`,
144
- String.raw`\b(?<window>(?:in|within|inside|during)\s+(?:the|those|that|this|its)\s+(?:\d+[\s-]days?|(?:\d+[\s-]day\s+)?window))\b`,
145
- // Only "pin", "pins", "pinned" or "pinning" — not every pin-prefixed
146
- // word. A bare `pin\w*` also matched "pinpointed", letting an unrelated
147
- // before-clause about "the pinpointed advisory" stand in for the pin.
148
- String.raw`\b(?<pin>pin(?:s|ned|ning)?)\b`,
149
- ].join("|"),
150
- "gi",
151
- );
152
- // Bounds the negation scan below to the same breath as the order word: text
153
- // back to the nearest coordinating conjunction, not the whole clause.
154
- const CLAUSE_BREAK = /\b(?:and|but|so|yet)\b/gi;
155
- const NEGATION = /\b(?:not|no|none|never|nothing|neither|nor|cannot)\b|n['’]t\b/i;
156
- const OTHER_SIDE = { before: "after", after: "before" };
157
-
158
- // Where one clause places what it names relative to the pin, in order: the
159
- // reading the comment above spells out, one "before" or "after" per pin or
160
- // window mention. A pin mention no order word precedes places nothing.
161
- // windowReleaseCountFault, below, reads a release count's clause with it too.
162
- function* pinPlacements(clause) {
163
- let side = null;
164
- let last = 0;
165
- for (const { groups, index, 0: token } of clause.matchAll(PIN_ORDER)) {
166
- let window = clause.slice(last, index);
167
- const breaks = [...window.matchAll(CLAUSE_BREAK)];
168
- if (breaks.length) window = window.slice(breaks[breaks.length - 1].index + breaks[breaks.length - 1][0].length);
169
- const negated = NEGATION.test(window) && !/\buntil\b/i.test(window);
170
- last = index + token.length;
171
- if (groups.before || groups.after) {
172
- const said = groups.before ? "before" : "after";
173
- side = negated ? OTHER_SIDE[said] : said;
174
- continue;
175
- }
176
- // A pin mention takes the side of the order word nearest before it; a
177
- // window is the 43 days after the pin, so landing in it is "after".
178
- const placed = groups.pin ? side : negated ? "before" : "after";
179
- side = null;
180
- if (placed) yield placed;
181
- }
182
- }
183
-
184
- function securityReleaseFault(adr) {
185
- const scope = adr
186
- .split(/\n(?=[ \t]*(?:[-*+]|\d+\.)[ \t])|\n[ \t]*\n/)
187
- .map((block) => block.replace(/\s+/g, " "))
188
- .filter((block) => /\bsecurity\b/i.test(block));
189
- if (scope.length === 0) {
190
- return "ADR 0010 no longer names a security release in its evidence — the claim #1874 corrected, that v26.5.1 predates the pin, is gone rather than kept current";
191
- }
192
- if (!scope.some((block) => /\bv?26\.5\.1\b/.test(block))) {
193
- return "ADR 0010's security-release evidence no longer names v26.5.1, the one security release past `26.5.0` (#1874)";
194
- }
195
- let before = false;
196
- for (const clause of scope.flatMap((block) => block.split(/[,;:()—–]|[.!?]\**\s/))) {
197
- for (const placed of pinPlacements(clause)) {
198
- if (placed === "after") {
199
- return `ADR 0010's security-release evidence places it after the pin ("${clause.trim()}") — v26.5.1 was already out when #335 set the pin, so none landed in the 43 days after (#1874, #1928)`;
200
- }
201
- before = true;
202
- }
203
- }
204
- return before
205
- ? null
206
- : "ADR 0010's security-release evidence no longer says v26.5.1 predates the pin — state it in that bullet's own words: already out when, before, predates, prior to, earlier than or ahead of the pin (#1874, #1928)";
207
- }
208
-
209
- // #1957. Where a sentence ends, for ADR 0010's drift-sentence row below: at
210
- // `.`, `!` or `?`, after any closing markup — `**`, `_`, a backtick, `)`, `]`,
211
- // a quote — then whitespace; or where a markdown block ends, as
212
- // securityReleaseFault splits them: a blank line, or the newline before a
213
- // `-`/`*`/`+` list item. The row's first cut, a bare `\.\s`, missed point 3's bold
214
- // heading ending `bumps.**`, so the heading's "minor and patch" read as the
215
- // next sentence's own scope, and an unscoped drift claim under a scoped
216
- // heading passed. A lone newline is no end: prose wraps mid-sentence. So a
217
- // heading with no terminator and no blank line after it still lends the next
218
- // line its scope — telling that line end from a wrap takes parsing the
219
- // heading, which a sentence boundary cannot do.
220
- //
221
- // #1959. A period closing an abbreviation that never ends a sentence — "e.g.",
222
- // "i.e.", "cf.", "viz.", "vs.", ci-comment-rot-prose's list (#1852) — is no
223
- // end either: splitting there dropped a scope word on one side of it out of
224
- // the claim's sentence on the other, and a scoped drift sentence read as
225
- // unscoped. Any other period before whitespace still ends one — "etc.", an
226
- // ellipsis, "a.m." — since each ends a sentence as often as not, and reading
227
- // past a real end is the silent direction: the next sentence's scope would
228
- // reach back. Before the abbreviation, only a letter or digit disqualifies it,
229
- // as for UPDATE_TYPE below: an italic `_e.g._` is one, "devs." is not "vs.",
230
- // and neither is "DEvs." — the guard spells both cases out, so it reads a
231
- // capital the same whatever flag the pattern splicing it carries (#2043).
232
- // The abbreviations match lowercase only, as sentences()'s do (#1899, #2021),
233
- // even inside both rows' `i` flag — the `(?-i:…)` group (Node 23+; .nvmrc pins
234
- // 26): folded, a sentence ending in a proper noun "Vs." read as the
235
- // abbreviation, the silent direction above. The cost: a capitalized one
236
- // anywhere, a parenthetical "(Cf. …)" included, ends the sentence there. Keep
237
- // the group to literals: V8 (14.6) still folds a character class in any but
238
- // its first alternative. Every consumer below compiles it with `i`, as the
239
- // rows do: windowReleaseCountFault's split once carried no flag, so a capital
240
- // glued to an abbreviation and a tag name in capitals read there as they
241
- // read nowhere else (#2043).
242
- //
243
- // #1981. The rest of the block ends and closing markup #1957 named only in
244
- // part. A blank line may be CRLF, or blank but for a gutter — a blockquote's
245
- // `>`, a shell comment's `#` as in pin-drift.sh (a bare `#` is an empty
246
- // heading in markdown, so a block end there too) — or hold only a setext
247
- // underline or thematic break, `---`, `===`, `***`, `___`. A block may open
248
- // behind that gutter too: a list item, ordered as well — `1)` as well as
249
- // `1.`, which the terminator branch only caught by the accident of its `. ` —
250
- // a code fence or a table row. Any item number counts, since every item past
251
- // a list's first carries one, so a wrapped line opening "2) " ends the
252
- // sentence it continues: the loud direction, as above. An ellipsis `…` ends a
253
- // sentence with or without whitespace after it: unlike a period it sits inside
254
- // no version, file name or range, where three periods do — `main...HEAD` — so
255
- // `...` still needs the whitespace. Closing markup also takes strikethrough's
256
- // `~~`, `}`, `>`, `»`, `›` and an HTML closing tag such as `</b>`. Still no end:
257
- // an ATX heading with no blank line before it, since every line behind the
258
- // `# ` gutter would open one and the merge row reads sentences across it.
259
- //
260
- // #2002. More of what CommonMark (0.31.2) lets interrupt a paragraph, and
261
- // closing markup #1981 still missed. An HTML block opens straight under
262
- // prose with no blank line between — `<div>`, `<table>`, `<details>`, `<!--`,
263
- // `<?`, `<!DOCTYPE`, `<pre>`, any of CommonMark's block tag names, opening or
264
- // closing — and ends the sentence there; any other tag, `<span>` or
265
- // `<divider>`, opens no block, so the line still wraps. A blockquote's `>`
266
- // ends it too, opening straight under an unquoted line. Two quoted lines wrap
267
- // behind the gutter, and so does a quote nested inside one, `> a` then
268
- // `> > b` — the silent direction, like the ATX gap above, left since telling it
269
- // from a wrap means counting both lines' `>`; a lazy line between two quoted
270
- // ones splits the quote in two, the loud direction. Neither this branch nor
271
- // the HTML block's own caps how far a `<div>`/`>` line can indent, unlike the
272
- // setext/thematic branch below — a line indented four or more spaces still
273
- // ends the sentence here, the same loud direction the pre-existing list
274
- // lookahead already allowed. A setext underline or thematic break is now only
275
- // what CommonMark renders as one: a run of `=` or of `-`, or three or more of
276
- // one of `-`, `*`, `_`, spaced or not, indented at most three spaces past the
277
- // gutter. `_`, `**`, `-=-`, `*-_` or ` ---` is a paragraph line, and reading
278
- // one as an end was the loud direction. That three-space cap counts from the
279
- // margin, not a list item's own content column — inside a list item a deeper
280
- // underline can still be a real end CommonMark would honor; the silent
281
- // direction, left beside the ATX and nested-quote gaps above, since a
282
- // line-based regex can't carry a list item's column forward. A `#` is gutter
283
- // unless it's followed directly by a digit, as in a shell comment, an ATX
284
- // heading or a comment-only rule line (`#---`, `#===`): a wrapped line
285
- // opening `#1906) ` is a citation, not a gutter and a list item. Closing
286
- // markup also takes a link's destination or reference label,
287
- // `](renovate.json)` or `][ref]`, a footnote reference `[^1]`, and a closing
288
- // tag with a hyphen in its name or whitespace before its `>`, `</my-el>`,
289
- // `</b >`. Tag names match in either case only where the splicing pattern
290
- // carries `i`, as every consumer of SENTENCE_END here does (#2043).
291
- //
292
- // #2027. A bare footnote marker straight behind the terminator — `.[1]`,
293
- // `?[note]`, `.[1][2]`, closing markup allowed after it — ends the sentence
294
- // after it, as sentences() in prose-pin.mjs has since #1987. Without it
295
- // `only.[1] Bounding drift…` read as one sentence here while sentences() read
296
- // two, the silent direction for both rows. It is sentences()'s rule, not a
297
- // bare `\[[^\]]*\]`: the marker holds at least one character and no
298
- // whitespace, and the terminator must close a word, a digit, a code span, a
299
- // paren or a curly quote — so jq's `'.[] | …'`, JavaScript's `m?.[1] || …`, a
300
- // glob's `*.[0-9]*' ` and jq's `.jobs.[0, 1] | …` end nothing, and a single
301
- // unspaced `.jobs.[0] | …` still does, the same known gap sentences() carries.
302
- // One divergence, forced: every consumer here compiles without `u`, where
303
- // `\p{L}` is a literal "p" (see UPDATE_TYPE's #1988 note), so "a letter" is
304
- // an ASCII one or ANY non-ASCII character — every non-ASCII letter sentences()
305
- // takes, `”` and `’` included, and also non-ASCII punctuation such as `»`,
306
- // which sentences() does not take. That extra split is the loud direction for
307
- // the rows, and none of the code shapes above starts with one. The caret form
308
- // `[^1]` stays in CLOSING_MARKUP, unguarded, as #2002 left it.
309
- //
310
- // #2063. The `][ref]` closer skips a label `[^1]` reads whole — `][^1]` is
311
- // `]` then `[^1]` and nothing else — so no run of closers has two readings.
312
- // Read both ways, a chain of n `][^1]` had 2^n, and a match failing after
313
- // it walked all of them first. `][^]` and `][^a b]`, which `[^1]` cannot
314
- // read, stay `][ref]` closers.
315
- const FOOTNOTE_MARKERS = String.raw`(?:(?<=[A-Za-z\d\x60)\u0080-\uFFFF][.!?])(?:\[[^\]\s]+\])+)?`;
316
- const CLOSING_MARKUP = String.raw`(?:[*_\x60)\]}>~"'”’»›]|\]\([^()]*\)|\]\[(?!\^[^\]\s]+\])[^\]]*\]|\[\^[^\]\s]+\]|<\/[a-z][a-z\d-]*\s*>)`;
317
- const HASH_GUTTER = String.raw`[ \t]*#(?!\d)`;
318
- const GUTTER = String.raw`(?:[ \t]*>|${HASH_GUTTER})`;
319
- const HTML_BLOCK_OPEN = String.raw`<(?:!--|\?|![A-Za-z]|!\[CDATA\[|(?:script|pre|style|textarea)(?=[\s>]|$)|\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?=[\s>]|\/>|$))`;
320
- const SENTENCE_END = String.raw`(?:(?:[!?]|(?<!(?<![A-Za-z\d])(?-i:e\.g|i\.e|cf|viz|vs))\.)${FOOTNOTE_MARKERS}${CLOSING_MARKUP}*\s|…${CLOSING_MARKUP}*\s?|\n(?=${GUTTER}*[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]|\x60{3}|~{3}|\||${HTML_BLOCK_OPEN}))|\n(?=(?:${HASH_GUTTER})*[ \t]*>)(?<=(?:^|\n)(?!(?:${HASH_GUTTER})*[ \t]*>)[^\n]*\n)|\n${GUTTER}*[ \t]*\r?\n|\n(?:${GUTTER}+ ?)? {0,3}(?:=+|-+|(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})[ \t]*\r?\n)`;
321
- // #1958. What names an update type, for both of ADR 0010's #1906 rows below:
322
- // minor, patch or major as a whole word. The rows' first cut matched the bare
323
- // substring, so "dispatched" and "majority" scoped a claim that names no
324
- // update type, and an unscoped bold span or drift sentence passed. `\b` is not
325
- // the boundary either: it counts `_` as a word character, so an italic
326
- // `_patch_` would stop scoping its claim. Only an ASCII letter or digit beside
327
- // the word disqualifies it. A plural still names the type — "automerged for
328
- // minors and patches" is scoped — so minors, majors and patches count;
329
- // "patched" and "patching" do not.
330
- //
331
- // #1988. Three holes are left open, each a word that names no update type
332
- // still scoping its claim. The plain-English sense: "patches" read as a verb,
333
- // as #1958 left it, and "we patch monthly", "at minor cost", "a major
334
- // benefit". A whole word cannot tell that sense from the update type, and
335
- // asking for the type's own context — "bump" beside it — refuses "Majors
336
- // aside" and "for minors and patches", prose that names exactly the scope the
337
- // rows ask for. A word no reader sees: a link target, as in
338
- // `[notes](https://x.io/patch-notes)`, a reference label, an HTML comment.
339
- // Refusing those takes one more lookbehind on `UPDATE_TYPE` itself, for
340
- // markup ADR 0010 has none of. And a non-ASCII letter
341
- // beside the word: "patché" scopes. `[\p{L}\p{N}]` would refuse it, but each
342
- // regex this is spliced into sets its own flags: built without `u`, `\p` is a
343
- // plain "p" and the class a few literal characters, so "dispatched" scopes
344
- // again, silently.
345
- const UPDATE_TYPE = String.raw`(?<![a-z\d])(?:minors?|majors?|patch(?:es)?)(?![a-z\d])`;
346
-
347
- // #1992. Both sentence rows are spelling bans, triggered by the stale
348
- // sentence's own words: "bounding drift" here, a merge verb in
349
- // UNSCOPED_MERGE_SENTENCE below. The same unscoped claim reworded — "keeping
350
- // drift bounded at about one month", "that caps drift at a month" — passes.
351
- // That ceiling is accepted, not missed: the table bans a stale FORM, and
352
- // reading a claim for what it says is kept, by the header's rule, for a claim
353
- // whose rewording is as likely as its reversion, as securityReleaseFault and
354
- // windowReleaseCountFault read theirs. A longer list of trigger words would
355
- // still be a spelling, only a longer one.
356
- const UNSCOPED_DRIFT_SENTENCE = new RegExp(
357
- String.raw`(?:^|${SENTENCE_END})(?:(?!${SENTENCE_END}|${UPDATE_TYPE})[^])*\bbounding\s+drift\b(?:(?!${SENTENCE_END}|${UPDATE_TYPE})[^])*(?:${SENTENCE_END}|$)`,
358
- "i",
359
- );
360
- const UNSCOPED_AUTOMERGED_SPAN = new RegExp(
361
- String.raw`\*\*(?:(?!${UPDATE_TYPE})[^*\n])*\bautomerged\b(?:(?!${UPDATE_TYPE})[^*\n])*\*\*`,
362
- "i",
363
- );
364
-
365
- // #1978. The merge counterpart of UNSCOPED_DRIFT_SENTENCE, for pin-drift.sh's
366
- // bound row below: a sentence that ties a bump's merge to its checks — merge,
367
- // merges, automerged; checks, CI, green — with no update type named in it.
368
- // Both trigger words sit in lookaheads so either may come first, and the scope
369
- // ban spans the whole sentence, so UPDATE_TYPE anywhere inside it passes —
370
- // rebased onto #1958's shared constant rather than a bare `minor|patch|major`,
371
- // so "dispatched"/"majority" scope nothing here either, same as its drift
372
- // twin. It pins the scope's presence, not its polarity — "every bump, major
373
- // included, merges once the checks pass" names a type and passes — since
374
- // which types automerge is renovate.json's to say, and
375
- // renovate-release-contract.test.mjs already reds a major that automerges.
376
- // The merge trigger is closed with its own `\b`, matching the checks
377
- // trigger's bilateral bounding: `merg` alone left the noun "merger" (an
378
- // unrelated business sense, not a PR merge) free to trip this beside
379
- // "checks"/"CI"/"green", since a word boundary sits before "merg" in "merger"
380
- // too. Bounding it to `merg(?:e[sd]?|ing)` keeps every verb form this needs —
381
- // merge, merges, merged, merging, automerges, automerged — while
382
- // "merger"/"mergers" no longer satisfy it (review finding, PR #1990).
383
- //
384
- // #1992. Its trigger has the drift row's ceiling in merge words: "a bump
385
- // lands once its checks go green" and "the bump is approved once checks are
386
- // green" pass. Widening the verb list buys more spellings, not the concept.
387
- // `land`, the likeliest synonym, is in pin-drift.sh four times already —
388
- // releases "landing inside" the 43 days, a move "LANDED on the branch", the
389
- // pin "lands roughly", bumps that "keep landing" — none shares a sentence
390
- // with a checks/CI/green word, so none would trip even a widened trigger
391
- // here; the row does not guard ADR 0010, but the same widened trigger reds
392
- // its "none landed in the 43 days after — and node here runs `node
393
- // --check`", whose "check" is a flag.
394
- const UNSCOPED_MERGE_SENTENCE = new RegExp(
395
- String.raw`(?:^|${SENTENCE_END})(?=(?:(?!${SENTENCE_END})[^])*?\b(?:auto-?)?merg(?:e[sd]?|ing)\b)(?=(?:(?!${SENTENCE_END})[^])*?\b(?:checks?|CI|green)\b)(?:(?!${SENTENCE_END}|${UPDATE_TYPE})[^])*(?:${SENTENCE_END}|$)`,
396
- "i",
397
- );
398
-
399
- // #1970. How many releases landed in the 43 days the pin sat, which ADR 0010
400
- // and pin-drift.sh both state. #1874 corrected the count: 8 releases are past
401
- // `26.5.0`, three of them already out when #335 set the pin, so five landed
402
- // inside the 43 days. Until #1970 both files' rows banned only the old
403
- // spelling, "across 8 releases", and "43 days, with eight 26.x releases
404
- // landing inside them" states the same false count and passed. So the count
405
- // is read for what it says, as securityReleaseFault reads its claim. Null when
406
- // every count the 43 days owns is five, else the reason. Takes the text, so
407
- // the tests can hand it rewordings neither file holds.
408
- //
409
- // The scope is each sentence (SENTENCE_END, gutter stripped) naming the
410
- // window: "43 days", or since/after the pin or #335. A count there is a
411
- // number — digits, or "no" and "zero" through "twelve" — then "release(s)",
412
- // with only "more", "new", "further", "other", "Node" or a `26`/`26.x`
413
- // between; any other word between makes it a count of some kind of release —
414
- // "no security release" — not the window's total. The rest of the count's
415
- // clause, up to `, ; : ( ) — –` or a clause break (`and`, `but`, `so`,
416
- // `yet`), says which reference point it counts from: pinPlacements reading
417
- // it after the pin, or "in the 43 days", ties it to the window whatever
418
- // else the clause says; failing that, a before-the-pin reading, or "past"
419
- // (not the window's own "the past 43 days"), "behind", "beyond", or
420
- // since/after/from `26.5.0`, measures it from somewhere else — "Of those 8
421
- // releases past `26.5.0`", "ended the 43 days with 8 releases behind". A
422
- // count with none of those belongs to the window its sentence names. A bare
423
- // "not" (or "not all") directly before it denies the count rather than
424
- // claiming it.
425
- //
426
- // THE CEILING. It knows the window only as the words above, so "while the
427
- // pin sat unbumped, Node shipped 8 releases" names no window and passes; so
428
- // does a count spelled outside that vocabulary, "a dozen", or measured past
429
- // `26.5.0` in a clause that never says where it landed. A true reword that
430
- // counts from somewhere it does not know — "8 releases, three of them already
431
- // out" — reds, the loud direction. It checks the window's count alone: the 8
432
- // behind and the three before the pin are not held to their numbers. And,
433
- // unlike securityReleaseFault, a file stating no count at all passes: the
434
- // rows below carry no live needle for this count, for #1756's reason. It
435
- // also reads a count that never sits beside the word "release(s)" at all —
436
- // an anaphoric "eight of them", "eight of those", or "eight of Node's
437
- // releases" referring back to a "release(s)" named earlier in the same
438
- // sentence makes the identical false claim. The house style already reaches
439
- // for this shape: this function's own design note above reads "8 releases,
440
- // three of them already out", and ADR 0010, ADR 0002 and ADR 0008 each use
441
- // "of those"/"any of them" the same way (#2003).
442
- const COUNT_WORDS = { no: 0, zero: 0, one: 1, two: 2, three: 3, four: 4, five: 5, six: 6, seven: 7, eight: 8, nine: 9, ten: 10, eleven: 11, twelve: 12 };
443
- const RELEASE_COUNT = new RegExp(
444
- String.raw`(?<![\w.\x60-])(?<!\bnode\s+)(?<count>\d+|${Object.keys(COUNT_WORDS).join("|")})\s+(?:(?:more|new|further|other|node|of\s+(?:node['’]s|the|those|these)|\x60?v?26(?:\.x)?\x60?)\s+)*releases?\b`,
445
- "gi",
446
- );
447
- // A count with no noun following it at all — "eight of them"/"eight of
448
- // those" — has no "release(s)" to match beside, so it needs its own shape:
449
- // the pronoun, plus RELEASE_NAMED reading back over the sentence so far for
450
- // the antecedent it stands in for. That scope is the sentence, not the
451
- // clause: #2003's own motivating example names "releases" ahead of an
452
- // em-dash and reads "8 of them" only after it, past the clause break the
453
- // window/pin scan elsewhere in this file stops at. The same width that lets
454
- // it catch that example lets an unrelated "N of them" later in a sentence
455
- // that also happens to name a release ride along — a false-alarm risk this
456
- // shape accepts rather than parses away.
457
- const ANAPHORIC_RELEASE_COUNT = new RegExp(
458
- String.raw`(?<![\w.\x60-])(?<!\bnode\s+)(?<count>\d+|${Object.keys(COUNT_WORDS).join("|")})\s+of\s+(?:them|those)\b`,
459
- "gi",
460
- );
461
- const RELEASE_NAMED = /\breleases?\b/i;
462
- const PIN_WINDOW = /\b43[\s-]days?\b|\b(?:since|after)\s+(?:#335\b|(?:the\s+|it\s+was\s+)?pin(?:s|ned|ning)?\b)/i;
463
- const MEASURED_ELSEWHERE = /\b(?:(?<!\bthe\s+)past|behind|beyond)\b|\b(?:since|after|from)\s+\x60?v?26\.5\.0\b/i;
464
-
465
- function windowReleaseCountFault(text) {
466
- for (const sentence of text.split(new RegExp(SENTENCE_END, "i")).map(normalize)) {
467
- if (!PIN_WINDOW.test(sentence)) continue;
468
- const matches = [
469
- ...sentence.matchAll(RELEASE_COUNT),
470
- ...[...sentence.matchAll(ANAPHORIC_RELEASE_COUNT)].filter((match) => RELEASE_NAMED.test(sentence.slice(0, match.index))),
471
- ].sort((a, b) => a.index - b.index);
472
- for (const { groups, index, 0: phrase } of matches) {
473
- if (/\bnot\s+(?:all\s+)?$/i.test(sentence.slice(0, index))) continue;
474
- const rest = sentence.slice(index + phrase.length).split(new RegExp(String.raw`[,;:()—–]|${CLAUSE_BREAK.source}`, "i"))[0];
475
- const placements = [...pinPlacements(rest)];
476
- if (!placements.includes("after") && (placements.includes("before") || MEASURED_ELSEWHERE.test(rest))) continue;
477
- const count = groups.count.toLowerCase();
478
- if ((COUNT_WORDS[count] ?? Number(count)) === 5) continue;
479
- return `counts ${phrase} in the 43 days the pin sat ("${sentence.trim()}") — five landed inside them, v26.8.0 through v26.10.0; the other three of the 8 past \`26.5.0\` were already out when #335 set the pin (#1874, #1970)`;
480
- }
481
- }
482
- return null;
483
- }
484
-
485
- const FILES = [
486
- {
487
- path: ["scripts", "arg.test.mjs"],
488
- stale: [/ledger\.mjs:441/, /board\.mjs:76-79/],
489
- live: ["tryRun"],
490
- },
491
- {
492
- path: ["scripts", "candidates-exit3-prose.test.mjs"],
493
- stale: [/candidates\.mjs:378/, /\(:390\)/, /\(:424\)/],
494
- live: ["allFilteredOut", "process.exitCode"],
495
- },
496
- {
497
- path: ["scripts", "candidates.test.mjs"],
498
- stale: [/next-ticket\/SKILL\.md:15/],
499
- live: ["## 1. Candidates"],
500
- },
501
- {
502
- // #1935. Two citations of `run-merge-bot.md:195` in this file, both
503
- // pointing at the CI wait rule's shell-timeout-vs-CI-cycle
504
- // claim, and both already stale before #1895's step-1 fire/poll split
505
- // moved the target's own numbering again. Banned generally rather than
506
- // at the one drifted value: a ban on `:195` alone lets `:196` or any
507
- // other number straight back in, and this file already carried the
508
- // identical stale number at two independent sites.
509
- path: ["scripts", "fleet-heartbeat.mjs"],
510
- // #2667. The header once said run-merge-bot.md's CI gate holds its wait
511
- // "and re-issuing it", and the several-holds paragraph once called the
512
- // heartbeat "the same remedy the CI gate reached for". The CI wait holds
513
- // in one `eval` cell and re-issues nothing. Tolerant of a re-wrap: the
514
- // comment is hard-wrapped, so either phrase can break across a `//` line.
515
- stale: [
516
- /run-merge-bot\.md:\d+/,
517
- /re-issuing\s+(?:\/\/\s*)?it\b/,
518
- /same remedy the\s+(?:\/\/\s*)?CI gate/,
519
- ],
520
- // #2677. Both comments once attributed omp's 300s command deadline to
521
- // run-merge-bot.md's CI wait rule, which names no 300s — it names the ~60s
522
- // auto-background and the 5-6 minute CI cycle. The 300s is stated as omp's
523
- // own default now, and only the CI cycle still cites the rule.
524
- // One needle per SITE — either can revert independently of the other.
525
- live: [
526
- "its command deadline defaults to 300s (the bash tool's default `timeout`)",
527
- "the 5-6 minute CI cycle run-merge-bot.md's CI wait rule states",
528
- ],
529
- },
530
- {
531
- path: ["scripts", "implementer-model-tier.test.mjs"],
532
- stale: [/member-lifecycle\.md:7/],
533
- live: ["member-lifecycle.md's"],
534
- },
535
- {
536
- path: ["scripts", "ledger.mjs"],
537
- // #2516. The `filed` subcommand's isDigits() comment pointed at
538
- // "(line ~1527)" for the `keyNum` check it mirrors — a line that had
539
- // already drifted into an unrelated comment. It names the check by its
540
- // enclosing function now. runDispatchKeyNumFault below holds the cited
541
- // side: the function and the check still exist under those names.
542
- stale: [/fleet-plugin-design\.md:200/, /candidates\.mjs:279/, /\blines?\s+~?\d+/],
543
- live: ["refuseIfCapped", "runDispatch's `keyNum` check"],
544
- },
545
- {
546
- path: ["scripts", "ledger.test.mjs"],
547
- stale: [/fleet-plugin-design\.md:200/],
548
- live: ["fleet-plugin-design.md's"],
549
- },
550
- {
551
- path: ["scripts", "member-outcomes.mjs"],
552
- stale: [/board\.mjs:221-232/],
553
- live: ["board.mjs's"],
554
- },
555
- {
556
- path: ["scripts", "no-undo-audit.sh"],
557
- stale: [/claim-ticket\.sh:26/],
558
- live: [`wt=".worktrees/$issue-$slug"`],
559
- },
560
- {
561
- path: ["scripts", "printf-die-sweep.test.mjs"],
562
- stale: [/verify-sha\.sh:33/],
563
- live: ["verify-sha.sh's fetch trace"],
564
- },
565
- {
566
- // #870. Not a #516 conversion: PR #866 fixed these two citations by hand,
567
- // both `release-ticket.sh:15-25` -> a bare `release-ticket.sh`, and left
568
- // them unpinned in both directions. Banned generally rather than at the one
569
- // drifted value, for the reason the run-merge-bot entry below gives: a ban
570
- // on `:15-25` alone lets `:14-24` straight back in. This file carries no
571
- // other `release-ticket.sh:<digit>`, so the general form costs nothing
572
- // today — and it will refuse one thing tomorrow, the same thing
573
- // net-ssh-precedence-prose.test.mjs's negative pin already refuses and
574
- // documents: a future sentence in that file recounting what the citation
575
- // USED to say. Accepted on the same ground — that history belongs on the
576
- // commit, not in a comment a reader could act on.
577
- path: ["scripts", "reaping-prose.test.mjs"],
578
- stale: [/release-ticket\.sh:\d/],
579
- // One needle per SITE — the file header, and the comment inside
580
- // `test("release-ticket.sh: the comment at the dirty check ...")` — because
581
- // the finding is that the stale form can return to EITHER of them, and a
582
- // needle satisfied from one site would not notice the other reverting. A
583
- // bare `release-ticket.sh` would be vacuous outright: that file names the
584
- // script in unrelated prose, in a path join and in a test name. Needles
585
- // this long are the price of that: a copy-edit to either sentence reds
586
- // here, which is a citation-shaped change asking to be re-read anyway.
587
- live: [
588
- "The script's header (release-ticket.sh) already carried the corrected wording",
589
- "The header (release-ticket.sh) states the limitation",
590
- ],
591
- },
592
- {
593
- path: ["scripts", "release-ticket.test.mjs"],
594
- stale: [/release-ticket\.sh:303/],
595
- live: ["empty-entry skip"],
596
- },
597
- {
598
- path: ["scripts", "review-core-reads.test.mjs"],
599
- stale: [/select-dimensions\.test\.mjs:211-216/],
600
- live: ["reviewDispatchOptions"],
601
- },
602
- {
603
- path: ["scripts", "review-core-snapshot-path.test.mjs"],
604
- // #2546. The test once cited a `required:` comment inside
605
- // `FINDINGS_SCHEMA` in review-core.mjs, which that file does not carry —
606
- // the comment lived in the deleted review-pr.js. The stale form is that
607
- // dangling citation; the live needle is the spec that now holds the quote.
608
- stale: [/select-dimensions\.test\.mjs:251-256/, /`required:` comment inside `FINDINGS_SCHEMA` in review-core\.mjs/],
609
- live: ["resolveDimensions", "2026-09-08-omp-eval-workflow-host.md"],
610
- },
611
- {
612
- path: ["scripts", "run-merge-bot-prose.test.mjs"],
613
- // #1136. The line number on this citation rotted repeatedly — #1136
614
- // measured `:107`, #516 swept `:173`, and the check itself now sits at a
615
- // third place again — so the stale form is banned generally here rather
616
- // than one drifted value at a time.
617
- stale: [/prove-merge\.sh:\d+/],
618
- // The live needle is the CONSTRUCT, verbatim from that check. The die
619
- // message the check emits would be a vacuous needle: this file asserts
620
- // that string independently of the citation, so the pin would still pass
621
- // after the citation was deleted outright.
622
- live: ['[ "$parents" -ge 2 ]'],
623
- },
624
- // #1349 retired this entry outright rather than leaving it to rot:
625
- // select-dimensions.test.mjs's `lift(stripComments(SOURCE), "resolveDimensions"...)`
626
- // machinery this pin guarded no longer exists anywhere in this file —
627
- // the omp-only cutover converted it to direct imports of
628
- // `resolveDimensions`/`verifiersFor`/`DEFAULT_DIMENSIONS`, so there is no
629
- // construct left to name here. Removed with the cutover that obsoleted
630
- // it, not left as a stale form for a future sweep to catch.
631
- // #1349 retired this entry outright rather than leaving it to rot: the
632
- // vendored `code-reviewer.md` this citation pointed at (via its "Review
633
- // Scope" section) no longer exists anywhere in this port — the fork ruled
634
- // on #1303 drops the whole `pr-review-toolkit` dependency, so there is no
635
- // construct left to name here. Removed with the ticket that obsoleted it,
636
- // not left as a stale form for a future sweep to catch.
637
- {
638
- path: ["skills", "run-team", "SKILL.md"],
639
- stale: [/board\.mjs:153/],
640
- live: ["encodeProjectDir"],
641
- },
642
- // #1725 fixed this ADR's `ci.yml:269` citation by hand, replacing it with
643
- // the `# Blocking, every PR` comment anchor. Ban the general `\d+` form,
644
- // not just the one drifted value: a ban on `:269` alone lets `:270` right
645
- // back in.
646
- //
647
- // #1916. Two more citations rotted the same way: `release.yml:41` (the
648
- // false-claim history in Context) and `release-label.yml:39-41` /
649
- // `release-label.yml:68-70` (the `auto-label-bots` and
650
- // `validate-release-label` jobs' `if:` conditions, both cited on the same
651
- // `required_status_checks` table row). Converted to the job/step names,
652
- // the same construct ADR 0010 already uses for these same two files.
653
- {
654
- path: ["..", "docs", "adr", "0007-main-ruleset-is-the-merge-gate.md"],
655
- stale: [/ci\.yml:\d+/, /release\.yml:\d+/, /release-label\.yml:\d+/],
656
- live: [
657
- "# Blocking, every PR",
658
- "`release.yml`'s `Determine bump segment` step",
659
- "`release-label.yml`'s `auto-label-bots` job",
660
- "`release-label.yml`'s `validate-release-label` job",
661
- ],
662
- },
663
- // #1756. ADR 0010's own evidence, corrected in place. Its ci.yml citation
664
- // named the `node-version-file` sites by line, numbers the introducing PR's
665
- // own hunk had already shifted; 8ec241f, in that same PR, named the jobs
666
- // holding them instead. Its claim-ticket.test.mjs citation landed on a
667
- // comment above the assertions it describes, and now names the test by its
668
- // title. Its candidates.mjs citations for the query and the fallback retry
669
- // pointed at comment lines even at the ADR's own commit, and now name
670
- // `query()` and the retry's `query(null)`. Each of those line forms is
671
- // banned generally, for the reason the ADR 0007 entry gives. The remaining
672
- // stale forms are not citations but the same rot, the widening #1555 made:
673
- // a parseArgs caller list crediting arg.mjs and staleness.mjs, whose
674
- // mentions are comments; a Node release date a day earlier than the
675
- // changelog's; and an escape-hatch sentence that ruled out every other hatch
676
- // rather than every other Renovate-driven one. None of those was replaced
677
- // by a construct, so they carry no live needle — pinning the new wording
678
- // instead would red a legitimate reword.
679
- //
680
- // #1872. The three citations #1756 left in line form, all in the same
681
- // evidence list: `board-cli.test.mjs`'s 100-run measurement, and the
682
- // `release.yml` / `release-label.yml` citations behind "every merged PR
683
- // mints a release". The board-cli one had already rotted when this ticket
684
- // reached it — later edits to that file had moved the measurement out of the
685
- // cited range, and nothing went red. Each now names its construct instead —
686
- // the test the measurement sits above, and each workflow's job — and each
687
- // line form is banned generally, for the same reason.
688
- //
689
- // #1874. Two more of the same, adjacent to #1756's. The Status line and a
690
- // Consequences bullet located the pin's owner comment in ci.yml as the
691
- // "first" `setup-node`, a position any `setup-node` step added above the
692
- // `check` job's would silently re-point it to; both now name the `check`
693
- // job instead.
694
- // One needle serves both sites, so it is the ban on the positional form, not
695
- // the needle, that reds either one reverting. And the evidence counted "8
696
- // releases" and a security release "since the pin" without saying from
697
- // what: 8 is the releases past `26.5.0`, three of them — the security
698
- // release among them — already out when the pin was set. Both were bans on
699
- // the old sentence's spelling, and the same false claim in other words
700
- // passed each: securityReleaseFault reads the security release's for what it
701
- // says since #1928, and windowReleaseCountFault the count's since #1970,
702
- // both above the table and both tested below it.
703
- //
704
- // #1905. The release-age gate, stated in wall-clock days it does not give.
705
- // The Status line's #1753 amendment said a release "must be three days old"
706
- // before the bot acts, and point 3 (as #1900 left it) put the shortfall at
707
- // "closer to two days", from a date that sits "hours to a day before" the
708
- // publish. Renovate's `node-version` datasource reads index.json's day-only
709
- // `date` as UTC midnight; across all 15 v26.x releases that midnight sat 12
710
- // to 38.5 hours before the GitHub release, so the gate can pass a release
711
- // 33.5 hours after it went out. All three wordings are banned. The third
712
- // row also bans "up to a day before"; #1905's own suggested remedy said the
713
- // datasource can "precede actual publish by up to a day", which undercounts
714
- // the same gap the same way and gets its own fourth row below, since it
715
- // drops the trailing "before" the third row's alternation needs. No live
716
- // needle, for the reason #1756's gives.
717
- //
718
- // #1906. Point 3's bold heading ("Monthly, and automerged.") and its
719
- // closing figures ("about one PR, one release and one CI burst per month
720
- // ... bounding drift at about one month") read as covering every bump,
721
- // where the Status line's #1752 amendment keeps automerge for minor and
722
- // patch bumps only: a major waits for a human, so its release waits on that
723
- // human and no one-month drift bound holds for it. Both now name their
724
- // scope. The two rows #1906 adds ban each claim with no update type —
725
- // minor, patch or major — named in its own span: a one-line bold span that
726
- // says automerged, and a sentence bounding drift. The scope has to sit in
727
- // that span, for the reason ci-comment-rot-prose's windowClaimFault keeps
728
- // its distinction inside one sentence: read any wider, an unrelated mention
729
- // nearby supplies it. The cost of that ceiling is that a paraphrase scoping
730
- // the claim only in the NEXT sentence reds too — and so does one scoping it
731
- // across a mid-sentence period SENTENCE_END still counts as an end: "etc.",
732
- // an ellipsis, any abbreviation off its list (#1959). No live needle, for
733
- // the reason #1756's gives.
734
- {
735
- path: ADR_0010,
736
- stale: [
737
- /\blines?\s+\d/,
738
- /claim-ticket\.test\.mjs:\d/,
739
- /candidates\.mjs:\d/,
740
- /board-cli\.test\.mjs:\d/,
741
- /release\.yml:\d/,
742
- /release-label\.yml:\d/,
743
- /\bfirst\s+`?setup-node\b/,
744
- // A backticked `.mjs` list straight after "used by" that includes either
745
- // comment-only file, wherever in the list and however it wraps.
746
- /used by(?:[\s,]*(?:and\s+)?`[\w-]+\.mjs`)*[\s,]*(?:and\s+)?`(?:arg|staleness)\.mjs`/,
747
- /2026-09-21/,
748
- /there is no other(?!\s+Renovate-driven\b)/,
749
- /must\s+be\s+three\s+days\s+old/,
750
- /closer\s+to\s+two\s+days/,
751
- /(?:hours|up)\s+to\s+a\s+day\s+before/,
752
- /\bby\s+up\s+to\s+a\s+day\b/,
753
- UNSCOPED_AUTOMERGED_SPAN,
754
- UNSCOPED_DRIFT_SENTENCE,
755
- ],
756
- live: [
757
- "`check`",
758
- "`validate-claude`",
759
- "`install-and-smoke`",
760
- "runner: a dash-led argument counts as an operand only where it exists",
761
- "`query()`",
762
- "`query(null)`",
763
- "build: --spend-since's refusal survives a gh child that has already pushed past the pipe buffer, unread",
764
- "`release.yml`'s `release` job",
765
- "`release-label.yml`'s `auto-label-bots` job",
766
- "the `check` job's `setup-node`",
767
- ],
768
- },
769
- // #1874. pin-drift.sh restated ADR 0010's "43 days across 8 releases" as
770
- // the cost of a silent pin, where only five of the 8 landed inside the 43
771
- // days. The count is corrected in both files, and windowReleaseCountFault
772
- // keeps both from counting anything else in the 43 days (#1970).
773
- //
774
- // #1925. The bound's argument in pin-drift.sh, and the cadence note in
775
- // pin-drift.yml that leans on it, still described the Renovate schedule
776
- // #1753 replaced: the 1st of each month, 00:00–04:59 UTC. The window is now
777
- // all day on the 1st–3rd, so the longest healthy gap is no longer "up to 31
778
- // days", 35 leaves about a day of slack rather than "a few days'", and a
779
- // Monday run on the 1st–3rd falls inside the window rather than "never"
780
- // racing it. Each stale wording is banned in the file that carried it, and
781
- // `(?:\s|#)+` spans a wrap across the `# ` gutter. No
782
- // live needle: the replacement states the window renovate.json owns, and
783
- // pinning it would red a legitimate schedule change, not the stale copy.
784
- //
785
- // #1978. The same argument added that last PR's checks to the gap "since
786
- // the merge waits on them, not on the window" — every bump's merge, as
787
- // #1956 found ci.yml saying, when #1752 had narrowed automerge to minor and
788
- // patch: a major waits on a human, which no drift bound covers. The bound
789
- // stays at 35 (the script now argues why a pending major needs no slack);
790
- // the row bans a merge-on-checks sentence that names no update type, and
791
- // SENTENCE_END finds the sentence across the `# ` gutter as it does in the
792
- // ADR. No live needle, for #1756's reason.
793
- {
794
- path: PIN_DRIFT_SH,
795
- stale: [
796
- /\b1st(?:\s|#)+of(?:\s|#)+each(?:\s|#)+month\b/,
797
- /\b1st-to-1st\b/,
798
- /\bup(?:\s|#)+to(?:\s|#)+31(?:\s|#)+days\b/,
799
- /\ba(?:\s|#)+few(?:\s|#)+days'(?:\s|#)+slack\b/,
800
- UNSCOPED_MERGE_SENTENCE,
801
- ],
802
- live: [],
803
- },
804
- {
805
- path: ["..", ".github", "workflows", "pin-drift.yml"],
806
- stale: [
807
- /\b1st(?:\s|#)+of(?:\s|#)+each(?:\s|#)+month\b/,
808
- /00:00(?:\s|#)*[–-](?:\s|#)*04:59/,
809
- /\bnever(?:\s|#)+races\b/,
810
- ],
811
- live: [],
812
- },
813
- // #1757. The glossary's Runtime heading names the two terms ADR 0010
814
- // separates, and each entry points at that ADR from its cross-reference to
815
- // the other term. One needle per SITE, for the reason the reaping-prose
816
- // entry gives: a bare `(ADR 0010)` would stay satisfied by either entry
817
- // after the other lost its pointer. These are new pointers, not converted
818
- // ones, so the entry carries no `stale` form.
819
- {
820
- path: ["..", "CONTEXT.md"],
821
- stale: [],
822
- live: ["**Consumer floor** (ADR 0010)", "**Runtime pin** (ADR 0010)"],
823
- },
824
- ];
825
-
826
- for (const { path, stale, live } of FILES) {
827
- const label = path.join("/");
828
- const source = read(...path);
829
- const prose = normalize(source);
830
-
831
- for (const pattern of stale) {
832
- test(`${label} does not regress to the stale form ${pattern}`, () => {
833
- assert.doesNotMatch(
834
- source,
835
- pattern,
836
- `a stale form matching ${pattern} is back in ${label} — this spelling was converted away because it rots silently: a line number the moment the cited file is next touched, a raw-source pin the moment a dead copy drifts above the live declaration — with nothing going red when it does`,
837
- );
838
- });
839
- }
840
-
841
- for (const needle of live) {
842
- test(`${label} still names the construct its citation rests on (${needle})`, () => {
843
- assert.ok(
844
- prose.includes(needle),
845
- `${label} no longer mentions "${needle}" anywhere — the construct this citation rests on appears to have been deleted outright rather than kept current`,
846
- );
847
- });
848
-
849
- for (const [, number] of needle.matchAll(ADR_POINTER)) {
850
- test(`${label}'s pointer to ADR ${number} still resolves to one file under docs/adr/ (${needle})`, () => {
851
- const fault = adrFault(number, ADRS);
852
- assert.equal(fault, null, `${label} points at ADR ${number} through "${needle}", but ${fault}`);
853
- });
854
- }
855
- }
856
- }
857
-
858
- // The cited side of ledger.mjs's "runDispatch's `keyNum` check" pointer: a
859
- // top-level `function runDispatch(` (`async` or not) whose body, up to the
860
- // first line that starts with `}`, still calls `isDigits(keyNum)`. Comments
861
- // are stripped first, so the pointer's own comment, or the check left behind
862
- // as a whole-line `//` or `/* */` comment, cannot stand in for the code, and
863
- // KEYNUM_CHECK refuses a check that follows a `//` on its line. Two forms
864
- // still can, because strip-comments.mjs blanks whole-line comments only and
865
- // nothing here tokenizes: the check's text inside a string literal, and
866
- // inside a block comment opened after code on the same line. Null when the
867
- // function and the call both hold, else the reason.
868
- const RUN_DISPATCH = /^(?:async\s+)?function\s+runDispatch\s*\(/m;
869
- const KEYNUM_CHECK = /^(?:(?!\/\/).)*\bisDigits\(\s*keyNum\s*\)/m;
870
-
871
- function runDispatchKeyNumFault(source) {
872
- const code = stripComments(source);
873
- const start = code.search(RUN_DISPATCH);
874
- if (start === -1) return "no `function runDispatch(` outside comments";
875
- const end = code.indexOf("\n}", start);
876
- const body = code.slice(start, end === -1 ? undefined : end);
877
- return KEYNUM_CHECK.test(body) ? null : "runDispatch() no longer calls `isDigits(keyNum)` outside comments";
878
- }
879
-
880
- test("ledger.mjs's pointer to runDispatch's `keyNum` check still lands on code", () => {
881
- const fault = runDispatchKeyNumFault(read("scripts", "ledger.mjs"));
882
- assert.equal(fault, null, `ledger.mjs's \`filed\` comment points at "runDispatch's \`keyNum\` check", but ${fault} — rename the pointer with its target, and RUN_DISPATCH and KEYNUM_CHECK in citation-sweep-prose.test.mjs with it`);
883
- });
884
-
885
- test("the runDispatch pointer reds once the function, the variable or the check's place changes", () => {
886
- const check = " const keyNum = key;\n if (!isDigits(keyNum)) die();\n";
887
- for (const source of [
888
- `function runDispatchRow() {\n${check}}\n`,
889
- "function runDispatch() {\n const keyDigits = key;\n if (!isDigits(keyDigits)) die();\n}\n",
890
- `function runDispatch() {\n}\n\nfunction validate() {\n${check}}\n`,
891
- "function runDispatch() {\n const keyNum = key;\n // if (!isDigits(keyNum)) die();\n}\n",
892
- "function runDispatch() {\n const keyNum = key;\n void 0; // if (!isDigits(keyNum)) die();\n}\n",
893
- `/*\nfunction runDispatch() {\n${check}}\n*/\n`,
894
- `function wrapper() {\n function runDispatch() {\n${check} }\n}\n`,
895
- `const x = 1; function runDispatch() {\n${check}}\n`,
896
- ]) {
897
- assert.notEqual(runDispatchKeyNumFault(source), null, source);
898
- }
899
- });
900
-
901
- test("the runDispatch pointer accepts a reflowed check and ignores the comment that cites it", () => {
902
- for (const source of [
903
- "// isDigits() gates id the same way runDispatch's `keyNum` check gates\nasync function runDispatch() {\n if (keyNum !== null && !isDigits( keyNum )) die();\n}\n",
904
- "function runDispatch() {\n const keyNum = key;\n if (!isDigits(keyNum)) die();\n}\n",
905
- ]) {
906
- assert.equal(runDispatchKeyNumFault(source), null, source);
907
- }
908
- });
909
-
910
- test("an ADR pointer resolves by number alone, so a retitled ADR still answers to it", () => {
911
- assert.equal(adrFault("0010", ["0009-supported-platforms-are-macos-linux-wsl.md", "0010-a-retitled-ruling.md"]), null);
912
- });
913
-
914
- test("an ADR pointer reds once its number stops naming exactly one file: renumbered, moved out, or doubled", () => {
915
- assert.match(adrFault("0010", ["0009-supported-platforms-are-macos-linux-wsl.md", "0014-the-node-pin-stays-exact-and-a-bot-moves-it.md"]), /no docs\/adr\/0010-\*\.md/);
916
- assert.match(adrFault("0010", []), /no docs\/adr\/0010-\*\.md/);
917
- assert.match(adrFault("0010", ["0010-one-ruling.md", "0010-another-ruling.md"]), /2 files answer to ADR 0010/);
918
- });
919
-
920
- // #1928. The security bullet in a fixture ADR, between two neighbours that
921
- // stay fixed: the release-list bullet above names v26.5.1 as "already out when
922
- // the pin was set" too, so a claim the security bullet no longer makes has a
923
- // true one right beside it to lean on — the scope the fault reads is what the
924
- // last of these tests proves.
925
- const adrWith = (claim) =>
926
- [
927
- "- **The exact pin does not get bumped.** Three more past `26.5.0` — v26.5.1, v26.6.0",
928
- " and v26.7.0 — were already out when the pin was set.",
929
- "- **Security was never the axis.** Of those 8 releases past `26.5.0`, exactly",
930
- ` one was a security release — ${claim} — and node here runs \`node --check\` on`,
931
- " tracked files and this repo's own suite: no server, no untrusted input, no",
932
- " published artifact.",
933
- "- **Reproducibility is the real axis.** This suite pins node's *own* behaviour.",
934
- ].join("\n");
935
-
936
- test("ADR 0010's security evidence still says its lone security release predates the pin (#1928)", () => {
937
- assert.equal(securityReleaseFault(read(...ADR_0010)), null);
938
- });
939
-
940
- test("a security-release claim reworded with v26.5.1 still before the pin is accepted (#1928)", () => {
941
- for (const claim of [
942
- "v26.5.1, already out when the pin was set, so none landed in the 43 days after",
943
- "v26.5.1, which predates the pin",
944
- "v26.5.1, shipped before #335 set the pin, and none has landed since",
945
- "v26.5.1, and none has landed since the pin",
946
- "v26.5.1, which did not land after the pin was set",
947
- // "since" as the causal conjunction: the order word nearest the pin is
948
- // "predates", so a first-word reading refuses the first of these. In the
949
- // second, the "cannot" before "since" negates nothing about "predates".
950
- "v26.5.1, which is harmless here since it predates the pin",
951
- "v26.5.1, which cannot matter here since it predates the pin",
952
- ]) {
953
- assert.equal(securityReleaseFault(adrWith(claim)), null, claim);
954
- }
955
- });
956
-
957
- test("the same false claim in other words — v26.5.1 landing after the pin — is refused (#1928)", () => {
958
- for (const claim of [
959
- // The rewording #1928 was filed on, which the spelling ban let through.
960
- "v26.5.1, which has since landed after the pin was set",
961
- "v26.5.1, which postdates the pin",
962
- "v26.5.1, which landed in the 43 days after #335 pinned it",
963
- "v26.5.1, which landed during the 43-day window",
964
- "v26.5.1, which was not already out when the pin was set",
965
- ]) {
966
- assert.match(securityReleaseFault(adrWith(claim)), /places it after the pin/, claim);
967
- }
968
- });
969
-
970
- test("a negation on an earlier, unrelated verb does not excuse an after-the-pin clause in the same breath (PR #1969 review)", () => {
971
- // Caught in #1969's review: `NEGATION.test(clause.slice(last, index))` used
972
- // to scan the WHOLE span back to the previous match, so a `not` attached to
973
- // a different verb, on the other side of `and`, wrongly flipped "after" to
974
- // "before" — accepting the exact false claim #1928 exists to refuse.
975
- for (const claim of [
976
- "v26.5.1, which does not affect us and landed after the pin was set",
977
- "v26.5.1, which is not exploitable here and landed after the pin",
978
- ]) {
979
- assert.match(securityReleaseFault(adrWith(claim)), /places it after the pin/, claim);
980
- }
981
- });
982
-
983
- test("`not … until` names the word after `until`, it does not negate it (PR #1969 review)", () => {
984
- // "didn't land until after the pin" states the pin as when it DID land —
985
- // the most natural English phrasing of the false claim, and the negation
986
- // scan used to flip it to a before-the-pin claim regardless.
987
- for (const claim of ["v26.5.1, which didn't land until after the pin was set", "v26.5.1, which wasn't out until after the pin"]) {
988
- assert.match(securityReleaseFault(adrWith(claim)), /places it after the pin/, claim);
989
- }
990
- });
991
-
992
- test("the pin token only matches \"pin\", \"pins\", \"pinned\" or \"pinning\" (PR #1969 review)", () => {
993
- // A bare `pin\w*` also matched "pinpointed", so an unrelated before-clause
994
- // about "the pinpointed advisory" stood in for the pin mention itself,
995
- // leaving `before` true and excusing a same-clause "landed after #335" — a
996
- // false claim in the function's own vocabulary — as accepted. Tightened,
997
- // neither clause names the pin at all (the second names it only as
998
- // "#335", outside vocabulary — the loud direction, per THE CEILING), so
999
- // the claim is refused for naming no valid before-clause rather than
1000
- // silently accepted.
1001
- assert.match(
1002
- securityReleaseFault(adrWith("v26.5.1, which predates the pinpointed advisory, landed after #335")),
1003
- /no longer says v26\.5\.1 predates the pin/,
1004
- );
1005
- });
1006
-
1007
- test("the sentence #1874 replaced is refused for what it says, not how it was spelled (#1928)", () => {
1008
- const before1874 = [
1009
- "- **Security was never the axis.** Exactly one security release (v26.5.1) landed",
1010
- " in 26.x since the pin, and node here runs `node --check` on tracked files and",
1011
- " this repo's own suite: no server, no untrusted input, no published artifact.",
1012
- ].join("\n");
1013
- assert.match(securityReleaseFault(before1874), /places it after the pin \("landed in 26\.x since the pin"\)/);
1014
- });
1015
-
1016
- test("a before-the-pin clause does not excuse an after-the-pin one beside it (#1928)", () => {
1017
- // The negative half's own case: the positive half alone passes this.
1018
- assert.match(
1019
- securityReleaseFault(adrWith("v26.5.1, already out when the pin was set; it has since landed after the pin")),
1020
- /places it after the pin \("it has since landed after the pin"\)/,
1021
- );
1022
- });
1023
-
1024
- test("the security bullet must place v26.5.1 before the pin itself — no neighbour vouches for it (#1928)", () => {
1025
- for (const claim of ["v26.5.1, which is outside this repo's threat model", "v26.5.1, not yet out when the pin was set"]) {
1026
- assert.match(securityReleaseFault(adrWith(claim)), /no longer says v26\.5\.1 predates the pin/, claim);
1027
- }
1028
- assert.match(securityReleaseFault(adrWith("v26.8.0, already out when the pin was set")), /no longer names v26\.5\.1/);
1029
- assert.match(securityReleaseFault(adrWith("v26.5.1").split("\n").slice(0, 2).join("\n")), /no longer names a security release/);
1030
- });
1031
-
1032
- test("ADR 0010 and pin-drift.sh still count five releases in the 43 days the pin sat (#1970)", () => {
1033
- for (const path of [ADR_0010, PIN_DRIFT_SH]) {
1034
- assert.equal(windowReleaseCountFault(read(...path)), null, path.join("/"));
1035
- }
1036
- });
1037
-
1038
- test("the sentences #1874 replaced are refused for what they count, not how they were spelled (#1970)", () => {
1039
- for (const text of [
1040
- "- **The exact pin does not get bumped.** `.nvmrc` sat at `26.5.0` for 43 days\n across 8 releases (latest 26.x was v26.10.0, 2026-09-21). The cost #354\n",
1041
- "# removed the one passive heartbeat there was. The measured cost of that\n# silence is 43 days across 8 releases.\n#\n",
1042
- ]) {
1043
- assert.match(windowReleaseCountFault(text), /counts 8 releases in the 43 days/, text);
1044
- }
1045
- });
1046
-
1047
- test("the same false count in other words — releases in the 43 days that are not five — is refused (#1970)", () => {
1048
- for (const text of [
1049
- "The measured cost of that silence is 43 days, with eight 26.x releases landing inside them.",
1050
- "`.nvmrc` sat at `26.5.0` for 43 days, while Node shipped 8 releases.",
1051
- "It sat for 43 days, during which Node shipped eight new releases.",
1052
- "It sat for 43 days and saw only one release.",
1053
- "Node shipped 8 releases since the pin was set.",
1054
- "Node shipped 8 releases after #335 pinned it.",
1055
- // "before" names the measurement here, not the pin: still inside the window.
1056
- "Eight releases landed in the 43 days before this measurement.",
1057
- "Of those 8 releases in the 43 days, exactly one was a security release.",
1058
- // A reference point beside the count does not excuse placing it in the window.
1059
- "Node shipped 8 releases past `26.5.0` in the 43 days.",
1060
- // A clause break (and/but/so/yet) after the count does not excuse it —
1061
- // the reference point has to sit in the count's own clause (#1970 review).
1062
- "`.nvmrc` sat at `26.5.0` for 43 days, from #335 setting it on 2026-08-11 to this measurement, while Node shipped eight 26.x releases and the pin fell behind.",
1063
- // "the past 43 days" is the window naming itself, not a reference point.
1064
- "Node shipped 8 releases in the past 43 days.",
1065
- // Wrapped across the `# ` gutter.
1066
- "# The measured cost of that silence is 43 days, with\n# eight releases landing inside them.\n",
1067
- ]) {
1068
- assert.match(windowReleaseCountFault(text), /releases? in the 43 days/, text);
1069
- }
1070
- });
1071
-
1072
- test("a count measured from `26.5.0`, or placed before the pin, is not read as the 43 days' own (#1970)", () => {
1073
- for (const text of [
1074
- "It sat for 43 days, with five 26.x releases landing inside them.",
1075
- // "26" names the release line, not a count.
1076
- "It sat for 43 days while Node 26 releases kept shipping.",
1077
- "It sat for 43 days while Node shipped 5 releases.",
1078
- "Three more releases were already out when the pin was set, so it ended the 43 days eight releases behind.",
1079
- "Of those 8 releases past `26.5.0`, exactly one was a security release — v26.5.1, already out when the pin was set, so none landed in the 43 days after.",
1080
- "Of the 8 releases since `26.5.0`, five landed in the 43 days.",
1081
- "Not all 8 releases landed in the 43 days.",
1082
- // A sub-count of one kind of release is not the window's total.
1083
- "No security release landed in the 43 days.",
1084
- "Node shipped 8 releases past `26.5.0` and the pin never moved.",
1085
- // "the past 43 days" still names the window when the count is true.
1086
- "It sat for the past 43 days, with five 26.x releases landing inside them.",
1087
- // Naming no window, a count is not this claim.
1088
- "An unscheduled bot would mint roughly 8 releases a month.",
1089
- ]) {
1090
- assert.equal(windowReleaseCountFault(text), null, text);
1091
- }
1092
- });
1093
-
1094
- test("an anaphoric release count is refused the same as one spelled beside the word (#2003)", () => {
1095
- for (const text of [
1096
- // #2003's own three motivating examples.
1097
- "It shipped releases inside the 43 days — 8 of them, all after the pin.",
1098
- "Node shipped releases in the 43 days; eight of them landed after the pin.",
1099
- "In the 43 days, eight of Node's releases landed after the pin.",
1100
- // "those" reaches the same pronoun shape as "them".
1101
- "Node shipped releases in the 43 days; eight of those landed after the pin.",
1102
- ]) {
1103
- assert.match(windowReleaseCountFault(text), /\bof (?:them|those)\b in the 43 days|releases? in the 43 days/, text);
1104
- }
1105
- // "of the releases" is the same literal noun as "releases" alone, with
1106
- // the anaphoric "the"/"those"/"these" sitting between the count and it.
1107
- for (const text of [
1108
- "In the 43 days, eight of the releases landed after the pin.",
1109
- "In the 43 days, eight of those releases landed after the pin.",
1110
- "In the 43 days, eight of these releases landed after the pin.",
1111
- ]) {
1112
- assert.match(windowReleaseCountFault(text), /releases? in the 43 days/, text);
1113
- }
1114
- });
1115
-
1116
- test("a true anaphoric count stays green, and a count with no release to refer back to is not this claim (#2003)", () => {
1117
- for (const text of [
1118
- // The true count, anaphoric to "them" or to "Node's"/"the"/"those" releases.
1119
- "Node shipped releases in the 43 days, five of them landed after the pin.",
1120
- "In the 43 days, five of Node's releases landed after the pin.",
1121
- "Node shipped releases in the 43 days; five of those landed after the pin.",
1122
- "In the 43 days, five of those releases landed after the pin.",
1123
- // No "release(s)" is ever named for "them" to stand in for — an
1124
- // ordinary count of something else inside the window is not this claim.
1125
- // Eight, not five, so this case cannot pass merely because it shares the
1126
- // count the five-exemption above already treats as correct.
1127
- "Node shipped 8 issues in the 43 days; eight of them are still urgent.",
1128
- ]) {
1129
- assert.equal(windowReleaseCountFault(text), null, text);
1130
- }
1131
- });
1132
-
1133
- test("an unscoped drift sentence is refused, whatever ends the sentence before it (#1957)", () => {
1134
- for (const text of [
1135
- // Point 3's figures sentence as it read before #1906.
1136
- [
1137
- " gives the measurement.",
1138
- " That keeps about one PR, one release and one CI burst per month — the",
1139
- " Status line's #1753 amendment names one case that opens a second — while",
1140
- " bounding drift at about one month.",
1141
- ].join("\n"),
1142
- // The case #1957 was filed on: a scoped bold heading ending `bumps.**`.
1143
- "3. **Monthly, and automerged for minor and patch bumps.**\n Bounding drift at about one month.\n",
1144
- "_Monthly for minor and patch bumps._ Bounding drift at about one month.\n",
1145
- "Minor and patch bumps follow `schedule: monthly.` Bounding drift at about one month.\n",
1146
- "Minor and patch bumps land monthly (see `renovate.json`.) Bounding drift at about one month.\n",
1147
- "[Minor and patch bumps only.] Bounding drift at about one month.\n",
1148
- 'Renovate calls minor and patch bumps "monthly." Bounding drift at about one month.\n',
1149
- "Renovate calls minor and patch bumps 'monthly.' Bounding drift at about one month.\n",
1150
- "Renovate calls minor and patch bumps “monthly.” Bounding drift at about one month.\n",
1151
- "Renovate calls minor and patch bumps ‘monthly.’ Bounding drift at about one month.\n",
1152
- "**Why automerge minor and patch bumps?** Bounding drift at about one month.\n",
1153
- "Minor and patch bumps merge themselves! Bounding drift at about one month.\n",
1154
- "## Minor and patch bumps\n\nBounding drift at about one month.\n",
1155
- "- Monthly for minor and patch bumps\n- Bounding drift at about one month.\n",
1156
- // The other two markers SENTENCE_END's `[-*+]` list-item lookahead
1157
- // allows — each is its own branch, not implied by `-` alone.
1158
- "* Monthly for minor and patch bumps\n* Bounding drift at about one month.\n",
1159
- "+ Monthly for minor and patch bumps\n+ Bounding drift at about one month.\n",
1160
- ]) {
1161
- assert.match(text, UNSCOPED_DRIFT_SENTENCE, text);
1162
- }
1163
- });
1164
-
1165
- test("a drift sentence naming its own scope passes, whatever markup it carries and however it wraps (#1957)", () => {
1166
- for (const text of [
1167
- // Closing markup ends nothing without a terminator before it, and a
1168
- // terminator ends nothing without whitespace after it.
1169
- "For **minor** and _patch_ bumps (automerged) under `renovate.json`, bounding drift at about one month.\n",
1170
- "For minor and patch bumps past v26.5.0, bounding drift at about one month.\n",
1171
- // A lone newline is a wrap, not an end — even before an issue number or
1172
- // a bold span, which open no heading and no list item.
1173
- "For a minor or patch bump, the Status line's\n #1753 amendment names one case, and\n **automerge** keeps\n bounding drift at about one month.\n",
1174
- ]) {
1175
- assert.doesNotMatch(text, UNSCOPED_DRIFT_SENTENCE, text);
1176
- }
1177
- });
1178
-
1179
- test("an unscoped drift sentence is refused after every block end and closing markup #1957 left out (#1981)", () => {
1180
- for (const text of [
1181
- // The three cases #1981 was filed on.
1182
- "1) Monthly for minor and patch bumps\n2) Bounding drift at about one month.\n",
1183
- "> Minor and patch bumps\n>\n> Bounding drift at about one month.\n",
1184
- "Minor and patch bumps merge monthly…Bounding drift at about one month.\n",
1185
- "Minor and patch bumps\r\n\r\nBounding drift at about one month.\r\n",
1186
- // The same blank line behind pin-drift.sh's `# ` gutter, and a list item
1187
- // behind either gutter.
1188
- "# Minor and patch bumps\n#\n# Bounding drift at about one month.\n",
1189
- "> - Minor and patch bumps\n> - Bounding drift at about one month.\n",
1190
- "# 1) Minor and patch bumps\n# 2) Bounding drift at about one month.\n",
1191
- // A multi-digit ordered item marker — the digit branch is `\d{1,9}`,
1192
- // not just a single digit (PR #1998 review, fleet-review-tests).
1193
- "100) Monthly for minor and patch bumps\n101) Bounding drift at about one month.\n",
1194
- // A line holding only a setext underline or thematic break — each
1195
- // character its own case, since `* ` and `- ` would open a list item
1196
- // instead — then a code fence and a table row.
1197
- "Minor and patch bumps\n===\nBounding drift at about one month.\n",
1198
- "Minor and patch bumps\n---\nBounding drift at about one month.\n",
1199
- "Minor and patch bumps\n***\nBounding drift at about one month.\n",
1200
- "Minor and patch bumps\n___\nBounding drift at about one month.\n",
1201
- "Minor and patch bumps\n```\nbounding drift at about one month.\n```\n",
1202
- "Minor and patch bumps\n~~~\nbounding drift at about one month.\n~~~\n",
1203
- "| Minor and patch bumps |\n| Bounding drift at about one month. |\n",
1204
- // Closing markup past the class #1957 added.
1205
- "~~Minor and patch bumps only.~~ Bounding drift at about one month.\n",
1206
- "Renovate calls minor and patch bumps «monthly.» Bounding drift at about one month.\n",
1207
- "Renovate calls minor and patch bumps ‹monthly.› Bounding drift at about one month.\n",
1208
- "Minor and patch bumps set `{schedule: monthly.}` Bounding drift at about one month.\n",
1209
- "Minor and patch bumps land monthly <see renovate.json.> Bounding drift at about one month.\n",
1210
- "<b>Minor and patch bumps only.</b> Bounding drift at about one month.\n",
1211
- ]) {
1212
- assert.match(text, UNSCOPED_DRIFT_SENTENCE, text);
1213
- }
1214
- });
1215
-
1216
- test("a scoped drift sentence still wraps behind a gutter, over CRLF, past `...` and a leading number (#1981)", () => {
1217
- for (const text of [
1218
- // A lone newline behind a gutter is a wrap, as it is without one.
1219
- "> For minor and patch bumps, the gap keeps\n> bounding drift at about one month.\n",
1220
- "# For minor and patch bumps, the gap keeps\n# bounding drift at about one month.\n",
1221
- "For minor and patch bumps, the gap keeps\r\nbounding drift at about one month.\r\n",
1222
- // Three periods inside a range end nothing; only `…` needs no whitespace.
1223
- "For minor and patch bumps, `main...HEAD` keeps bounding drift at about one month.\n",
1224
- // A number opens a list item only with its `.` or `)` and a space.
1225
- "For minor and patch bumps the gap runs\n35 days, bounding drift at about one month.\n",
1226
- ]) {
1227
- assert.doesNotMatch(text, UNSCOPED_DRIFT_SENTENCE, text);
1228
- }
1229
- });
1230
-
1231
- test("an unscoped drift sentence is refused after an HTML block or blockquote opens, a short setext underline, and a link or footnote (#2002)", () => {
1232
- for (const text of [
1233
- // The cases #2002 was filed on that read past a real end.
1234
- "Minor and patch bumps\n<div>\nBounding drift at about one month.\n",
1235
- "Minor and patch bumps\n> Bounding drift at about one month.\n",
1236
- "[Minor and patch bumps only.](renovate.json) Bounding drift at about one month.\n",
1237
- "<my-el>Minor and patch bumps only.</my-el> Bounding drift at about one month.\n",
1238
- "<b>Minor and patch bumps only.</b > Bounding drift at about one month.\n",
1239
- // The HTML block's other openers: a closing block tag, a comment, a
1240
- // type-1 tag outside the block tag list.
1241
- "Minor and patch bumps\n</details>\nBounding drift at about one month.\n",
1242
- "Minor and patch bumps\n<!-- monthly -->\nBounding drift at about one month.\n",
1243
- "Minor and patch bumps\n<pre>\nBounding drift at about one month.\n",
1244
- // The rest of HTML_BLOCK_OPEN's own openers: the other type-1 tags, a
1245
- // processing instruction, a doctype, a CDATA section, and a block tag's
1246
- // self-closing boundary.
1247
- "Minor and patch bumps\n<script>\nBounding drift at about one month.\n",
1248
- "Minor and patch bumps\n<?php\nBounding drift at about one month.\n",
1249
- "Minor and patch bumps\n<!DOCTYPE html>\nBounding drift at about one month.\n",
1250
- "Minor and patch bumps\n<![CDATA[x]]>\nBounding drift at about one month.\n",
1251
- "Minor and patch bumps\n<hr/>\nBounding drift at about one month.\n",
1252
- // A quote opening behind pin-drift.sh's `# ` gutter.
1253
- "# Minor and patch bumps\n# > Bounding drift at about one month.\n",
1254
- // A `#`-gutter rule line or gutter list item, with no space after the
1255
- // `#`, still ends the sentence — the digit-only exception #2002 needs.
1256
- "# Minor and patch bumps\n#------------------------------\n# Bounding drift at about one month.\n",
1257
- "# Minor and patch bumps\n#- Bounding drift at about one month.\n",
1258
- // What still ends at the underline: a setext run of one, a spaced break,
1259
- // three spaces of indent.
1260
- "Minor and patch bumps\n-\nBounding drift at about one month.\n",
1261
- "Minor and patch bumps\n_ _ _\nBounding drift at about one month.\n",
1262
- "Minor and patch bumps\n ===\nBounding drift at about one month.\n",
1263
- // A reference link's label and a footnote reference close a sentence too.
1264
- "[Minor and patch bumps only.][renovate] Bounding drift at about one month.\n",
1265
- "Minor and patch bumps only.[^1] Bounding drift at about one month.\n",
1266
- ]) {
1267
- assert.match(text, UNSCOPED_DRIFT_SENTENCE, text);
1268
- }
1269
- });
1270
-
1271
- test("a scoped drift sentence still wraps past an inline tag, a line CommonMark renders as prose, and a `#NNNN)` citation (#2002)", () => {
1272
- for (const text of [
1273
- // Not an HTML block: a tag outside the block list, or a block tag's name
1274
- // as the prefix of a longer one.
1275
- "For minor and patch bumps, the gap keeps\n<span>\nbounding drift at about one month.\n",
1276
- "For minor and patch bumps, the gap keeps\n<divider>\nbounding drift at about one month.\n",
1277
- // Neither a setext underline nor a thematic break.
1278
- "For minor and patch bumps, the gap keeps\n_\nbounding drift at about one month.\n",
1279
- "For minor and patch bumps, the gap keeps\n**\nbounding drift at about one month.\n",
1280
- "For minor and patch bumps, the gap keeps\n-=-\nbounding drift at about one month.\n",
1281
- "For minor and patch bumps, the gap keeps\n*-_\nbounding drift at about one month.\n",
1282
- "For minor and patch bumps, the gap keeps\n ---\nbounding drift at about one month.\n",
1283
- // An issue citation wrapped to a line's start, with or without a gutter.
1284
- "For minor and patch bumps (see\n#1906) the gap keeps bounding drift at about one month.\n",
1285
- "# For minor and patch bumps (see\n# #1906) the gap keeps bounding drift at about one month.\n",
1286
- // A link ends nothing without a terminator inside it.
1287
- "For minor and patch bumps [the gap](renovate.json) keeps bounding drift at about one month.\n",
1288
- ]) {
1289
- assert.doesNotMatch(text, UNSCOPED_DRIFT_SENTENCE, text);
1290
- }
1291
- });
1292
-
1293
- test("a word that only contains minor, patch or major scopes neither claim (#1958)", () => {
1294
- for (const text of [
1295
- // Point 3's heading as it read before #1906.
1296
- "3. **Monthly, and automerged.**\n",
1297
- "**Monthly, and automerged; dispatched by the bot.**",
1298
- "**Dispatched monthly, and automerged.**",
1299
- "**Monthly, and automerged for the majority of bumps.**",
1300
- "**Monthly, and automerged once patched.**",
1301
- // Ends in "patch": only the boundary BEFORE the word refuses it.
1302
- "**Monthly, and automerged on each dispatch.**",
1303
- ]) {
1304
- assert.match(text, UNSCOPED_AUTOMERGED_SPAN, text);
1305
- }
1306
- for (const text of [
1307
- "For the majority of bumps that keeps one PR while bounding drift at a month.\n",
1308
- "Bounding drift at about one month, dispatched by the bot.\n",
1309
- "Once patched, bounding drift at about one month.\n",
1310
- "Bounding drift at about one month for a minority of releases.\n",
1311
- "Bounding drift at about one month, whatever Renovate dispatches.\n",
1312
- ]) {
1313
- assert.match(text, UNSCOPED_DRIFT_SENTENCE, text);
1314
- }
1315
- });
1316
-
1317
- test("minor, patch or major still scopes both claims in italics or as a plural (#1958)", () => {
1318
- for (const text of [
1319
- "3. **Monthly, and automerged for minor and patch bumps.**\n",
1320
- "**Monthly, and automerged for _patch_ bumps.**",
1321
- "**Monthly, and automerged for minors and patches.**",
1322
- "**Majors wait; the rest are automerged.**",
1323
- // Italic and plural at once (#1989): the `_` beside the word and the
1324
- // plural's "es"/"s" meet in one token, before and after the claim.
1325
- "**Monthly, and automerged for _patches_.**",
1326
- "**_Majors_ wait; the rest are automerged.**",
1327
- ]) {
1328
- assert.doesNotMatch(text, UNSCOPED_AUTOMERGED_SPAN, text);
1329
- }
1330
- for (const text of [
1331
- "For _patch_ bumps, bounding drift at about one month.\n",
1332
- "Bounding drift at about one month for minors and patches.\n",
1333
- "Majors aside, bounding drift at about one month.\n",
1334
- "Bounding drift at about one month for _patches_.\n",
1335
- "_Minors_ aside, bounding drift at about one month.\n",
1336
- ]) {
1337
- assert.doesNotMatch(text, UNSCOPED_DRIFT_SENTENCE, text);
1338
- }
1339
- });
1340
-
1341
- // Pins #1988's accepted plain-English hole, not a bug: a whole word cannot
1342
- // tell the verb "patches" or "patch", or the adjective "minor" or "major",
1343
- // from the update type, so each still scopes its claim. A change that closes
1344
- // the hole should fail here; one that widens it instead fails #1958's "a word
1345
- // that only contains…" test above, since that is the row already pinning
1346
- // which inflected forms of "patch" scope nothing. Either way, update
1347
- // UPDATE_TYPE's comment with it (#1989).
1348
- test("minor, patch or major in its plain-English sense still scopes all three claims, as documented (#1989)", () => {
1349
- for (const text of [
1350
- "**Renovate patches the automerged bumps.**",
1351
- "**We patch monthly, and the bumps are automerged.**",
1352
- ]) {
1353
- assert.doesNotMatch(text, UNSCOPED_AUTOMERGED_SPAN, text);
1354
- }
1355
- for (const text of [
1356
- "Renovate patches each dependency, bounding drift at about one month.\n",
1357
- "At minor cost, bounding drift at about one month.\n",
1358
- ]) {
1359
- assert.doesNotMatch(text, UNSCOPED_DRIFT_SENTENCE, text);
1360
- }
1361
- for (const text of [
1362
- "# Renovate patches the lockfile, and the bump merges once CI goes green.\n",
1363
- "# A major benefit: the bump merges once CI goes green.\n",
1364
- ]) {
1365
- assert.doesNotMatch(text, UNSCOPED_MERGE_SENTENCE, text);
1366
- }
1367
- });
1368
-
1369
- test("a merge-on-checks sentence naming no update type is refused, across the gutter and in either word order (#1978)", () => {
1370
- for (const text of [
1371
- // pin-drift.sh's bound argument as it read before #1978.
1372
- [
1373
- "# monthly. The longest healthy gap runs from a bump PR opened as one window",
1374
- "# opens on the 1st to the next one opened as its window closes at the end of",
1375
- "# the 3rd — up to 34 days across a 31-day month, and a hosted run that comes",
1376
- "# late inside the window is already inside that figure — plus however long",
1377
- "# that last PR's checks take to go green, since the merge waits on them, not",
1378
- "# on the window. 35 days leaves about a day for those checks.",
1379
- ].join("\n"),
1380
- "# The bump automerges once CI goes green.\n",
1381
- "# Once the checks pass, the bump PR merges itself.\n",
1382
- // UPDATE_TYPE's word boundary, not a bare substring test: "dispatch" and
1383
- // "majority" contain no whole minor/patch/major token (#1958).
1384
- "# The bump merges once CI goes green, as a workflow_dispatch run shows.\n",
1385
- "# The bump merges once CI goes green, in the majority of months.\n",
1386
- // The ceiling: the next sentence's scope does not reach back.
1387
- "# Its merge waits on the checks, not the window. A major waits on a human too.\n",
1388
- ]) {
1389
- assert.match(text, UNSCOPED_MERGE_SENTENCE, text);
1390
- }
1391
- });
1392
-
1393
- test("a merge-on-checks sentence naming its scope passes, as does a sentence with only one of merge and checks (#1978)", () => {
1394
- for (const text of [
1395
- [
1396
- "# that last PR's checks take to go green, since a minor or patch bump is",
1397
- "# automerged and its merge waits on them, not on the window.",
1398
- ].join("\n"),
1399
- "# A major's merge waits on a human as well as its checks.\n",
1400
- // pin-drift.sh's own neighbours: a merge commit with no checks, and
1401
- // checks with no merge — neither says what a bump's merge waits on.
1402
- "# `--first-parent` dates the move by when it LANDED on the branch (the merge\n# commit), not by when the bot authored it: a bump PR that sat red for a week\n# has not moved the pin for that week.\n",
1403
- "# 35 days leaves about a day for those checks; a bump PR that goes red and\n# stays red longer than that trips it in such a month.\n",
1404
- // The unrelated business sense of "merger" starts with the same four
1405
- // letters as "merge" — a bare `\b(?:auto-?)?merg` would trip here too,
1406
- // since a word boundary sits before "merg" in "merger" as well (review
1407
- // finding, PR #1990). Bounding the trigger to a real verb form excludes it.
1408
- "# The merger of the checks team and CI team went smoothly and green-lit.\n",
1409
- ]) {
1410
- assert.doesNotMatch(text, UNSCOPED_MERGE_SENTENCE, text);
1411
- }
1412
- });
1413
-
1414
- test("the merge trigger only fires on a real merge verb, not a word that merely starts with it (#1990)", () => {
1415
- // "merger" (an unrelated business sense) starts with the same four letters
1416
- // as "merge" — a bare `\bmerg` trigger with no closing boundary would trip
1417
- // beside "checks"/"CI"/"green" here too, since a word boundary sits before
1418
- // "merg" in "merger" as well.
1419
- assert.doesNotMatch(
1420
- "# The merger of the checks team and CI team went smoothly and green-lit.\n",
1421
- UNSCOPED_MERGE_SENTENCE,
1422
- );
1423
- });
1424
- test("a drift sentence scoped across an abbreviation passes — its period ends no sentence (#1959)", () => {
1425
- for (const text of [
1426
- // The case #1959 was filed on: the scope before "e.g.", the claim after.
1427
- "For a minor bump, e.g. 26.6, that keeps one PR while bounding drift at a month.\n",
1428
- // And the scope after it, the claim before.
1429
- "Bounding drift at about one month, i.e. for minor and patch bumps.\n",
1430
- "For minor bumps (cf. the Status line) bounding drift at about one month.\n",
1431
- "For patch bumps, viz. 26.5.x, bounding drift at about one month.\n",
1432
- "For a minor bump (a small vs. a big change) bounding drift at about one month.\n",
1433
- // Closing markup after the abbreviation, as after any other terminator.
1434
- "For minor bumps (e.g.) bounding drift at about one month.\n",
1435
- "For minor bumps, **e.g.** 26.6, bounding drift at about one month.\n",
1436
- // `_` is a word character, so a `\b` before the abbreviation would miss
1437
- // an italic one, as #1958 found for an italic `_patch_`.
1438
- "For minor bumps, _e.g._ 26.6, bounding drift at about one month.\n",
1439
- ]) {
1440
- assert.doesNotMatch(text, UNSCOPED_DRIFT_SENTENCE, text);
1441
- }
1442
- });
1443
-
1444
- test("a period after \"etc.\", or after a word only ending in an abbreviation's letters, still ends the sentence (#1959)", () => {
1445
- for (const text of [
1446
- // "etc." ends a sentence as often as not, so it is off the list: skipping
1447
- // it would lend this claim the scope of the sentence before it.
1448
- "Minor and patch bumps, the lockfile, etc. Bounding drift at about one month.\n",
1449
- // "devs." is not "vs.".
1450
- "Minor and patch bumps are for the devs. Bounding drift at about one month.\n",
1451
- // A digit disqualifies it exactly as a letter does (review finding, PR
1452
- // #1993): narrowing the boundary to `(?<![a-z])` alone still passes every
1453
- // other case here, so nothing else in this file pins the digit half.
1454
- "Minor bumps land in 26vs. Bounding drift at about one month.\n",
1455
- ]) {
1456
- assert.match(text, UNSCOPED_DRIFT_SENTENCE, text);
1457
- }
1458
- });
1459
-
1460
- test("a period after a capitalized abbreviation lookalike still ends the sentence, in both rows (#2021)", () => {
1461
- // "Vs." is not "vs.": the rows match case-insensitively, and the list used
1462
- // to fold with them, so a proper noun ending a sentence was read as the
1463
- // abbreviation and the sentence before lent the claim its scope — the
1464
- // silent direction. sentences() matches the list lowercase only (#1899).
1465
- for (const word of ["Vs.", "VS.", "E.g.", "I.e.", "Cf.", "Viz."]) {
1466
- assert.match(`Minor and patch bumps are for the ${word} Bounding drift at about one month.\n`, UNSCOPED_DRIFT_SENTENCE, word);
1467
- assert.match(`# Minor and patch bumps are for the ${word} The bump merges once CI goes green.\n`, UNSCOPED_MERGE_SENTENCE, word);
1468
- }
1469
- // The accept side, in the same fixture shape: lowercase stays one sentence.
1470
- for (const abbr of ["vs.", "e.g.", "i.e.", "cf.", "viz."]) {
1471
- assert.doesNotMatch(`Minor and patch bumps are for the ${abbr} Bounding drift at about one month.\n`, UNSCOPED_DRIFT_SENTENCE, abbr);
1472
- assert.doesNotMatch(`# Minor and patch bumps are for the ${abbr} The bump merges once CI goes green.\n`, UNSCOPED_MERGE_SENTENCE, abbr);
1473
- }
1474
- // Only the list itself stopped folding: the letter-or-digit guard before it
1475
- // still reads a capital — by folding until #2043, by spelling both cases
1476
- // since — so a capital glued to a lowercase abbreviation disqualifies it
1477
- // just as "devs." does, and the sentence ends. Both ends of the list.
1478
- for (const word of ["Ee.g.", "DEvs."]) {
1479
- assert.match(`Minor and patch bumps are for the ${word} Bounding drift at about one month.\n`, UNSCOPED_DRIFT_SENTENCE, word);
1480
- }
1481
- });
1482
-
1483
- test("a capitalized abbreviation mid-sentence ends the sentence too — the cost of matching lowercase only (#2021)", () => {
1484
- // Loud here: the scope before the parenthetical drops out of the claim's
1485
- // sentence, and a scoped drift sentence is refused. No file's prose spells
1486
- // one capitalized; the pin is here so a change to the list meets it.
1487
- assert.match("For minor bumps (Cf. the Status line) bounding drift at about one month.\n", UNSCOPED_DRIFT_SENTENCE);
1488
- });
1489
-
1490
- // #2043: windowReleaseCountFault split on SENTENCE_END compiled with no flag,
1491
- // unlike both rows, so every case-sensitive piece of it read differently
1492
- // there: the letter-or-digit guard missed a capital, and a closing tag or
1493
- // block tag spelled in capitals ended nothing. Each fixture below is two
1494
- // sentences, the count in the first and the window in the second, so a
1495
- // missed end joins them and the count reads as the window's own — the loud
1496
- // direction.
1497
- test("windowReleaseCountFault ends a sentence wherever both rows do, capitals included (#2043)", () => {
1498
- for (const text of [
1499
- // The cases #2043 was filed on: a capital glued to the abbreviation.
1500
- "Node shipped 8 releases for the Xvs. The pin sat 43 days.",
1501
- "Node shipped 8 releases for the Ee.g. The pin sat 43 days.",
1502
- "Node shipped 8 releases for the DEvs. The pin sat 43 days.",
1503
- // The same flag, on tag names: a closing tag and an HTML block in capitals.
1504
- "Node shipped **8 releases.</B> The pin sat 43 days.",
1505
- "Node shipped 8 releases\n<DIV>\nThe pin sat 43 days.",
1506
- ]) {
1507
- assert.equal(windowReleaseCountFault(text), null, text);
1508
- }
1509
- // The refuse side, in the same fixture shape: the abbreviation itself, and
1510
- // a tag that opens no block, join the two into one sentence.
1511
- for (const text of [
1512
- "Node shipped 8 releases for the vs. The pin sat 43 days.",
1513
- "Node shipped 8 releases for the e.g. The pin sat 43 days.",
1514
- "Node shipped 8 releases\n<SPAN>\nThe pin sat 43 days.",
1515
- ]) {
1516
- assert.match(windowReleaseCountFault(text), /counts 8 releases in the 43 days/, text);
1517
- }
1518
- });
1519
-
1520
- test("SENTENCE_END's abbreviation guard reads a capital the same with or without `i` (#2043)", () => {
1521
- // The guard names both cases itself, so no consumer's flag decides whether
1522
- // "DEvs." is "vs.".
1523
- for (const flags of ["", "i"]) {
1524
- for (const word of ["Xvs.", "Ee.g.", "DEvs."]) {
1525
- assert.deepEqual(`for the ${word} Next`.split(new RegExp(SENTENCE_END, flags)), [`for the ${word.slice(0, -1)}`, "Next"], `${word} /${flags}`);
1526
- }
1527
- assert.deepEqual("for the vs. Next".split(new RegExp(SENTENCE_END, flags)), ["for the vs. Next"], `vs. /${flags}`);
1528
- }
1529
- });
1530
-
1531
- // #2027: sentences() (prose-pin.mjs) ends a sentence behind a bare footnote
1532
- // marker since #1987, and SENTENCE_END took only the caret form `[^1]`, so
1533
- // the two read `only.[1] Next` differently. Each shape below is checked with
1534
- // and without `i`, since SENTENCE_END is spliced into patterns of both kinds.
1535
- test("SENTENCE_END ends a sentence behind a bare footnote marker, as sentences() does, and still behind `[^1]` (#2027)", () => {
1536
- for (const flags of ["", "i"]) {
1537
- const split = (text) => text.split(new RegExp(SENTENCE_END, flags));
1538
- // The ticket's repro, and the caret form beside it.
1539
- assert.deepEqual(split("Bounding drift, only.[1] Elsewhere more."), ["Bounding drift, only", "Elsewhere more."], `[1] /${flags}`);
1540
- assert.deepEqual(split("Bounding drift, only.[^1] Elsewhere more."), ["Bounding drift, only", "Elsewhere more."], `[^1] /${flags}`);
1541
- // Whatever closes before the terminator: a word, a non-ASCII letter, a
1542
- // digit, a code span, a paren, a curly quote. Any terminator, a named
1543
- // marker, a run of markers, closing markup after.
1544
- for (const [text, first] of [
1545
- ["a café.[1] Next", "a café"],
1546
- // A capital, which the guard names itself, as #2043's does.
1547
- ["ran on CI.[1] Next", "ran on CI"],
1548
- ["only 26.[1] Next", "only 26"],
1549
- ["run `jq`.[1] Next", "run `jq`"],
1550
- ["(see above).[1] Next", "(see above)"],
1551
- ["said \u201cstop\u201d.[1] Next", "said \u201cstop\u201d"],
1552
- ["it said \u2018stop\u2019.[1] Next", "it said \u2018stop\u2019"],
1553
- ["done?[note] Next", "done"],
1554
- ["done![1] Next", "done"],
1555
- ["only.[1][2] Next", "only"],
1556
- ["**only.[1]** Next", "**only"],
1557
- // The caret form behind a closer the bare marker's guard refuses: it
1558
- // stays closing markup, as #2002 left it.
1559
- ["**only**.[^1] Next", "**only**"],
1560
- ]) {
1561
- assert.deepEqual(split(text), [first, "Next"], `${text} /${flags}`);
1562
- }
1563
- }
1564
- });
1565
-
1566
- test("SENTENCE_END ends nothing at a jq, JavaScript or glob index quoted after a period (#2027)", () => {
1567
- // The code shapes #1987 measured a bare `\[[^\]]*\]` splitting: behind a
1568
- // quote, a `?`, a `*`, or behind a word with an empty or comma-spaced
1569
- // bracket.
1570
- for (const flags of ["", "i"]) {
1571
- for (const text of [
1572
- "jq '.[] | select(.x)' here",
1573
- "const n = m?.[1] || fallback;",
1574
- "ls *.[0-9]*' now",
1575
- "jq '.jobs.[] | .x'",
1576
- "jq '.jobs.[0, 1] | .x'",
1577
- // The guard refuses `*` on its own, not only via the caret form
1578
- // (#2002) or by riding along on the unrelated glob fixture above.
1579
- "**only**.[1] Next",
1580
- // An abbreviation's period is no terminator, marker or not.
1581
- "e.g.[1] Next",
1582
- ]) {
1583
- assert.deepEqual(text.split(new RegExp(SENTENCE_END, flags)), [text], `${text} /${flags}`);
1584
- }
1585
- }
1586
- });
1587
-
1588
- // #2063. `][^1]` read two ways under CLOSING_MARKUP — one `][ref]` closer, or
1589
- // a bare `]` then a `[^1]` footnote — so a chain of n of them had 2^n
1590
- // readings, and SENTENCE_END walked every one before giving up on a chain
1591
- // with no whitespace after it. At this n the chain took half a second to
1592
- // several seconds, doubling with every link; unambiguous, it takes well under
1593
- // a millisecond, so the budget only catches a return to the blow-up, not a
1594
- // slow machine.
1595
- test("SENTENCE_END stays fast on a closer chain that once read two ways (#2063)", () => {
1596
- const text = "x." + "][^a]".repeat(25) + "z";
1597
- for (const flags of ["", "i"]) {
1598
- const start = performance.now();
1599
- const parts = text.split(new RegExp(SENTENCE_END, flags));
1600
- const ms = performance.now() - start;
1601
- assert.deepEqual(parts, [text], `/${flags}`);
1602
- assert.ok(ms < 100, `${ms.toFixed(0)}ms /${flags}`);
1603
- }
1604
- });
1605
-
1606
- // The fix drops only the `][ref]` reading that `]` plus `[^1]` already
1607
- // covers, so every closer run ends the same sentences as before. A `][^…]`
1608
- // label that `[^1]` cannot read — empty, or holding a space — is still one
1609
- // `][ref]` closer; a fix that refused every `][^` would lose those two.
1610
- test("SENTENCE_END ends the same sentences behind a `][^…]` closer as before #2063", () => {
1611
- for (const flags of ["", "i"]) {
1612
- const split = (text) => text.split(new RegExp(SENTENCE_END, flags));
1613
- for (const closer of ["][^1]", "][^1]][^2]", "][^a b]", "][^]", "][^vs.]"]) {
1614
- assert.deepEqual(split(`It shipped.${closer} Next`), ["It shipped", "Next"], `${closer} /${flags}`);
1615
- assert.deepEqual(split(`per vs.${closer} next`), [`per vs.${closer} next`], `${closer} /${flags}`);
1616
- }
1617
- }
1618
- });
1619
-
1620
- test("both rows and the window count read a bare footnote marker as a sentence end (#2027)", () => {
1621
- // The next sentence's scope no longer reaches back across the marker.
1622
- for (const text of [
1623
- "Minor and patch bumps only.[1] Bounding drift at about one month.\n",
1624
- "Minor and patch bumps only.[note] Bounding drift at about one month.\n",
1625
- "Minor and patch bumps only.[^1] Bounding drift at about one month.\n",
1626
- ]) {
1627
- assert.match(text, UNSCOPED_DRIFT_SENTENCE, text);
1628
- }
1629
- // Only the simplest marker (`.[1]`, letter-preceded) reached
1630
- // UNSCOPED_MERGE_SENTENCE and windowReleaseCountFault below, once each —
1631
- // a consumer that quietly stopped splicing the current SENTENCE_END, or
1632
- // carried its own narrower guard, would still pass those two single rows
1633
- // and only red the direct-split test above. Every marker shape, and a
1634
- // backtick- or paren-preceded terminator, through both consumers here too.
1635
- for (const text of [
1636
- "# Minor and patch bumps only.[1] The bump merges once CI goes green.\n",
1637
- "# Minor and patch bumps only.[note] The bump merges once CI goes green.\n",
1638
- "# Minor and patch bumps only.[1][2] The bump merges once CI goes green.\n",
1639
- "# Minor and patch bumps `only`.[1] The bump merges once CI goes green.\n",
1640
- ]) {
1641
- assert.match(text, UNSCOPED_MERGE_SENTENCE, text);
1642
- }
1643
- // The count in the first sentence, the window in the second.
1644
- for (const text of [
1645
- "Node shipped 8 releases.[1] The pin sat 43 days.",
1646
- "Node shipped 8 releases.[note] The pin sat 43 days.",
1647
- "Node shipped 8 releases.[1][2] The pin sat 43 days.",
1648
- "Node shipped 8 releases (confirmed).[1] The pin sat 43 days.",
1649
- ]) {
1650
- assert.equal(windowReleaseCountFault(text), null, text);
1651
- }
1652
- // The accept side: a scoped sentence quoting a jq index wraps past it.
1653
- assert.doesNotMatch("For minor and patch bumps, jq '.[] | .x' keeps bounding drift at about one month.\n", UNSCOPED_DRIFT_SENTENCE);
1654
- assert.doesNotMatch("For minor and patch bumps, `m?.[1] || x` keeps bounding drift at about one month.\n", UNSCOPED_DRIFT_SENTENCE);
1655
- });
1656
-
1657
- // #2431. The `review-pr-*.test.mjs` suite was deleted (ed9f2967) and its
1658
- // surviving pins moved to `review-core-*`; the citations that kept naming the old files were
1659
- // retargeted by hand. A citation of a file that is gone is only legitimate as a
1660
- // git-object path — `<sha>^:plugin/scripts/<name>` or `<sha>:plugin/scripts/<name>`
1661
- // — which names the revision it is read at.
1662
- const DELETED_TEST_CITATION = /(?<![0-9a-f]{7,40}\^?:\s?plugin\/scripts\/)(?<![\w-])review-pr-[a-z0-9-]+\.test\.mjs/g;
1663
- const deletedTestCitations = (text) => [...normalize(text).matchAll(DELETED_TEST_CITATION)].map((m) => m[0]);
1664
-
1665
- function* pluginFiles(dir) {
1666
- for (const entry of readdirSync(dir, { withFileTypes: true })) {
1667
- if (entry.name === "node_modules") continue;
1668
- const full = join(dir, entry.name);
1669
- if (entry.isDirectory()) yield* pluginFiles(full);
1670
- else yield full;
1671
- }
1672
- }
1673
-
1674
- test("no file under plugin/ cites a deleted review-pr-*.test.mjs without a git-object path (#2431)", () => {
1675
- for (const file of pluginFiles(REPO)) {
1676
- if (file === import.meta.filename) continue;
1677
- assert.deepEqual(deletedTestCitations(readFileSync(file, "utf8")), [], `${file} cites a review-pr-*.test.mjs file that no longer exists — name its review-core-* successor, or a pinned revision such as \`ed9f2967^:plugin/scripts/<name>\``);
1678
- }
1679
- });
1680
-
1681
- test("the plugin walk reads extensionless scripts and skips node_modules (#2431)", () => {
1682
- const dir = mkdtempSync(join(tmpdir(), "plugin-walk-"));
1683
- try {
1684
- mkdirSync(join(dir, "sub"));
1685
- mkdirSync(join(dir, "node_modules"));
1686
- writeFileSync(join(dir, "fleet-run"), "// see review-pr-reads.test.mjs\n");
1687
- writeFileSync(join(dir, "sub", "board.html"), "<!-- review-pr-reads.test.mjs -->\n");
1688
- writeFileSync(join(dir, "node_modules", "dep.mjs"), "// review-pr-reads.test.mjs\n");
1689
- assert.deepEqual([...pluginFiles(dir)].map((f) => f.slice(dir.length + 1)).sort(), ["fleet-run", join("sub", "board.html")]);
1690
- } finally {
1691
- rmSync(dir, { recursive: true, force: true });
1692
- }
1693
- });
1694
-
1695
- test("the deleted-test citation ban accepts git-object paths and review-core-* names", () => {
1696
- for (const text of [
1697
- "// `ed9f2967^:plugin/scripts/review-pr-inbound-citation-prose.test.mjs` asserted",
1698
- "// f743264:plugin/scripts/review-pr-reads.test.mjs | grep -A2",
1699
- "// in `ed9f2967^:plugin/scripts/review-pr-citation-prose.test.mjs` looked like",
1700
- "// `ed9f2967^:\n// plugin/scripts/review-pr-x.test.mjs` wrapped after the colon",
1701
- "// review-core-snapshot-path.test.mjs's guard-ordering pin.",
1702
- "// prefix-review-pr-x.test.mjs is a different file",
1703
- ]) assert.deepEqual(deletedTestCitations(text), [], text);
1704
- for (const text of [
1705
- "// review-pr-snapshot-path.test.mjs's guard-ordering pin.",
1706
- "// `review-pr-citation-prose.test.mjs`, one",
1707
- "// plugin/scripts/review-pr-reads.test.mjs",
1708
- "// abc^:review-pr-reads.test.mjs",
1709
- "// abc123^:plugin/scripts/review-pr-x.test.mjs",
1710
- "// review-pr-2nd-pass.test.mjs",
1711
- ]) assert.equal(deletedTestCitations(text).length, 1, text);
1712
- });