@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,269 +0,0 @@
1
- // #558. The "Verify every reported SHA" guard is the ONLY consuming-side rule
2
- // for `verify-sha.sh`, and it named exactly one outcome — "Not reachable →
3
- // flag" — so a controller following it literally had no instruction for exit 2,
4
- // "the question could not be answered". In `sh`, both `cmd || handle` and
5
- // `if cmd; then` treat 1 and 2 alike, so the natural reading files an
6
- // unanswerable probe under "not reachable" by accident rather than by rule.
7
- //
8
- // That accident is fail-safe TODAY only because exit 2 emits no JSON at all: a
9
- // controller cannot read `reachable:true` off it. It is not fail-safe in the
10
- // other direction — an unanswerable probe recorded as a real "not reachable"
11
- // verdict flags a member for a stray commit that was never demonstrated, and
12
- // holds its ticket out of the pool "until the maintainer rules" over a failure
13
- // that a re-run would have cleared.
14
- //
15
- // The pins below are the rules the corrected guard has to carry, each checked
16
- // against `verify-sha.sh` itself before being written down:
17
- //
18
- // 1. the three exit codes are named where the command is named, the inline
19
- // convention `next-ticket/SKILL.md` already uses for `inflight.sh`;
20
- // 2. exit 1 KEEPS its verdict — the flag, the withheld enqueue and the
21
- // maintainer's ruling still hang off "not reachable", and exit 2 is not
22
- // allowed to drift into that gap. This is the pin against the fix
23
- // overshooting: a guard that teaches "non-zero is unanswerable" destroys
24
- // the one distinction the script exists to make;
25
- // 3. exit 2 gets its own remedy — read stderr, re-run, escalate on repeat —
26
- // and exit 1's remedy is not allowed to drift into THAT gap;
27
- // 4. the exit-2 branch is stated as a PROPERTY of the exit code, not as a
28
- // list of causes. Every `die()` in the script produces the identical
29
- // caller-visible shape (no stdout, cause on stderr), so a cause list adds
30
- // nothing a controller can act on differently — and it rots on the next
31
- // commit that adds or removes one. Test 4 forbids the tally outright.
32
- //
33
- // Rule 4 is why this file pins no number. `verify-sha.sh`'s exit-2 paths have
34
- // already grown twice — the `merge-base --is-ancestor` guard, then #119's three
35
- // JSON-escaping guards — and the issue that asked for this fix was filed
36
- // before the last of those landed: its count was accurate when written, and
37
- // stale by the time this fix was. A number written here would age the same way.
38
- //
39
- // THE CEILING, same as inflight-exit2-prose.test.mjs: these are PRESENCE pins
40
- // over a bounded slice, plus two adjacency pins. Text spliced INSIDE a pinned
41
- // phrase reddens them; a whole new sentence appended after one, carving out an
42
- // exception, does not. A reflow (line wraps, `**bold**` moved) stays green.
43
- import { test } from "node:test";
44
- import assert from "node:assert/strict";
45
- import { readFileSync } from "node:fs";
46
- import { join } from "node:path";
47
- import { between, phrase } from "./prose-pin.mjs";
48
-
49
- const REPO = join(import.meta.dirname, "..");
50
- const read = (...p) => readFileSync(join(REPO, ...p), "utf8");
51
- const RUN_TEAM = read("skills", "run-team", "SKILL.md");
52
- const SCRIPT = read("scripts", "verify-sha.sh");
53
-
54
- // Bounded at both ends and small: the guard, not the `## Guards` section. A
55
- // slice wide enough to reach its neighbours is satisfied by their vocabulary.
56
- const guard = () =>
57
- between(RUN_TEAM, "**Verify every reported SHA.**", "**Never `--delete-branch`", "run-team/SKILL.md");
58
-
59
- // Bold moves, and these pins must not care. `**` is allowed at ANY word
60
- // boundary inside a pinned phrase: markdown emphasis slides around a sentence
61
- // without changing what the sentence says, so a pin that reds on a moved `**`
62
- // pins the formatting rather than the rule. One `\*{0,2}` per pin — the first
63
- // spelling — closed only the seam its own instance happened to use, and every
64
- // other seam still reddened. Measured: `Exit 2 is **not a verdict**` and `Not
65
- // reachable **(exit 1)**` are both what an editor emphasising this guard
66
- // writes, and both were false reds. The tolerance goes INSIDE the gap
67
- // lookaheads too, or `**Exit** 2` drifts straight through the exclusion the
68
- // gap exists to enforce — measured green before this was widened.
69
- const B = String.raw`\*{0,2}`; // an optional bold marker at one seam
70
- const S = String.raw`\*{0,2}\s+\*{0,2}`; // a word gap that tolerates one
71
- const EXIT2_VERDICT = String.raw`[Ee]xit${S}2${S}is${S}not${S}a${S}verdict`;
72
-
73
- // The guard's required annotation, in the form the guard writes it. Shared, so
74
- // the pin below and the assertion that the annotation survives that pin are
75
- // provably about the same string rather than two copies that can drift apart.
76
- const ANNOTATION = "`# 0 reachable, 1 not reachable, 2 unanswerable`";
77
-
78
- // The tally is the rot. A written count is false the moment a `die()` is added
79
- // or removed, and this script's set has already changed twice.
80
- //
81
- // Scoped to the COUNTED NOUN, not to a bare number near "exit 2": the annotation
82
- // this same guard carries is `2 unanswerable`, which is the exit code's meaning
83
- // and must stay. Measured — the first spelling of this pin reddened on the
84
- // guard's own correct text, and `reachable`/`unanswerable` are what the exit
85
- // codes MEAN, so neither can ever go in this list.
86
- //
87
- // What separates a tally from prose is the NUMBER, not the noun: in a tally the
88
- // number counts something, and in this guard's correct sentences the number is
89
- // an exit code with `exit` in front of it. The lookbehind refuses a number the
90
- // exit token directly precedes, and that is what carries the noun list —
91
- // measured, the spelling this replaces reddened on `Escalate exit 2 on all
92
- // paths by pinging the maintainer`, and `ways?` could not be admitted at all
93
- // because it reddened on `Treat exit 2 the same way in all cases`. Both are
94
- // prose. Both are green here, and every counted-noun spelling below stays red.
95
- //
96
- // The separator inside the lookbehind takes a hyphen as well as a space, or
97
- // `exit-2` — how this repo writes the branch — reads as a count and reds. It
98
- // takes `**` on either seam for the reason `S` does: a lookaround cannot see a
99
- // bold-split token, so `**Exit** 2` would walk straight through it. The
100
- // optional `code`/`codes` token is in for the reason the hyphen is: `exit code
101
- // 2` names the same exit code, and measured, without that token `Treat exit
102
- // code 2 the same way in all cases.` reddened while `Treat exit 2 …` did not.
103
- // The seam tolerance repeats around it, or `**exit code** 2` walks through the
104
- // same way `**Exit** 2` would. Case comes from the `i` flag, and `[Ee]` keeps
105
- // the exclusion working if that flag is ever narrowed — an exclusion that stops
106
- // firing is a green over the rot itself.
107
- //
108
- // The nouns this change adds are here because each was measured missing, not
109
- // guessed: every one of them let `three unanswerable <noun> here` through green
110
- // against the spelling this replaces. The nouns already in that spelling stay
111
- // as they are; the loop that pins every noun carries the per-noun history.
112
- //
113
- // THE CEILING: this is still a list, so a counted noun nobody has thought of
114
- // still passes. The filler window between the number and the noun also stays
115
- // narrow — `three distinct kinds of ways` overruns it and is green, on this
116
- // spelling and on the one it replaces. Widening that window is what let a noun
117
- // reach an exit code in the first place, so it stays as it is.
118
- //
119
- // The exclusion is ADJACENCY, so correct prose that puts anything between the
120
- // exit token and its number still reds: measured, `Treat exit codes 1 and 2 the
121
- // same way in all cases.` reds here and was green against the spelling this
122
- // replaces, because `and` sits where the exit token would have to be. No
123
- // lookbehind reaches that one — it is a false red that admitting `ways?`
124
- // opened, and this spelling does not close it.
125
- const TALLY = new RegExp(
126
- String.raw`(?<![Ee]xit(?:\*{0,2}[-\s]+\*{0,2}codes?)?\*{0,2}[-\s]+\*{0,2})` +
127
- String.raw`\b(?:two|three|four|five|six|seven|eight|nine|ten|\d+)\s+(?:\w+[-\s]+){0,2}` +
128
- String.raw`(?:paths?|causes?|cases?|reasons?|branches|conditions?|outcomes?|scenarios?|situations?|types?|ways?|(?:failure\s+)?modes?)\b`,
129
- "i",
130
- );
131
-
132
- test("the guard names the script's exit codes where it names the command", () => {
133
- assert.match(guard(), phrase(ANNOTATION));
134
- });
135
-
136
- test("exit 1 keeps the verdict — the flag, the held enqueue and the maintainer's ruling", () => {
137
- // ADJACENCY, not three presence pins: each clause on its own survives the
138
- // subject being swapped to exit 2, which is the overshoot this guards.
139
- // `[Ee]xit 2` excluded from the gap so the two branches cannot merge into
140
- // one. The character class is load-bearing, not decoration: a drifting
141
- // sentence that opens on the code capitalises it, which a bare `exit` misses.
142
- assert.match(
143
- guard(),
144
- new RegExp(
145
- String.raw`[Nn]ot${S}reachable${B}\s*${B}\(exit${S}1\)${B}\s*${B}→\s*${B}flag` +
146
- String.raw`(?:(?!${B}[Ee]xit${S}2)[\s\S]){0,200}?until${S}the${S}maintainer${S}rules`,
147
- ),
148
- "the not-reachable branch no longer binds exit 1 to flag/hold/maintainer-rules, or exit 2 has drifted into that gap — an unanswerable probe must never spend a maintainer's ruling",
149
- );
150
- });
151
-
152
- test("exit 2 is not a verdict and carries its own remedy", () => {
153
- assert.match(guard(), new RegExp(EXIT2_VERDICT));
154
- // Same adjacency shape, mirrored: exit 1's remedy must not drift into the
155
- // exit-2 gap either. Re-running a genuine "not reachable" hides a stray
156
- // commit behind a probe that answers the same way every time.
157
- assert.match(
158
- guard(),
159
- new RegExp(EXIT2_VERDICT + String.raw`(?:(?!${B}[Ee]xit${S}1)[\s\S]){0,400}?re-run`),
160
- "the exit-2 branch no longer tells the controller to re-run, or exit 1 has drifted into its gap",
161
- );
162
- assert.match(guard(), phrase("never record it as a stray commit"));
163
- });
164
-
165
- test("the exit-2 branch is stated as a property of the code, never as a tally of causes", () => {
166
- // The property that makes one rule cover every cause: the caller cannot tell
167
- // them apart, so it must key on the code.
168
- assert.match(guard(), phrase("no JSON on stdout"));
169
- assert.match(guard(), phrase("the cause on stderr"));
170
-
171
- // Whether the PIN works is settled before the guard is judged by it, because
172
- // an assertion that fails masks every one after it and the messages are not
173
- // interchangeable. Measured: with the pin's noun list widened to reach the
174
- // annotation, the guard's own verdict fired first and reported that a count
175
- // had been written into the guard — false, about text that is correct and
176
- // required to be there. The honest message existed and never ran.
177
- //
178
- // What the pin CATCHES, asserted rather than inferred: every assertion over
179
- // the guard here is a `doesNotMatch`, and those are green against a regex
180
- // that matches nothing. Measured — a pin emptied to `/$^/` left this whole
181
- // file green before these landed, guard verdict included.
182
- //
183
- // The spellings are the counted nouns that would express a tally in this
184
- // guard, each measured to have passed green before it was covered.
185
- for (const noun of [
186
- "paths",
187
- "causes",
188
- "cases",
189
- "reasons",
190
- "branches",
191
- "failure modes",
192
- "modes",
193
- "conditions",
194
- "outcomes",
195
- "scenarios",
196
- "situations",
197
- "types",
198
- "ways",
199
- ]) {
200
- assert.match(
201
- `There are three unanswerable ${noun} here.`,
202
- TALLY,
203
- `the tally pin stopped reading a count spelled with "${noun}" — that is the rot rule 4 forbids, wearing a word the pin no longer sees`,
204
- );
205
- }
206
- // And what it must REFUSE to catch. Every widening of this pin risks
207
- // reddening correct text, and correct text here is number-adjacent by
208
- // construction — the guard names exit codes for a living. In each of these
209
- // the number is an exit code, not a count, which is the property the pin
210
- // keys on; the hyphen spelling is in because this repo writes the branch
211
- // that way and a whitespace-only exclusion reds on it, and the `exit code`
212
- // spellings are in because the exclusion has to carry across that token and
213
- // its bold seam — both measured red before it did.
214
- for (const correct of [
215
- "Treat exit 2 the same way in all cases.",
216
- "Escalate exit 2 on all paths by pinging the maintainer.",
217
- "Escalate exit-2 on all paths by pinging the maintainer.",
218
- "Treat **Exit** 2 the same way in all cases.",
219
- "Treat exit code 2 the same way in all cases.",
220
- "Treat **exit code** 2 the same way in all cases.",
221
- ]) {
222
- assert.doesNotMatch(
223
- correct,
224
- TALLY,
225
- `the tally pin reddens on correct prose: "${correct}" states no count — the number in it is an exit code, and a pin that cannot tell those apart fires on edits that are right`,
226
- );
227
- }
228
- // The annotation keeps its own message rather than joining the sentences
229
- // above: what goes wrong here is a noun list reaching a REQUIRED string, and
230
- // naming the two words that can never join that list is what sends the reader
231
- // to the fix instead of to the guard.
232
- assert.doesNotMatch(
233
- ANNOTATION,
234
- TALLY,
235
- "the tally pin's noun list now reaches the guard's own required annotation — `reachable` and `unanswerable` are what the exit codes MEAN, not a count of causes",
236
- );
237
-
238
- // Only now the guard itself, judged by a pin already shown to discriminate.
239
- assert.doesNotMatch(
240
- guard(),
241
- TALLY,
242
- "a count of exit-2 paths has been written into the guard — state the property instead; the next `die()` added to verify-sha.sh falsifies the number",
243
- );
244
- });
245
-
246
- test("verify-sha.sh still declares the exit codes the guard quotes", () => {
247
- // Cross-file coupling, otherwise invisible: the guard's annotation is a copy
248
- // of the script's contract. If the script's codes change, the doc lies and
249
- // nothing else says so.
250
- assert.match(SCRIPT, phrase("Exit 0 reachable, 1 not reachable, 2 the question could not be answered"));
251
- // Every exit-2 path is the same `die`, which is what lets one rule cover all
252
- // of them. A second exit-2 spelling would need the guard revisited.
253
- assert.match(SCRIPT, /^die\(\)\s*\{[^}]*exit 2;?\s*\}/m);
254
- // Comment lines stripped first: this script is two-thirds prose about its own
255
- // exit codes, and counting the raw substring reds on a comment that merely
256
- // MENTIONS exit 2 — with a message sending the reader after a code path that
257
- // does not exist (measured). `\b` also stops `exit 22` from counting. Whole
258
- // comment lines only, never a trailing `#`: cutting at one would let a `#`
259
- // inside a quoted string hide a genuine second exit, and a missed exit
260
- // defeats the assertion, where a comment it still trips is merely loud.
261
- //
262
- // No null guard: the `die()` pin above carries this same `exit 2` literal on a
263
- // line that is not a comment, so reaching here means a match already exists.
264
- assert.equal(
265
- SCRIPT.replace(/^\s*#.*$/gm, "").match(/\bexit 2\b/g).length,
266
- 1,
267
- "verify-sha.sh grew a second way to exit 2 — the guard's single rule covers every cause only because `die()` is the sole one",
268
- );
269
- });