@feigi/fleet-ctl 3.23.36 → 3.23.38

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 (205) hide show
  1. package/package.json +1 -1
  2. package/scripts/cell-readout.mjs +38 -11
  3. package/scripts/main-checkout.mjs +1 -1
  4. package/scripts/member-write-guard.mjs +1 -1
  5. package/scripts/repo-root.mjs +1 -1
  6. package/skills/run-team/references/reaping.md +1 -1
  7. package/scripts/agent-test-dir-prose.test.mjs +0 -59
  8. package/scripts/agent-test.test.mjs +0 -1640
  9. package/scripts/ambient-git-vars-mjs-prose.test.mjs +0 -397
  10. package/scripts/ambient-git-vars-prose.test.mjs +0 -192
  11. package/scripts/ancestry-check-position-prose.test.mjs +0 -175
  12. package/scripts/apply-ruleset.test.mjs +0 -421
  13. package/scripts/arg-header-probes-prose.test.mjs +0 -394
  14. package/scripts/arg.test.mjs +0 -1354
  15. package/scripts/board-cli.test.mjs +0 -710
  16. package/scripts/board-identity.test.mjs +0 -429
  17. package/scripts/board-liveness-banner.test.mjs +0 -119
  18. package/scripts/board-prev-shape.test.mjs +0 -228
  19. package/scripts/board-tryparse-null.test.mjs +0 -119
  20. package/scripts/board.test.mjs +0 -3121
  21. package/scripts/brief-after-cut-prose.test.mjs +0 -53
  22. package/scripts/candidates-exit3-prose.test.mjs +0 -302
  23. package/scripts/candidates.test.mjs +0 -2312
  24. package/scripts/caveat-unification-prose.test.mjs +0 -98
  25. package/scripts/cell-readout.test.mjs +0 -615
  26. package/scripts/ci-comment-rot-prose.test.mjs +0 -2025
  27. package/scripts/ci-completes-premise-prose.test.mjs +0 -257
  28. package/scripts/ci-state-prose.test.mjs +0 -113
  29. package/scripts/ci-state.test.mjs +0 -1933
  30. package/scripts/ci-vacuous-green.test.mjs +0 -368
  31. package/scripts/citation-sweep-prose.test.mjs +0 -1712
  32. package/scripts/claim-lifecycle.test.mjs +0 -187
  33. package/scripts/claim-ticket.test.mjs +0 -1122
  34. package/scripts/closing-keyword-prose.test.mjs +0 -193
  35. package/scripts/cockpit-launch-idempotent-prose.test.mjs +0 -165
  36. package/scripts/cockpit-tick-nonblocking.test.mjs +0 -210
  37. package/scripts/compute-board.test.mjs +0 -1214
  38. package/scripts/compute-spend.test.mjs +0 -517
  39. package/scripts/consumer-technology-prose.test.mjs +0 -126
  40. package/scripts/cross-repo-citation-prose.test.mjs +0 -155
  41. package/scripts/cwd-isolation-pins.mjs +0 -83
  42. package/scripts/dedupe-guard-prose.test.mjs +0 -243
  43. package/scripts/delete-merged-branch.test.mjs +0 -576
  44. package/scripts/derive-testcmd.test.mjs +0 -595
  45. package/scripts/diff-stats.test.mjs +0 -404
  46. package/scripts/dispatch-block-golden-prose.test.mjs +0 -1130
  47. package/scripts/dispatch-block-pins-prose.test.mjs +0 -615
  48. package/scripts/dispositions-check.test.mjs +0 -936
  49. package/scripts/dispositions-gate-prose.test.mjs +0 -129
  50. package/scripts/drop-merged-label.test.mjs +0 -479
  51. package/scripts/exec-stub.mjs +0 -93
  52. package/scripts/exec-stub.test.mjs +0 -69
  53. package/scripts/expected-jobs-prose.test.mjs +0 -80
  54. package/scripts/fan-out-authorization-prose.test.mjs +0 -80
  55. package/scripts/filing-bar-seat-prose.test.mjs +0 -242
  56. package/scripts/filing-claim-bar-prose.test.mjs +0 -166
  57. package/scripts/finisher-died-prose.test.mjs +0 -31
  58. package/scripts/finisher-dispatch-premise-prose.test.mjs +0 -312
  59. package/scripts/finisher-halt-prose.test.mjs +0 -106
  60. package/scripts/finisher-name-prose.test.mjs +0 -134
  61. package/scripts/finisher-own-tree-prose.test.mjs +0 -299
  62. package/scripts/finisher-pin-race-prose.test.mjs +0 -339
  63. package/scripts/finisher-test-verdict-prose.test.mjs +0 -102
  64. package/scripts/fix-applier-correction-rules-prose.test.mjs +0 -202
  65. package/scripts/fix-applier-result-file-prose.test.mjs +0 -149
  66. package/scripts/fleet-bootstrap.test.mjs +0 -75
  67. package/scripts/fleet-heartbeat.test.mjs +0 -450
  68. package/scripts/fleet-provenance.test.mjs +0 -138
  69. package/scripts/fleet-run.test.mjs +0 -90
  70. package/scripts/fleet-state.test.mjs +0 -460
  71. package/scripts/fleet-tick-prose.test.mjs +0 -300
  72. package/scripts/fleet-tick.test.mjs +0 -2444
  73. package/scripts/force-with-lease-reason-prose.test.mjs +0 -184
  74. package/scripts/frontmatter-check.test.mjs +0 -436
  75. package/scripts/git-env.test.mjs +0 -149
  76. package/scripts/git-status-untracked-mode-sweep.test.mjs +0 -216
  77. package/scripts/gone-walk.test.mjs +0 -213
  78. package/scripts/gp-sep-invariant-prose.test.mjs +0 -188
  79. package/scripts/head-moved-after-label-prose.test.mjs +0 -233
  80. package/scripts/immutable-body-claim-prose.test.mjs +0 -204
  81. package/scripts/implementer-model-tier.test.mjs +0 -235
  82. package/scripts/inflight-citation-prose.test.mjs +0 -144
  83. package/scripts/inflight-exit2-prose.test.mjs +0 -81
  84. package/scripts/inflight-probe-guard-prose.test.mjs +0 -109
  85. package/scripts/inflight-scan-scope-prose.test.mjs +0 -57
  86. package/scripts/inflight.test.mjs +0 -2882
  87. package/scripts/injection-control-prose.test.mjs +0 -404
  88. package/scripts/install-root-audit.test.mjs +0 -464
  89. package/scripts/instrument-check-prose.test.mjs +0 -235
  90. package/scripts/instruments.test.mjs +0 -787
  91. package/scripts/is-cli.test.mjs +0 -99
  92. package/scripts/issue-tracker-prose.test.mjs +0 -71
  93. package/scripts/json.test.mjs +0 -364
  94. package/scripts/ledger-dispatch.test.mjs +0 -927
  95. package/scripts/ledger-grammar.test.mjs +0 -227
  96. package/scripts/ledger-read-require-file.test.mjs +0 -197
  97. package/scripts/ledger-rotate.test.mjs +0 -142
  98. package/scripts/ledger.test.mjs +0 -3436
  99. package/scripts/line-distance-prose.test.mjs +0 -245
  100. package/scripts/liveness-rationale-prose.test.mjs +0 -83
  101. package/scripts/locale-pin-prose.test.mjs +0 -189
  102. package/scripts/main-checkout.test.mjs +0 -332
  103. package/scripts/member-outcome-prose.test.mjs +0 -167
  104. package/scripts/member-outcomes-header.test.mjs +0 -129
  105. package/scripts/member-outcomes-prose.test.mjs +0 -63
  106. package/scripts/member-outcomes.test.mjs +0 -638
  107. package/scripts/member-prompt-prose.test.mjs +0 -165
  108. package/scripts/member-record.test.mjs +0 -541
  109. package/scripts/member-write-guard.test.mjs +0 -214
  110. package/scripts/merge-commit-probe-prose.test.mjs +0 -122
  111. package/scripts/merge-gate.test.mjs +0 -613
  112. package/scripts/muted-git-guard-sweep.test.mjs +0 -493
  113. package/scripts/net-ssh-precedence-prose.test.mjs +0 -91
  114. package/scripts/net-watchdog-prose.test.mjs +0 -79
  115. package/scripts/net.test.mjs +0 -211
  116. package/scripts/no-ci-gate-prose.test.mjs +0 -108
  117. package/scripts/no-undo-audit.test.mjs +0 -3961
  118. package/scripts/no-wave.test.mjs +0 -138
  119. package/scripts/node-floor-sweep.test.mjs +0 -611
  120. package/scripts/pointer-target-prose.test.mjs +0 -186
  121. package/scripts/pr-cost.test.mjs +0 -521
  122. package/scripts/pr-overlap.test.mjs +0 -692
  123. package/scripts/printf-die-sweep.test.mjs +0 -384
  124. package/scripts/prompt-renderer.mjs +0 -40
  125. package/scripts/prompt-renderer.test.mjs +0 -68
  126. package/scripts/prose-pin.mjs +0 -807
  127. package/scripts/prose-pin.test.mjs +0 -1034
  128. package/scripts/prove-merge.test.mjs +0 -995
  129. package/scripts/pull-table-relabel-prose.test.mjs +0 -60
  130. package/scripts/quiet-payload-prose.test.mjs +0 -222
  131. package/scripts/reap-cherry-check-prose.test.mjs +0 -80
  132. package/scripts/reap.test.mjs +0 -4432
  133. package/scripts/reaping-prose.test.mjs +0 -239
  134. package/scripts/reaping-reap-authorizers-prose.test.mjs +0 -112
  135. package/scripts/reaping-release-authorizers-prose.test.mjs +0 -85
  136. package/scripts/recipe-derivation-prose.test.mjs +0 -112
  137. package/scripts/recipe-prove.test.mjs +0 -1042
  138. package/scripts/refuter-scratch-prose.test.mjs +0 -135
  139. package/scripts/release-label-required-prose.test.mjs +0 -71
  140. package/scripts/release-label-split-prose.test.mjs +0 -184
  141. package/scripts/release-ticket-reap-pairing-prose.test.mjs +0 -63
  142. package/scripts/release-ticket.test.mjs +0 -5099
  143. package/scripts/renovate-release-contract.test.mjs +0 -379
  144. package/scripts/repo-root.test.mjs +0 -873
  145. package/scripts/reporter-output-rule-prose.test.mjs +0 -208
  146. package/scripts/review-agent-report-only.test.mjs +0 -49
  147. package/scripts/review-core-booking.test.mjs +0 -35
  148. package/scripts/review-core-cwd-isolation.test.mjs +0 -374
  149. package/scripts/review-core-reads.test.mjs +0 -478
  150. package/scripts/review-core-refuter-scratch.test.mjs +0 -148
  151. package/scripts/review-core-scratch-refusal.test.mjs +0 -64
  152. package/scripts/review-core-shared-test-run.test.mjs +0 -275
  153. package/scripts/review-core-snapshot-path.test.mjs +0 -830
  154. package/scripts/review-core-specialist-scratch.test.mjs +0 -191
  155. package/scripts/review-core-testcmd.test.mjs +0 -335
  156. package/scripts/review-core-unrun.test.mjs +0 -566
  157. package/scripts/review-core-unverified-discriminant.test.mjs +0 -208
  158. package/scripts/review-eval-resolver-path.test.mjs +0 -55
  159. package/scripts/review-host-fixture.mjs +0 -89
  160. package/scripts/review-in-run-retry.test.mjs +0 -211
  161. package/scripts/review-no-vendor-dispatch.test.mjs +0 -45
  162. package/scripts/review-path-default.test.mjs +0 -796
  163. package/scripts/review-runner-spawns.test.mjs +0 -95
  164. package/scripts/review-runner.test.mjs +0 -166
  165. package/scripts/review-tier-audit.test.mjs +0 -140
  166. package/scripts/run-artifact-pr-prose.test.mjs +0 -341
  167. package/scripts/run-merge-bot-prose.test.mjs +0 -1413
  168. package/scripts/run-team-local-hook.test.mjs +0 -442
  169. package/scripts/scratch-partition-invariant-prose.test.mjs +0 -74
  170. package/scripts/scripts-path-citation-sweep.test.mjs +0 -73
  171. package/scripts/section-between-guard-prose.test.mjs +0 -379
  172. package/scripts/select-dimensions.test.mjs +0 -674
  173. package/scripts/shared-refusal.test.mjs +0 -388
  174. package/scripts/shell-traps-prose.test.mjs +0 -504
  175. package/scripts/shortlist.test.mjs +0 -380
  176. package/scripts/slow-transport.mjs +0 -72
  177. package/scripts/snapshot-repo.test.mjs +0 -1006
  178. package/scripts/snapshot-runner-audience-prose.test.mjs +0 -130
  179. package/scripts/spend-view.test.mjs +0 -312
  180. package/scripts/staleness-qualifier-prose.test.mjs +0 -251
  181. package/scripts/staleness-verdict-prose.test.mjs +0 -142
  182. package/scripts/staleness.test.mjs +0 -893
  183. package/scripts/stalled-member-liveness-prose.test.mjs +0 -219
  184. package/scripts/stash-prohibition-prose.test.mjs +0 -313
  185. package/scripts/strip-comments.mjs +0 -44
  186. package/scripts/temp-dir.mjs +0 -47
  187. package/scripts/ticket-router.test.mjs +0 -981
  188. package/scripts/tier-check.test.mjs +0 -828
  189. package/scripts/tier-outcomes-header.test.mjs +0 -518
  190. package/scripts/tier-outcomes.test.mjs +0 -572
  191. package/scripts/tier-roles.test.mjs +0 -535
  192. package/scripts/tracker-block-copy-prose.test.mjs +0 -288
  193. package/scripts/triage-labels-gloss-prose.test.mjs +0 -97
  194. package/scripts/unattended-git-sweep.test.mjs +0 -142
  195. package/scripts/verify-sha-exit2-prose.test.mjs +0 -269
  196. package/scripts/verify-sha.test.mjs +0 -692
  197. package/scripts/watcher-degraded-block.test.mjs +0 -369
  198. package/scripts/watcher-key-prose.test.mjs +0 -106
  199. package/scripts/within-run-pair-prose.test.mjs +0 -212
  200. package/scripts/worktree-audit.test.mjs +0 -1408
  201. package/scripts/worktree-head-prose.test.mjs +0 -276
  202. package/scripts/worktree-listing-sweep.test.mjs +0 -217
  203. package/scripts/worktree-model-prose.test.mjs +0 -216
  204. package/scripts/worktree-porcelain.mjs +0 -35
  205. package/scripts/worktree-porcelain.test.mjs +0 -102
@@ -1,404 +0,0 @@
1
- // #990. A failure injection built from an unquoted shell variable silently does
2
- // not happen under this environment's shell: the probe still runs, still exits
3
- // 0, and reports the child behaving exactly like its baseline — which is
4
- // indistinguishable from a genuine "this mutation has no effect" result and
5
- // reads as a clean corroboration. Measured twice in production, in BOTH
6
- // directions: `fix-pr-983` nearly reported a mutant as behaving identically to
7
- // its baseline (the injection never landed), and `fix-pr-1153` nearly retired a
8
- // real review finding as non-reproducing (the reproduction never landed, and a
9
- // matching exit code on both trees is precisely the signature of a correctly
10
- // refuted finding — nothing anomalous to notice).
11
- //
12
- // Re-measured on this tree while these pins were written, against a `probe.sh`
13
- // echoing both variables back and an `argv.sh` printing `$#`:
14
- //
15
- // zsh cfg="SETB=1 BADJ=1"; env $cfg sh ./probe.sh BADJ=[unset] SETB=[1 BADJ=1] rc 0
16
- // bash same BADJ=[1] SETB=[1]
17
- // zsh cfg=(SETB=1 BADJ=1); env $cfg[@] sh … BADJ=[1] SETB=[1]
18
- // bash same BADJ=[unset] SETB=[1[@]] rc 0
19
- // both env "${cfg[@]}" sh … / env SETB=1 BADJ=1 sh … BADJ=[1] SETB=[1]
20
- // zsh sub="pr list --json number"; sh ./argv.sh $sub argc=1
21
- // bash same argc=4
22
- //
23
- // Row four is why these pins demand the BRACED array expansion and require
24
- // `$cfg[@]` to be named non-portable. The ticket's own Direction bullet
25
- // prescribes `env $cfg[@]`, and measured, that spelling reintroduces the
26
- // identical silent no-op one shell over — a variable literally named `SETB`
27
- // taking `1[@]` while `BADJ` stays unset, at exit 0. The issue body is a lead,
28
- // never a citation, so the rule that shipped is the portable spelling with the
29
- // zsh-only one named as the trap it is.
30
- //
31
- // FOUR SEATS, because the rule has to reach the member that WRITES the harness,
32
- // in the prompt text, and no member reads all four:
33
- //
34
- // 1. run-team/SKILL.md's Reviewers prose — the controller's own admission
35
- // gate, and the one place the rule is JUSTIFIED rather than dictated, so
36
- // the two-shell reproduction lives there and is pinned as one span.
37
- // 2/3. The two hand-dispatch refuter briefs — run-team/SKILL.md's nested
38
- // `> >` block and review-and-fix.md step 2 — the pair
39
- // refuter-scratch-prose.test.mjs already treats as one population,
40
- // for the reason it gives: a rule added to one is the one that misses
41
- // whichever path a caller takes.
42
- // 4. The refuter prompt TEMPLATE — scripts/review-core.mjs. It carries the
43
- // largest refuter population by far: the review dispatches up to two per
44
- // critical/important finding, where the hand-dispatch briefs cover one per
45
- // in-scope `suggestion`. The ticket's Key interfaces say no script change
46
- // is required; against this tree that is false, and leaving it out would
47
- // have put the rule everywhere except where most refuters read it.
48
- //
49
- // Plus the fix-applier's own mutation paragraph, which is a sixth site with
50
- // different wording — it governs the fix-applier's OWN mutants rather than a
51
- // refuter's verdict, so only the invocation-form clause is shared verbatim.
52
- //
53
- // WHY 4/5 RENDER RATHER THAN GREP. The prescribed array expansion is
54
- // `env "${cfg[@]}"`, and inside a JS template literal that `${` must be
55
- // escaped or it interpolates a free name and the template stops compiling.
56
- // A source grep cannot tell a correctly escaped `\${cfg[@]}` from one that
57
- // renders as an interpolation of `cfg[@]`, and the prompt a refuter actually
58
- // receives is the RENDERED string. So both templates are lifted and evaluated,
59
- // the technique review-core-refuter-scratch.test.mjs uses — the template lives
60
- // inline in a function body, not exported as its own value — and extraction runs against
61
- // comment-stripped code so a commented-out `agent(...)` call cannot satisfy a
62
- // pin with the live dispatch gutted.
63
- //
64
- // THE CEILING, same as refuter-scratch-prose.test.mjs: these are PRESENCE pins
65
- // over bounded slices. Each rule is ONE contiguous regex — a span with
66
- // `[\s\S]{0,N}?` joins — so text spliced INSIDE a pinned clause reddens it, and
67
- // the mutation matrix below measures that both ways. What they cannot catch is a
68
- // WHOLE NEW sentence appended AFTER a clause carving out an exception; nothing
69
- // pins a clause's neighbourhood. A reflow stays green by design, which the
70
- // matrix's ACCEPT row measures rather than asserts by construction.
71
- import { test } from "node:test";
72
- import assert from "node:assert/strict";
73
- import { readFileSync } from "node:fs";
74
- import { join } from "node:path";
75
- import { between, phrase } from "./prose-pin.mjs";
76
- import { stripComments } from "./strip-comments.mjs";
77
- import { promptRenderer } from "./prompt-renderer.mjs";
78
-
79
- const REPO = join(import.meta.dirname, "..");
80
-
81
- // NOT prose-pin.mjs's exported `stripQuoteGutter`, for the reason
82
- // refuter-scratch-prose.test.mjs duplicates it too: the refuter brief sits in a
83
- // NESTED `> > ` blockquote, and that export's `>+` matches only CONSECUTIVE
84
- // markers, so `> > text` comes back as `> text` and a hard wrap inside a pinned
85
- // phrase leaves a `>` where `\s+` needs whitespace. `(>\s?)+` eats both levels,
86
- // and the join is a single space, which is exactly the inter-word space a
87
- // markdown wrap point replaces.
88
- const stripQuoteGutter = (text) => text.split("\n").map((l) => l.replace(/^(>\s?)+/, "")).join(" ");
89
- const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
90
- const REVIEW_AND_FIX = readFileSync(join(REPO, "commands", "review-and-fix.md"), "utf8");
91
-
92
- // One rule, one regex. `phrase()` already tolerates a rewrap between words; the
93
- // numeric joins are what let a bounded amount of unpinned prose sit between two
94
- // pinned clauses without letting a whole sentence be spliced in unnoticed.
95
- const span = (...parts) =>
96
- new RegExp(parts.map((p) => (typeof p === "number" ? `[\\s\\S]{0,${p}}?` : phrase(p).source)).join(""));
97
-
98
- // --- the invocation-form rule, word-identical in every one of the six seats ---
99
- // AC-3: the safe form stated, with the unquoted-scalar form named as the thing
100
- // not to write. One span from the prescription through the prohibition, so
101
- // deleting either half — or splicing an exception between them — reds.
102
- const SAFE_FORM = span(
103
- "Build such an invocation as an array expanded braced and quoted",
104
- 8,
105
- '`cfg=(SETB=1 BADJ=1); env "${cfg[@]}" sh ./probe.sh`',
106
- 8,
107
- "or inline the assignments literally",
108
- 8,
109
- "`env SETB=1 BADJ=1 sh ./probe.sh`",
110
- 8,
111
- "NEVER from an unquoted scalar",
112
- 8,
113
- '`cfg="SETB=1 BADJ=1"; env $cfg sh ./probe.sh`',
114
- );
115
-
116
- // The mechanism, which is what makes the prohibition actionable rather than
117
- // superstition: naming the argument count and the variable that really gets set.
118
- const MECHANISM = span(
119
- "which under zsh passes ONE argument, sets a variable literally named `SETB` to `1 BADJ=1`, never sets `BADJ` at all, and still exits 0",
120
- );
121
-
122
- // The half the ticket's own Direction bullet got wrong. Without this clause a
123
- // member follows the issue body, writes `env $cfg[@]`, and reintroduces the
124
- // defect under bash — so the clause is pinned in its own right, not as a
125
- // footnote to SAFE_FORM.
126
- const PORTABILITY = span(
127
- "`env $cfg[@]` is not the portable spelling either: measured, bash word-splits it into `SETB=1` and `BADJ=1[@]`, so the injection variable is set to a corrupted value, while zsh behaves exactly as with the bare `$cfg` — `BADJ` never set, exit 0",
128
- );
129
-
130
- // --- AC-1 and AC-2, in the refuter briefs -----------------------------------
131
- // The control requirement and what a control concretely IS, as one span: a rule
132
- // that says "carry a control" without saying what one looks like is not
133
- // actionable, and the two halves are exactly what a narrowing edit separates.
134
- const REFUTER_CONTROL = span(
135
- "A failure injection with no positive control has produced NO result, never a negative one",
136
- 240,
137
- "prove the injection reached the child: one run whose output differs with it present versus absent, or the child echoing the injected value back",
138
- 120,
139
- "the cell is unrun",
140
- );
141
-
142
- const SEATS = [
143
- [
144
- "run-team/SKILL.md's nested refuter brief",
145
- () => stripQuoteGutter(between(RUN_TEAM, "Try to REFUTE this finding", "Survives → apply it, with one hold", "run-team/SKILL.md")),
146
- ],
147
- [
148
- "review-and-fix.md step 2's refuter brief",
149
- () => between(REVIEW_AND_FIX, "Try to REFUTE this finding", "That last clause is the whole mechanism", "review-and-fix.md"),
150
- ],
151
- ["scripts/review-core.mjs's rendered refuter prompt", () => renderTemplate("scripts", "review-core.mjs")],
152
- ];
153
-
154
- // The free names the template interpolates, in the order `render` binds them.
155
- const SCOPE = ["pr", "f", "snap", "stats", "d", "i", "fi", "readRules", "usableDiff", "environmentNote"];
156
- const TEMPLATE_START = "`Try to REFUTE this finding from PR #";
157
- const TEMPLATE_END = "{ label: `verify:";
158
-
159
- // prompt-renderer.mjs owns the bounded-slice extraction (and both failure
160
- // messages, via prose-pin.mjs's `between()`), the backtick trim, and the
161
- // compile. Compiling is half the assertion: an unescaped `${` in the
162
- // prescribed array expansion either throws here or silently interpolates
163
- // away the very spelling the rule exists to teach.
164
- function renderTemplate(dir, file) {
165
- const RENDER = promptRenderer({
166
- file: `${dir}/${file}`,
167
- start: TEMPLATE_START,
168
- end: TEMPLATE_END,
169
- scope: SCOPE,
170
- what: `${dir}/${file}'s rendered refuter prompt (opening \`Try to REFUTE this finding from PR #\`, labelled \`verify:\`)`,
171
- });
172
- return RENDER(
173
- 7,
174
- { claim: "the guard fails open", file: "a.js", line: 12, evidence: "line 12 has no else" },
175
- { path: "/scr/snapshot-abc1234", head: "abc1234", runRoot: "/scr" },
176
- null,
177
- { key: "correctness" },
178
- 0,
179
- 0,
180
- () => "READ RULES",
181
- () => null,
182
- () => "TEST ENVIRONMENT",
183
- );
184
- }
185
-
186
- for (const [name, getSeat] of SEATS) {
187
- test(`${name} refuses a failure-injection result that carries no positive control`, () => {
188
- assert.match(
189
- getSeat(),
190
- REFUTER_CONTROL,
191
- `${name} no longer requires a positive control, or dropped what a control concretely is — an uncontrolled injection then reads as a negative result, which is the defect (#990)`,
192
- );
193
- });
194
-
195
- test(`${name} states the safe invocation form and names the unquoted scalar as the thing not to write`, () => {
196
- const seat = getSeat();
197
- assert.match(seat, SAFE_FORM, `${name} no longer prescribes the braced array or literal-inline form, or stopped naming the unquoted scalar as the form not to write (#990 AC-3)`);
198
- assert.match(seat, MECHANISM, `${name} dropped the mechanism — a prohibition with no measured reason behind it is the first thing a later edit drops`);
199
- assert.match(seat, PORTABILITY, `${name} dropped the note that \`env $cfg[@]\` is zsh-only — a member following the ticket's own Direction bullet then writes the same silent no-op for bash`);
200
- });
201
- }
202
-
203
- // --- AC-1, AC-2 and AC-4, in the Reviewers section's own prose ----------------
204
- // This is the seat where the rule is JUSTIFIED rather than dictated, so it is
205
- // the seat AC-4 binds: the reproduction has to be here or the rule rests on
206
- // assertion. Since the fix-applier took over every ruling on the findings
207
- // (spec 2026-09-24 § 3 §4), the reader it justifies the rule to is the one
208
- // admitting a refutation — the fix-applier, whose prompt carries the rule.
209
- const justification = () =>
210
- between(
211
- RUN_TEAM,
212
- "A refutation resting on an injection nothing proved landed is not a refutation",
213
- "**Where `testCmd` comes from:**",
214
- "run-team/SKILL.md Reviewers prose",
215
- );
216
-
217
- test("a negative result is admitted only with its positive control", () => {
218
- assert.match(
219
- justification(),
220
- span(
221
- "a negative result is admitted only together with its **positive control**",
222
- 200,
223
- "the child's output differing with the injection present versus absent or the child echoing the injected value back",
224
- 120,
225
- "No control → the cell is unrun: re-run it, and never record it as a negative",
226
- ),
227
- "the controller's admission gate no longer requires a control, or no longer says an uncontrolled cell is unrun rather than negative — the gate is the whole of change 1 in #990's Brief",
228
- );
229
- });
230
-
231
- test("the rule carries its measured reproduction, both shells, as one span", () => {
232
- // Both lines together. The bash line IS the control: on its own the zsh line
233
- // shows a variable with a surprising value, and nothing establishes that the
234
- // same text behaves differently elsewhere. Deleting the control line from a
235
- // reproduction is the mutation this ticket is about, committed against the
236
- // ticket's own evidence — so it must red here too.
237
- assert.match(
238
- justification(),
239
- span(
240
- `zsh -c 'cfg="SETB=1 BADJ=1"; env $cfg sh ./probe.sh' # BADJ=[unset] SETB=[1 BADJ=1]`,
241
- 4,
242
- `bash -c 'cfg="SETB=1 BADJ=1"; env $cfg sh ./probe.sh' # BADJ=[1] SETB=[1]`,
243
- ),
244
- "the two-shell reproduction lost a line or was replaced by an assertion — #990 AC-4 requires the reproduction wherever the rule is justified",
245
- );
246
- assert.match(
247
- justification(),
248
- span(
249
- "zsh does not word-split an unquoted parameter expansion, so the whole string arrives as ONE argument",
250
- 200,
251
- "the probe still exits 0",
252
- ),
253
- "the reproduction no longer states what it demonstrates, or dropped that the probe exits 0 — the exit code is why the no-op is silent rather than loud",
254
- );
255
- });
256
-
257
- test("the rule names both failure directions, not only the injection that never lands", () => {
258
- // #1153's direction is the one that retires a real defect rather than missing
259
- // one, and it is the direction a reader of the title alone does not get.
260
- assert.match(
261
- justification(),
262
- span(
263
- "It bites in both directions, and the reproduction direction is the worse one",
264
- 400,
265
- "which is the signature of a correct refutation with nothing anomalous to notice",
266
- ),
267
- "the prose no longer names the reproduction-that-never-happened direction, or no longer says why it is worse — that half is the whole content of #990's second comment",
268
- );
269
- });
270
-
271
- // --- the sixth seat: the fix-applier's own mutation paragraph ----------------
272
- const fixApplierMutationRule = () =>
273
- stripQuoteGutter(
274
- between(RUN_TEAM, "A mutation that never landed is not a green", "**Commit BEFORE you mutate", "run-team/SKILL.md fix-applier prompt"),
275
- );
276
-
277
- test("the fix-applier prompt refuses a mutation nothing proved landed, and carries the same invocation form", () => {
278
- const seat = fixApplierMutationRule();
279
- assert.match(
280
- seat,
281
- span(
282
- "A mutation that never landed is not a green — it is a cell that did not run",
283
- 120,
284
- "prove the injection reached the child before you read its result",
285
- 260,
286
- "indistinguishable from a real no-effect result, and a reproduction that never happened reads as a refutation",
287
- ),
288
- "the fix-applier prompt no longer requires the injection be proved to have landed — its mutant-kill rule then reads a no-op mutation as a test that discriminates (#990)",
289
- );
290
- assert.match(seat, SAFE_FORM, "the fix-applier prompt lost the safe invocation form — the seat that does the most mutating is the one that most needs it");
291
- assert.match(seat, MECHANISM, "the fix-applier prompt dropped the mechanism");
292
- assert.match(seat, PORTABILITY, "the fix-applier prompt dropped the zsh-only-array note");
293
- });
294
-
295
- // --- the discriminating half -------------------------------------------------
296
- // A pin that reddens on any edit is not a pin. Every REJECT row below is derived
297
- // from the LIVE text and deletes exactly one clause; the ACCEPT row rewraps the
298
- // same live text and must stay green. Without the ACCEPT row these would be
299
- // satisfied by a whole-file-text assertion, which reddens on everything and
300
- // discriminates nothing — the failure the fix-applier prompt's own mutant rule
301
- // names.
302
- const rewrap = (text, width = 34) => {
303
- const out = [];
304
- let line = "";
305
- for (const word of text.split(/\s+/)) {
306
- if (line && (line + " " + word).length > width) {
307
- out.push(line);
308
- line = word;
309
- } else {
310
- line = line ? line + " " + word : word;
311
- }
312
- }
313
- if (line) out.push(line);
314
- return out.join("\n");
315
- };
316
-
317
- const REJECTS = [
318
- [
319
- "the control requirement is deleted",
320
- REFUTER_CONTROL,
321
- (t) => t.replace(phrase("A failure injection with no positive control has produced NO result, never a negative one."), ""),
322
- ],
323
- [
324
- "the control stays but what it IS is deleted",
325
- REFUTER_CONTROL,
326
- (t) =>
327
- t.replace(
328
- phrase("prove the injection reached the child: one run whose output differs with it present versus absent, or the child echoing the injected value back"),
329
- "be careful",
330
- ),
331
- ],
332
- [
333
- "the unquoted-scalar prohibition is deleted",
334
- SAFE_FORM,
335
- (t) => t.replace(phrase('NEVER from an unquoted scalar — `cfg="SETB=1 BADJ=1"; env $cfg sh ./probe.sh`'), ""),
336
- ],
337
- [
338
- "the prescribed array expansion loses its braces",
339
- SAFE_FORM,
340
- (t) => t.replace(phrase('env "${cfg[@]}" sh ./probe.sh`'), "env $cfg[@] sh ./probe.sh`"),
341
- ],
342
- [
343
- "the zsh-only-array note is deleted",
344
- PORTABILITY,
345
- (t) => t.replace(phrase("`env $cfg[@]` is not the portable spelling either: measured, bash word-splits it into `SETB=1` and `BADJ=1[@]`, so the injection variable is set to a corrupted value, while zsh behaves exactly as with the bare `$cfg` — `BADJ` never set, exit 0"), ""),
346
- ],
347
- [
348
- "a sentence is spliced INSIDE the prescription",
349
- SAFE_FORM,
350
- (t) => t.replace(phrase("or inline the assignments literally"), "or, where the harness is short enough to read at a glance and nobody is watching, inline the assignments literally"),
351
- ],
352
- ];
353
-
354
- for (const [name, getSeat] of SEATS) {
355
- test(`${name}: the pins refuse each mutation and accept a reflow`, () => {
356
- const live = getSeat();
357
- for (const [what, pin, mutate] of REJECTS) {
358
- const mutant = mutate(live);
359
- assert.notEqual(mutant, live, `the "${what}" mutation did not change ${name} — the pin is measured against text that is no longer there`);
360
- assert.doesNotMatch(mutant, pin, `${name} still matches with ${what} — that pin does not pin`);
361
- }
362
- assert.match(rewrap(live), REFUTER_CONTROL, `${name}: a reflow reds the control pin — these refuse drift, not layout`);
363
- assert.match(rewrap(live), SAFE_FORM, `${name}: a reflow reds the invocation-form pin`);
364
- assert.match(rewrap(live), PORTABILITY, `${name}: a reflow reds the portability pin`);
365
- });
366
- }
367
-
368
- test("the fix-applier seat's pins refuse the same mutations and accept a reflow", () => {
369
- const live = fixApplierMutationRule();
370
- for (const [what, pin, mutate] of REJECTS) {
371
- if (pin === REFUTER_CONTROL) continue; // that wording is the refuters'; this seat states the rule in its own voice
372
- const mutant = mutate(live);
373
- assert.notEqual(mutant, live, `the "${what}" mutation did not change the fix-applier seat`);
374
- assert.doesNotMatch(mutant, pin, `the fix-applier seat still matches with ${what} — that pin does not pin`);
375
- }
376
- assert.match(rewrap(live), SAFE_FORM, "the fix-applier seat: a reflow reds the invocation-form pin");
377
- });
378
-
379
- test("the controller's justification pins refuse a stripped reproduction and accept a reflow", () => {
380
- const live = justification();
381
- const repro = span(
382
- `zsh -c 'cfg="SETB=1 BADJ=1"; env $cfg sh ./probe.sh' # BADJ=[unset] SETB=[1 BADJ=1]`,
383
- 4,
384
- `bash -c 'cfg="SETB=1 BADJ=1"; env $cfg sh ./probe.sh' # BADJ=[1] SETB=[1]`,
385
- );
386
- const controlLineDeleted = live.replace(phrase(`bash -c 'cfg="SETB=1 BADJ=1"; env $cfg sh ./probe.sh' # BADJ=[1] SETB=[1]`), "");
387
- assert.notEqual(controlLineDeleted, live, "the reproduction's bash line is no longer where this mutation looks for it");
388
- assert.doesNotMatch(controlLineDeleted, repro, "the reproduction still matches with its control line deleted — a one-shell transcript proves nothing about word-splitting");
389
- const gate = span(
390
- "a negative result is admitted only together with its **positive control**",
391
- 200,
392
- "the child's output differing with the injection present versus absent or the child echoing the injected value back",
393
- 120,
394
- "No control → the cell is unrun: re-run it, and never record it as a negative",
395
- );
396
- assert.doesNotMatch(
397
- live.replace(phrase("No control → the cell is unrun: re-run it, and never record it as a negative"), "Prefer a control."),
398
- gate,
399
- "the admission gate still matches once the refusal is softened to a preference — a gate that only recommends is not the gate #990 asked for",
400
- );
401
- // The reproduction is a fenced block whose alignment is load-bearing to the
402
- // eye but not to the pin, so the reflow row here rewraps the PROSE pins only.
403
- assert.match(rewrap(live), gate, "a reflow reds the admission-gate pin");
404
- });