@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,208 +0,0 @@
1
- // #503. The refuter prompt orders a verification RUN and never said how to
2
- // observe it. Measured: refuters independently reach for
3
- // `until grep -q "<marker>" <log>; do sleep N`, and one waited on the tap `#`
4
- // prefix while node wrote the spec one, so the marker could never appear and
5
- // the loop was infinite — the transcript froze and the finding went unchecked.
6
- //
7
- // Accepting both prefixes is necessary but NOT sufficient, which is why the
8
- // prefix pin and the SGR pin below are ONE span and not two. Measured on
9
- // node v26.7.0, `node --test` against a three-test file, piped through `cat -v`:
10
- //
11
- // env -u FORCE_COLOR -> "ℹ pass 3"
12
- // FORCE_COLOR=1 -> "\x1b[34mℹ pass 3\x1b[39m"
13
- // env FORCE_COLOR= -> "\x1b[34mℹ pass 3\x1b[39m" <- NOT a control
14
- // script -q /dev/null -> "\x1b[34mℹ pass 3\x1b[39m" <- a TTY colors too
15
- //
16
- // The colored line begins with ESC, so an anchor on either prefix matches
17
- // nothing and returns empty at exit 0 — the same shape as a hung run and as a
18
- // zero-test run. That is why `env -u FORCE_COLOR` is pinned as the control:
19
- // `FORCE_COLOR=` empty colors identically to `FORCE_COLOR=1`, so a baseline
20
- // taken with it silently is not a baseline.
21
- //
22
- // THE TAP PREFIX WAS NOT REPRODUCED AS A DEFAULT. Only node v26.7.0 is
23
- // installed here and it emits the spec prefix even when piped, so the `#`
24
- // form was only observed under an explicit `--test-reporter=tap`. The rule is
25
- // therefore written to be SAFE under a prefix this machine cannot produce
26
- // rather than asserting what was not measured — which is also why it demands
27
- // SGR stripping instead of a wider prefix alternation.
28
- //
29
- // All THREE live dispatch sites are pinned, not the two the ticket counted:
30
- // `grep -rn 'Try to REFUTE this finding'` finds the instruction quoted
31
- // verbatim in run-team/SKILL.md's fix-applier block, in review-and-fix.md
32
- // step 2, and in review-core.mjs's own prompt.
33
- // refuter-scratch-prose.test.mjs already ruled the reason — "a fix added to
34
- // only one is the one that does not reach whichever path a given caller
35
- // takes".
36
- //
37
- // THE CEILING, same as refuter-scratch-prose.test.mjs: these are PRESENCE pins
38
- // over a bounded slice, each a single regex. Every join is `\s+` and no pin
39
- // carries a `.{0,N}` gap, because a bounded gap is not a join — it is slack,
40
- // and slack holds a sentence. Measured: the earlier `.{0,200}` gap between the
41
- // poll ban and its carve-out bridged 107 characters of real prose, so
42
- // substituting a sentence that reinstates polling for that prose kept all
43
- // three sites green. A splice inside a `\s+`-joined span cannot: it has
44
- // nowhere to land. What a presence pin still cannot catch is a whole new
45
- // sentence appended AFTER the span carving out an exception — that is what the
46
- // negative pin at the bottom of this file is for, and why it bans the wait
47
- // vocabulary rather than three literal idioms. A reflow stays green by design:
48
- // the words are pinned, not their layout.
49
- import { test } from "node:test";
50
- import assert from "node:assert/strict";
51
- import { readFileSync } from "node:fs";
52
- import { join } from "node:path";
53
- import { between } from "./prose-pin.mjs";
54
-
55
- const REPO = join(import.meta.dirname, "..");
56
- const read = (...p) => readFileSync(join(REPO, ...p), "utf8");
57
-
58
- // Two source shapes reach these regexes. run-team/SKILL.md's copy sits in a
59
- // nested `> > ` blockquote, so a hard wrap lands with the quote gutter — not
60
- // whitespace — at the break, and `\s+` does not span `>`. review-core.mjs's copy
61
- // is inside a template literal, so every backtick in it is BACKSLASH-ESCAPED
62
- // in the source text; unescape them or every pin naming a code span fails on
63
- // that file alone. Both normalizations are harmless on review-and-fix.md.
64
- const norm = (text) =>
65
- text
66
- .split("\n")
67
- .map((l) => l.replace(/^(>\s?)+/, ""))
68
- .join(" ")
69
- .replace(/\\`/g, "`");
70
-
71
- const SITES = [
72
- [
73
- "run-team/SKILL.md",
74
- () =>
75
- norm(
76
- between(
77
- read("skills", "run-team", "SKILL.md"),
78
- "Try to REFUTE this finding",
79
- "Survives → apply it, with one hold",
80
- "run-team/SKILL.md",
81
- ),
82
- ),
83
- ],
84
- [
85
- "review-and-fix.md",
86
- () =>
87
- norm(
88
- between(
89
- read("commands", "review-and-fix.md"),
90
- "Try to REFUTE this finding",
91
- "That last clause is the whole mechanism",
92
- "review-and-fix.md",
93
- ),
94
- ),
95
- ],
96
- [
97
- "review-core.mjs",
98
- () =>
99
- norm(
100
- between(
101
- read("scripts", "review-core.mjs"),
102
- "Try to REFUTE this finding",
103
- "Scratch: ",
104
- "review-core.mjs",
105
- ),
106
- ),
107
- ],
108
- ];
109
-
110
- for (const [name, getPrompt] of SITES) {
111
- // ONE span from the exit-code rule through the poll ban to the carve-out,
112
- // joined by `\s+` and nothing wider. Split into separate assertions — or
113
- // joined by a `.{0,N}` gap, which is the same thing with extra steps — these
114
- // would let a sentence reinstating a wait loop sit between them and stay
115
- // green; that is the splice defect refuter-scratch-prose.test.mjs pins
116
- // against, and it was measured live on all three sites here before this span
117
- // was closed. The middle clause is therefore pinned, not skipped over. The
118
- // carve-out rides in the same span deliberately: a poll ban with no statement
119
- // of what a refuter MAY still do reads as a ban on reading logs at all, and a
120
- // refuter that cannot read a finished log cannot verify anything.
121
- test(`${name}: refuter observes a run synchronously by exit code, never by polling a log`, () => {
122
- assert.match(
123
- getPrompt(),
124
- /run\s+the\s+command,\s+wait\s+for\s+it,\s+read\s+its\s+exit\s+code\.\s+Never\s+poll\s+a\s+log\s+file\s+for\s+a\s+completion\s+marker:\s+prefer\s+ONE\s+blocking\s+run\s+to\s+a\s+poll\s+loop,\s+and\s+treat\s+its\s+return\s+as\s+permission\s+to\s+look,\s+never\s+as\s+the\s+answer\.\s+Reading\s+a\s+log\s+the\s+run\s+has\s+already\s+finished\s+writing\s+is\s+fine/,
125
- "the synchronous-observation rule is broken — either the exit-code rule is gone, or the poll ban is gone (a refuter reaches for `until grep <marker>` and wedges forever on a marker that can never appear), or the clause preferring one blocking run is gone, or the carve-out permitting a finished log is gone, or a sentence was spliced between them reinstating a wait",
126
- );
127
- });
128
-
129
- // Both halves in ONE span, because either alone is the measured defect: the
130
- // dual-prefix matcher `grep -E "^(ℹ|#) fail"` is exactly what a colored run
131
- // defeats, and SGR stripping without both prefixes false-refuses on a node
132
- // whose default reporter differs.
133
- test(`${name}: a reporter-output matcher needs both prefixes AND SGR stripping, neither alone`, () => {
134
- assert.match(
135
- getPrompt(),
136
- /accepting\s+both\s+`ℹ`\s+and\s+`#`\s+is\s+necessary\s+but\s+NOT\s+sufficient\s+—\s+strip\s+SGR\s+escapes\s+first/,
137
- "the reporter-matching rule lost a half — dual prefixes alone is the matcher a colored run was MEASURED to defeat (the line begins with ESC, so no prefix anchor matches and the result is empty at exit 0, indistinguishable from a hung run), and SGR stripping alone false-refuses across node versions",
138
- );
139
- });
140
-
141
- // The control, and why it is one. Pinned as a span with the refutation
142
- // attached: `env -u FORCE_COLOR` on its own invites the `FORCE_COLOR=`
143
- // spelling back, which colors identically and silently is not a baseline.
144
- test(`${name}: the uncolored baseline is env -u FORCE_COLOR, and says why the empty spelling is not`, () => {
145
- assert.match(
146
- getPrompt(),
147
- /`env\s+-u\s+FORCE_COLOR`;\s+`FORCE_COLOR=`\s+empty\s+still\s+enables\s+color,\s+so\s+it\s+is\s+not\s+a\s+control/,
148
- "the baseline control is broken — an `env FORCE_COLOR= ...` baseline is colored, so every comparison run against it is invalid, and dropping the reason is what lets the wrong spelling come back",
149
- );
150
- });
151
-
152
- // Both clauses in one span, `\s+`-joined: a scope-only rule was measured to
153
- // catch one of the two refuted negative claims and NOT the other, whose scope
154
- // was stated accurately and was still the wrong scope for the claim. The two
155
- // `.{0,160}` gaps this span used to carry bridged 3 and 27 characters of real
156
- // text, so each held room for a sentence retracting the rule between its own
157
- // halves.
158
- test(`${name}: a negative claim states its search scope AND what the pattern would have missed`, () => {
159
- assert.match(
160
- getPrompt(),
161
- /State\s+your\s+search\s+scope\s+AND\s+what\s+your\s+pattern\s+would\s+have\s+missed\.\s+A\s+grep\s+over\s+one\s+ref\s+does\s+not\s+support\s+a\s+claim\s+about\s+history;\s+a\s+pattern\s+built\s+from\s+the\s+token\s+a\s+diff\s+removed\s+does\s+not\s+support\s+a\s+claim\s+that\s+the\s+category\s+is\s+empty/,
162
- "the negative-claim rule lost a half — stating scope alone does not catch a pattern built from the token a diff removed, which was the measured second refutation",
163
- );
164
- });
165
-
166
- // The acceptance criterion is that a wait appears nowhere as endorsement. A
167
- // presence pin cannot express that; this is the negative half, and it must
168
- // fire regardless of SPELLING — the sentence measured to defeat the old pins
169
- // ("poll the log until the marker appears") contains none of the three shell
170
- // idioms the ban used to enumerate. So ban the vocabulary instead, after
171
- // removing the rule's own two sanctioned mentions of polling. Removing them
172
- // hides nothing: both are inside the `\s+`-joined span the first test pins
173
- // verbatim, so deleting or rewording either reddens there first. `replace` is
174
- // deliberately non-global — a SECOND "poll" is exactly what this catches.
175
- test(`${name}: the refuter prompt never spells a wait on a log as something to do`, () => {
176
- const rest = getPrompt()
177
- .replace(/Never\s+poll\s+a\s+log\s+file\s+for\s+a\s+completion\s+marker/, "")
178
- .replace(/prefer\s+ONE\s+blocking\s+run\s+to\s+a\s+poll\s+loop/, "");
179
- assert.doesNotMatch(
180
- rest,
181
- /poll|sleep|tail\s+-f|while\s+!|watch(?:ing)?\s+the\s+log|until\s+\S+\s+(?:appears|shows|exists|is\s+written)/i,
182
- "the refuter prompt now spells a wait on a log — the idiom this brief exists to ban reads as endorsement wherever it appears in an instruction handed to an agent verbatim, and a reinstatement does not have to reuse the brief's own words to be one",
183
- );
184
- });
185
- }
186
-
187
- // Every slice above starts at the same anchor, and `between()` takes the FIRST
188
- // match — by contract, pinned in prose-pin.test.mjs, so the guard cannot go
189
- // there. Measured on a copy: a partial quote planted earlier is harmless (it
190
- // either reds on the `to` anchor or widens the slice into a superset that still
191
- // catches drift), but a VERBATIM copy of the whole pinned span planted earlier
192
- // silently retargets every pin at the copy, and real drift in the live prompt
193
- // goes green on all three sites. The anchor is shared with
194
- // refuter-scratch-prose.test.mjs and review-core-reads.test.mjs, so this one
195
- // guard covers their slices too.
196
- for (const [name, ...p] of [
197
- ["run-team/SKILL.md", "skills", "run-team", "SKILL.md"],
198
- ["review-and-fix.md", "commands", "review-and-fix.md"],
199
- ["review-core.mjs", "scripts", "review-core.mjs"],
200
- ]) {
201
- test(`${name}: the refuter-prompt slice anchor occurs exactly once`, () => {
202
- assert.equal(
203
- read(...p).split("Try to REFUTE this finding").length - 1,
204
- 1,
205
- `${name} contains "Try to REFUTE this finding" more than once — every pin over this file slices from the FIRST occurrence, so a second copy silently moves what they check away from the live prompt`,
206
- );
207
- });
208
- }
@@ -1,49 +0,0 @@
1
- import { test } from "node:test";
2
- import assert from "node:assert/strict";
3
- import { readFileSync } from "node:fs";
4
- import { join } from "node:path";
5
-
6
- // Review finding on #1349's PR (#1361): "Say read-only" in
7
- // commands/review-and-fix.md was scoped to a false premise — NONE of the
8
- // six `fleet-review-*` specialist definitions restricts tool access in its
9
- // frontmatter (a `.agent.md` prompt saying "report only" is instruction, not
10
- // enforcement), so a hand-dispatched agent, named or general-purpose, always
11
- // carries write tools it must not use. Fixed there (the rule is
12
- // unconditional again); this pins the OTHER half — every one of the six
13
- // review-dimension prompts states the constraint explicitly, so a reader of
14
- // the prompt alone (not just the command doc) sees it too.
15
- const REPO = join(import.meta.dirname, "..");
16
- const SPECIALISTS = ["correctness", "silent-failure", "tests", "comments", "types", "simplify"];
17
-
18
- for (const key of SPECIALISTS) {
19
- test(`fleet-review-${key}.agent.md states report-only, never edit/commit/push`, () => {
20
- const text = readFileSync(join(REPO, "agents", `fleet-review-${key}.agent.md`), "utf8");
21
- assert.match(text, /Report only; never edit, commit or push\./);
22
- });
23
- }
24
-
25
- // The snapshot and verifier dispatches are NOT specialists in this sense —
26
- // snapshot's whole job is a fixed shell script the caller already bounds
27
- // (`Do not modify ${worktree}` is in review-core.mjs's own prompt, not the
28
- // agent's), and verifier is a refuter whose job is verification commands in
29
- // its own scratch directory, never the checkout. Neither belongs in the six
30
- // above; this documents the exclusion is deliberate rather than an oversight
31
- // a future reader "fixes" by adding a ninth/tenth match here.
32
- test("the exclusion is exactly the six review-dimension specialists, not all eight definitions", () => {
33
- assert.equal(SPECIALISTS.length, 6);
34
- assert.ok(!SPECIALISTS.includes("snapshot") && !SPECIALISTS.includes("verifier"));
35
- });
36
-
37
- // commands/review-and-fix.md's own rule must be unconditional again — no
38
- // carve-out for a "by design" fleet-review-* exemption that isn't true.
39
- test("review-and-fix.md's read-only rule is unconditional, not scoped to general-purpose hand-dispatch only", () => {
40
- const text = readFileSync(join(REPO, "commands", "review-and-fix.md"), "utf8");
41
- const bullet = text.split("\n").find((l) => l.includes("**Say read-only.**"));
42
- assert.ok(bullet, "the Say read-only bullet is gone");
43
- assert.match(bullet, /No `fleet-review-\*` definition's frontmatter restricts tool access/);
44
- assert.doesNotMatch(
45
- bullet,
46
- /is a report-only specialist by design/,
47
- "the bullet still claims fleet-review-* dispatches are enforced report-only, which no frontmatter actually does",
48
- );
49
- });
@@ -1,35 +0,0 @@
1
- // Every review fan-out dispatch books its cost to the PR it reviews: the label
2
- // review-core.mjs dispatches under carries the PR, and parseMemberName reads it
3
- // back, both off the label itself and off the member id omp derives from it.
4
- import { test } from "node:test";
5
- import assert from "node:assert/strict";
6
- import { runReview } from "./review-core.mjs";
7
- import { parseMemberName } from "./member-record.mjs";
8
- import { ARGS, SNAP, pipeline, parallel, review, finding, vote, scriptedHost } from "./review-host-fixture.mjs";
9
-
10
- // omp's member id for a labelled dispatch: every character outside
11
- // [A-Za-z0-9_-] deleted, capped at 48, and `-<n>` appended from the second
12
- // dispatch of the same label on.
13
- const ompId = (label, nth = 1) => {
14
- const id = label.replace(/[^A-Za-z0-9_-]+/g, "").slice(0, 48);
15
- return nth === 1 ? id : `${id}-${nth}`;
16
- };
17
-
18
- test("every dispatch of one review is labelled with its PR, and each label books to that PR", async () => {
19
- const { host, labels } = scriptedHost({
20
- snapshot: [SNAP],
21
- "review:correctness": [review([finding("critical")])],
22
- "verify:correctness": [vote(false)],
23
- });
24
- await runReview({ ...host, pipeline, parallel }, ARGS);
25
-
26
- const kinds = new Set(labels.map((l) => l.replace(/:pr\d+$/, "")));
27
- assert.deepEqual([...kinds].sort(), ["review:correctness", "snapshot", "test-run", "verify:correctness"],
28
- "the review no longer dispatches every kind this test books");
29
- for (const label of labels) {
30
- assert.match(label, new RegExp(`:pr${ARGS.pr}$`), `${label} does not carry its PR`);
31
- for (const name of [label, ompId(label), ompId(label, 2), `review-pr-${ARGS.pr}/${ompId(label, 3)}`]) {
32
- assert.deepEqual(parseMemberName(name), { ticket: "", pr: String(ARGS.pr) }, name);
33
- }
34
- }
35
- });