@feigi/fleet-ctl 3.23.35 → 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,60 +0,0 @@
1
- // #1804's Pull table (ADR 0013 Decision 2 and 4) states, for each verdict a
2
- // Pull can reach, the one action that verdict takes — and for the three
3
- // relabel rows, which of the two relabel-by-cause labels applies. Nothing
4
- // tied a cause to its label: confirmed live, swapping `needs-triage` <->
5
- // `ready-for-human` on the "brief names no *what*" row left every run-team
6
- // prose test green, because no test read the table's own text at all.
7
- //
8
- // WHAT IS PINNED. The three relabel rows, each as one bounded phrase running
9
- // cause through label through "next entry" — so a swap on any one row, in
10
- // either direction, breaks its own row's pin and no other row's. Everything
11
- // else the table states (the drop rows, the close row, the exclude rows, the
12
- // taken row, the dispatch row) is out of scope for this file; a future file
13
- // can add them the same way if they start drifting.
14
- //
15
- // THE SLICE ANCHOR IS WHAT ANCHORS. `pullTable()` bounds the table between its
16
- // own opening sentence and the paragraph that follows it, never the whole
17
- // document — a positive match over `RUN_TEAM` wholesale would be satisfiable
18
- // from the "Relabel by cause" paragraph, which restates the
19
- // same two labels in prose and would launder a table-row swap as a pass.
20
- //
21
- // MUTATION-TESTED. Swapping the label on the "brief names no *what*" row (the
22
- // exploit three independent refuters used against #1804) reds this file's
23
- // first assertion and no other; verified live before writing this file.
24
- import { test } from "node:test";
25
- import assert from "node:assert/strict";
26
- import { readFileSync } from "node:fs";
27
- import { join } from "node:path";
28
- import { between, phrase } from "./prose-pin.mjs";
29
-
30
- const REPO = join(import.meta.dirname, "..");
31
- const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
32
-
33
- const pullTable = () =>
34
- between(
35
- RUN_TEAM,
36
- "**The Pull table**",
37
- "**The shortlist runs out",
38
- "run-team/SKILL.md Pull table",
39
- );
40
-
41
- test("run-team/SKILL.md: the Pull table ties each relabel cause to its own label", () => {
42
- const table = pullTable();
43
- assert.match(
44
- table,
45
- phrase("| brief names no *what* | relabel `needs-triage`, next entry |"),
46
- "a brief that names no *what* no longer relabels to `needs-triage` in the Pull table",
47
- );
48
- assert.match(
49
- table,
50
- phrase("| genuine fork — options named, none ruled | relabel `ready-for-human`, next entry |"),
51
- "a genuine fork no longer relabels to `ready-for-human` in the Pull table",
52
- );
53
- assert.match(
54
- table,
55
- phrase(
56
- "| needs human hands — external access, manual testing, judgment during the work | relabel `ready-for-human`, next entry |",
57
- ),
58
- "needing human hands no longer relabels to `ready-for-human` in the Pull table",
59
- );
60
- });
@@ -1,222 +0,0 @@
1
- // #677. `run-team/SKILL.md` stated what `--quiet` drops twice, and only one of
2
- // the two was complete: the CI-Monitor paragraph named `jobs` and `missing`,
3
- // the finisher-duty paragraph named `jobs` alone. The incomplete copy is the
4
- // one that costs — it is the paragraph an agent reads when deciding whether it
5
- // holds the per-job state a `ready-to-merge` label rests on, and `missing` is
6
- // exactly the field separating "the expected job is absent" from "the expected
7
- // job failed". `review-and-fix.md`'s twin of that same gate was complete
8
- // throughout, so the outlier was visible only to a reader holding all three
9
- // paragraphs open at once. That is what this file is for.
10
- //
11
- // #701. That sentence used to state the gap between those two paragraphs as a
12
- // line count. Nothing pinned it, and it drifted on SKILL.md edits between the
13
- // two anchors that touched neither this file nor ci-state.mjs: written 345, it
14
- // measured 353 when #701 was filed and 375 when #701 was fixed. A fresh number
15
- // would rot the same way, so the paragraphs are named rather than located. Do
16
- // not restore one.
17
- //
18
- // THE FIELD LIST IS READ OUT OF ci-state.mjs, never restated here. `--quiet`'s
19
- // effect on the payload is one assignment, and a field added to or renamed in
20
- // it silently un-completes all four sites at once. Deriving the list means that
21
- // edit reddens here instead, which is the only way the four stay agreed with the
22
- // source rather than merely with each other.
23
- //
24
- // TWO BOUNDS, each measured against the mutation it exists to catch, in the
25
- // manner of `staleness-qualifier-prose.test.mjs`:
26
- //
27
- // - The PARAGRAPH bound. SKILL.md carries two of the four statements, so
28
- // matched over the whole file each is the other's false green: measured, with
29
- // the finisher-duty clause gutted a file-wide variant went green off the
30
- // CI-Monitor copy alone, and stayed green with a decoy line appended too.
31
- // - The CLAUSE bound: the `--quiet` sentence, from its `drops` to that
32
- // sentence's end. Two mutations shape it, one at each edge. Widening it to the
33
- // paragraph: the finisher-duty paragraph names `jobs` a second time for an
34
- // unrelated reason ("or its `jobs`"), so a paragraph-wide match is satisfiable
35
- // from outside the statement — measured, with the clause narrowed to `missing`
36
- // alone a paragraph-wide variant went green while this file went red. That
37
- // same reason is why the clause STARTS at `drops`: the `--quiet` anchoring it
38
- // is matched, never captured, since capturing it drags the preamble back in.
39
- // Narrowing it to the first `drops` in the paragraph: any earlier `drops`
40
- // sentence about some other effect then satisfies the pin instead, and the
41
- // stderr stream `--quiet` also suppresses is exactly such a sentence, already
42
- // written in this shape in ci-state.mjs's own header — measured, with a decoy
43
- // stderr sentence inserted ahead of a gutted statement, a first-match variant
44
- // went green on the pre-#677 text verbatim while this file went red.
45
- //
46
- // A moved anchor reddens instead of silently widening the slice back to the file.
47
- //
48
- // #690 added the fourth site, the only one in source rather than in a document:
49
- // ci-state.mjs's own header, far above the assignment it describes. It is sliced
50
- // the other way round from the three document sites, and #695 is why. #690 gave
51
- // it a document-shaped slice — anchor on a phrase of the statement, cut forward
52
- // to the next blank line — and BOTH bounds were wrong in source:
53
- //
54
- // - The END bound. A blank line ends a markdown paragraph; a comment block ends
55
- // at its first non-`//` line, well before that. The slice ran on into live
56
- // code, so with the header statement gutted, one decoy sentence naming both
57
- // fields — pasted anywhere from `const quiet = has("quiet");` down to the
58
- // blank line under the `vlog` block — took the whole suite GREEN (measured;
59
- // the same decoy past that blank line stays red).
60
- // - The START bound. A document site anchors on a heading OUTSIDE the sentence
61
- // it pins; in source the pinned sentence opens the block, so a phrase anchor
62
- // sits INSIDE what it pins and every edit to it reads as a moved anchor.
63
- // Measured: rewrapping the header at 36 cols — content byte-identical, both
64
- // fields still named — reported "slice anchor moved", and so did dropping
65
- // `missing` while rewording "suppresses", which named the wrong fault and hid
66
- // a real defect behind an instruction to edit this test.
67
- //
68
- // So this site anchors on the DECLARATION the header documents and takes the
69
- // `//` block above it. Both bounds are code, the anchor moves only when the code
70
- // does, and the pin covers exactly the comment. What the site still owes the
71
- // clause bound is the BACKTICKED `--quiet`: bare, as the header read before
72
- // #690, the slice is right and the clause is what fails, reporting an unpinned
73
- // site (measured in both spellings).
74
- //
75
- // This file names its four sources by path and globs nothing, so its own text
76
- // is not in the corpus and cannot satisfy the pins it carries.
77
- //
78
- // THE CEILING: this pins that each paragraph names every dropped field, and
79
- // nothing else — not that the surrounding rule is right, not the prose around
80
- // the clause, and it does not run ci-state.mjs (ci-state.test.mjs owns its
81
- // behavior). It says nothing about the stderr stream `--quiet` also suppresses:
82
- // a separate effect, and where a site states it — ci-state.mjs's header states
83
- // it in the same sentence, ahead of the `drops` — the clause bound starts at
84
- // `drops` and leaves it outside the pin. And it covers four sites, not every
85
- // statement in the repo: the script-surface row in
86
- // `docs/specs/2026-07-23-fleet-plugin-design.md` names every dropped field
87
- // today and is left to the pattern its siblings already use —
88
- // `worktree-audit.test.mjs` and `no-undo-audit.test.mjs` each check their
89
- // script's Out cell against a real run of that script, which for ci-state.mjs
90
- // means standing up `gh` fixtures and is not the cheap check this one is.
91
- //
92
- // Reflow-safe by construction: `phrase()` joins the anchor's words on `\s+`, so
93
- // SKILL.md (hard-wrapped ~80 cols) and review-and-fix.md (one long line per
94
- // numbered step) take the identical anchor. Measured: the finisher-duty
95
- // paragraph rewrapped at 55 cols stays green. `\s+` does NOT cross the `// ` a
96
- // wrapped comment inserts, which is the other half of why the source site
97
- // anchors on a one-line declaration instead: measured, the header rewrapped at
98
- // 36 cols is green on the code anchor and reported a moved anchor on #690's
99
- // phrase anchor, in the same run where all three document sites stayed green.
100
-
101
- import { test } from "node:test";
102
- import assert from "node:assert/strict";
103
- import { readFileSync } from "node:fs";
104
- import { join } from "node:path";
105
- import { paragraph, runAbove, sentences } from "./prose-pin.mjs";
106
-
107
- const REPO = join(import.meta.dirname, "..");
108
- const read = (p) => readFileSync(join(REPO, ...p.split("/")), "utf8");
109
-
110
- const CI_STATE_PATH = "scripts/ci-state.mjs";
111
- const SKILL = "skills/run-team/SKILL.md";
112
- const REVIEW_AND_FIX = "commands/review-and-fix.md";
113
-
114
- // The one assignment `--quiet` gates the payload on — now also gated on
115
- // `!noCi` (#927: the no-ci arm never binds a run, so it drops `jobs`/`missing`
116
- // unconditionally, the same way `emitRateLimited()` already does; `--quiet`'s
117
- // own effect, which is what this file pins, is unchanged by that addition).
118
- // The derivation's absence is a failure rather than an empty field list: an
119
- // empty list would pass every site vacuously. Measured (#695): rewrite that
120
- // assignment and the guard below is the one red while all four sites go green
121
- // on zero assertions — so the guard is where a broken derivation is
122
- // diagnosed, and the sites are left saying nothing rather than each
123
- // repeating it.
124
- const CI_STATE = read(CI_STATE_PATH);
125
- const FIELDS = ((CI_STATE.match(/if \(!quiet && !noCi\) Object\.assign\(payload, \{([^}]*)\}\)/) ?? [])[1] ?? "")
126
- .split(",").map((f) => f.trim()).filter(Boolean);
127
-
128
- test("the dropped-field list is still readable out of ci-state.mjs", () => {
129
- assert.ok(
130
- FIELDS.length,
131
- "ci-state.mjs no longer gates payload fields through `if (!quiet && !noCi) Object.assign(payload, { ... })` — re-derive FIELDS here from whatever replaced it, never hard-code the list",
132
- );
133
- });
134
-
135
- // The paragraph carrying the statement, and no more of the file than that. A
136
- // missing anchor is a failure rather than a wider slice: silently falling back
137
- // to the whole document is the false green this bound exists to prevent.
138
- //
139
- // The shared bound, not a local copy of it (#1372). What it closes that a local
140
- // copy could not: a blank line carrying whitespace, which a literal `\n\n`
141
- // search runs straight past into the next paragraph, and an anchor occurring
142
- // more than once, which binds the pin to whichever copy of the anchored block
143
- // comes first. What it does NOT close is a blank line deleted outright — the
144
- // paragraphs then merge and the slice takes both, a hole that predates this
145
- // bound and is open still (#1377).
146
- //
147
- // The source site takes the other bound and so cannot use `paragraph`: in source
148
- // the anchor is the declaration BELOW the block, and the slice is the run of
149
- // `//` lines above it — code at both ends, so no edit to the prose it holds can
150
- // move either bound, where a blank-line bound would run past the end of the
151
- // comment into that code (the false green measured in #695).
152
- //
153
- // That bound is `runAbove`, shared (#1604) rather than hand-rolled here, so the
154
- // uniqueness half comes WITH it — `anchorAt` under the same roof — instead of
155
- // being copied for the sake of an end bound that differs.
156
- function siteSlice(name, anchor) {
157
- const text = read(name);
158
- if (!name.endsWith(".mjs")) return paragraph(text, anchor, name);
159
- return runAbove(text, anchor, name, "//");
160
- }
161
-
162
- // The `--quiet` sentence, from its `drops` to the end of that sentence. The
163
- // surrounding paragraphs each mention at least one dropped field for other
164
- // reasons, so the clause bound is what makes a gutted statement red rather than
165
- // green on its neighbours — and the `--quiet` prefix is what keeps this the
166
- // sentence ABOUT the flag rather than whichever sentence says `drops` first.
167
- // It is matched and discarded, not captured: a clause starting at `--quiet`
168
- // would swallow the preamble the bound exists to exclude.
169
- //
170
- // The sentence is `sentences()`'s, never a first-period `[^.]*` window
171
- // (#1940). That window ran on past a `?` or `!`, so a statement naming one
172
- // field borrowed the other from the sentence after it — the incomplete copy
173
- // this file exists to catch, passing — and it stopped at a period no sentence
174
- // ends on (`ci-state.mjs`, "e.g."), reddening a complete one. Returns null when
175
- // no sentence in the slice has a `--quiet` followed by `drops`.
176
- export function quietClause(slice) {
177
- for (const sentence of sentences(slice)) {
178
- const clause = /`--quiet`[\s\S]*?(drops[\s\S]*)/.exec(sentence);
179
- if (clause) return clause[1];
180
- }
181
- return null;
182
- }
183
-
184
- function dropsClause(name, anchor) {
185
- const clause = quietClause(siteSlice(name, anchor));
186
- assert.ok(clause, `${name}: the "${anchor}" paragraph no longer has a \`--quiet\` sentence saying what it drops`);
187
- return clause;
188
- }
189
-
190
- const SITES = [
191
- [SKILL, "**Own the CI waits.**", "the CI-Monitor read"],
192
- [SKILL, "Gate on the `check` job", "the finisher-duty read"],
193
- [REVIEW_AND_FIX, "6. Diff-check green", "step 6's finisher read"],
194
- [CI_STATE_PATH, `const quiet = has("quiet");`, "the source-comment read"],
195
- ];
196
-
197
- for (const [name, anchor, label] of SITES) {
198
- test(`${name} — ${label} names every field \`--quiet\` drops`, () => {
199
- const clause = dropsClause(name, anchor);
200
- for (const field of FIELDS) {
201
- assert.ok(
202
- clause.includes(`\`${field}\``),
203
- `${name}: ${label} says "${clause}", which does not name \`${field}\`. ci-state.mjs drops ${FIELDS.map((f) => `\`${f}\``).join(" and ")} under \`--quiet\`, and a reader arriving at this paragraph alone has no reason to see the other statements. Name every field here, or — if ci-state.mjs's payload changed — update all ${SITES.length} sites together.`,
204
- );
205
- }
206
- });
207
- }
208
-
209
- // #1940. The clause bound, fed statements no site holds today. Each refused one
210
- // leaves a field out of the `--quiet` sentence and names it in the next, where
211
- // it may even say the opposite. The first two passed the first-period window,
212
- // which ran on past a `!` or `?`; the third passes any splitter that misses a
213
- // bold sentence's closing `.**`. Each accepted one is complete, and that window
214
- // refused it for a period inside the sentence.
215
- test("a `--quiet` statement cannot borrow a field from the sentence after it, and a period inside it does not cut it short (#1940)", () => {
216
- assert.equal(quietClause("Pass `--quiet` — that flag drops `jobs`! Without it, `missing` stays."), "drops `jobs`!");
217
- assert.equal(quietClause("Does `--quiet` drop anything? It drops `jobs`, and `missing` stays in the payload."), null);
218
- assert.equal(quietClause("**`--quiet` drops `jobs`.** Read `missing` from the full payload."), "drops `jobs`.**");
219
-
220
- assert.equal(quietClause("Pass `--quiet`; ci-state.mjs then drops `jobs` and `missing`. Read the verdict."), "drops `jobs` and `missing`.");
221
- assert.equal(quietClause("With `--quiet` the payload drops the per-job fields, e.g. `jobs` and `missing`. Next."), "drops the per-job fields, e.g. `jobs` and `missing`.");
222
- });
@@ -1,80 +0,0 @@
1
- // reap.sh's branch sweep runs more checks than `git cherry` before its
2
- // `git update-ref --no-deref -d`: the worktree registry and listing checks,
3
- // the dirty check, the `worktree remove` refusal and the `wt_holding` re-read
4
- // can each keep the branch. The cherry check is the only one of them that
5
- // asks whether the tip is merged, so a comment saying the delete is
6
- // "authorized by this check and by nothing else" is false as written. The
7
- // component doc said reap deletes with `-D`; it deletes with `update-ref -d`.
8
- import { test } from "node:test";
9
- import assert from "node:assert/strict";
10
- import { readFileSync } from "node:fs";
11
- import { join } from "node:path";
12
- import { bullet, paragraph, phrase, runAbove, stripHashGutter } from "./prose-pin.mjs";
13
-
14
- const REPO = join(import.meta.dirname, "..", "..");
15
- const SCRIPT = readFileSync(join(REPO, "plugin", "scripts", "reap.sh"), "utf8");
16
- const DOC = readFileSync(join(REPO, "docs", "components", "reaping-and-liveness.md"), "utf8");
17
-
18
- // The comment block above the branch sweep's cherry probe, and the one above
19
- // its cherry scan: the two blocks that justify why the cherry check fails
20
- // closed.
21
- const probeComment = () =>
22
- stripHashGutter(runAbove(SCRIPT, 'if ! cherry=$(git cherry "$base_rev" "$tip"', "reap.sh cherry probe", "#"));
23
- const scanComment = () =>
24
- stripHashGutter(
25
- runAbove(SCRIPT, `if ! grep_probe "$cherry" '^+'; then keep "$b"`, "reap.sh cherry scan", "#"),
26
- );
27
-
28
- const NOTHING_ELSE = phrase("authorized by this check and by nothing else");
29
-
30
- for (const [name, comment] of [
31
- ["cherry-probe", probeComment],
32
- ["cherry-scan", scanComment],
33
- ]) {
34
- test(`reap.sh: the ${name} comment does not call the cherry check the delete's sole authorizer`, () => {
35
- assert.doesNotMatch(
36
- comment(),
37
- NOTHING_ELSE,
38
- `reap.sh's ${name} comment says the delete is authorized by the cherry check and by nothing else — the worktree checks and \`wt_holding\` can stop the delete too`,
39
- );
40
- });
41
- }
42
-
43
- test("reap.sh: the cherry-probe comment does not quote the retired \"By nothing else\" sentence", () => {
44
- assert.doesNotMatch(
45
- probeComment(),
46
- phrase('"By nothing else" bounds'),
47
- "reap.sh's cherry-probe comment says \"By nothing else\" bounds what ELSE authorizes the delete — the worktree checks and `wt_holding` can stop the delete too, and the sentence restates the sole-authorizer claim",
48
- );
49
- });
50
-
51
- test("reap.sh: the cherry comments still say why an unanswerable probe must keep", () => {
52
- // Input the pins above must ACCEPT: the fail-closed argument the old
53
- // sentence carried survives, restated as what makes the cherry check
54
- // unique — it is the only check that asks whether the tip is merged.
55
- assert.match(probeComment(), phrase("this is the only one that asks whether `$tip` is merged"));
56
- assert.match(probeComment(), phrase("never a `$tip` that is unmerged — so an unanswerable probe must KEEP"));
57
- assert.match(scanComment(), phrase("no check between here and the delete below asks whether the branch is merged"));
58
- });
59
-
60
- const reapStep = () =>
61
- bullet(DOC, "1. **Reap after every merge pass**", "2. **Release a claim", "reaping-and-liveness.md reap step");
62
- // The doc's last list item, so the blank-line bound is the end of the file.
63
- const reapAndRelease = () =>
64
- paragraph(
65
- DOC,
66
- "- **Reap and release are two different scripts on purpose.**",
67
- "reaping-and-liveness.md reap-and-release choice",
68
- );
69
-
70
- test("reaping-and-liveness.md: the reap step names the delete as a compare-and-swap `update-ref -d`, not `-D`", () => {
71
- const step = reapStep();
72
- assert.match(step, phrase("compare-and-swap `git update-ref -d`"));
73
- assert.doesNotMatch(step, /`-D`/, "reaping-and-liveness.md's reap step says the delete is `-D` — reap.sh deletes with `git update-ref -d`");
74
- });
75
-
76
- test("reaping-and-liveness.md: the reap-and-release choice names reap's delete as `update-ref -d`, not `-D`", () => {
77
- const choice = reapAndRelease();
78
- assert.match(choice, phrase("Reap authorizes a destructive `git update-ref -d`"));
79
- assert.doesNotMatch(choice, /`-D`/, "reaping-and-liveness.md says reap authorizes a `-D` — reap.sh deletes with `git update-ref -d`");
80
- });