@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,300 +0,0 @@
1
- // Pins the run-team prose that makes fleet-tick.mjs reachable. The script is
2
- // inert if nothing invokes it: #3's failure was not a missing computation, it
3
- // was a correct table nobody consulted under a merge-side event storm, and a
4
- // reconcile the event loop never names is that failure with an extra file.
5
- //
6
- // THE CEILING EVERY PIN HERE SHARES, same as review-path-default.test.mjs:
7
- // these prove a phrase is PRESENT. None can prove it is not NEGATED — a
8
- // sentence inserted inside the slice granting the opposite reads as fine to all
9
- // of them. Read each as "not vacuous to rewording", never as "this rule cannot
10
- // be subverted".
11
- import { test } from "node:test";
12
- import assert from "node:assert/strict";
13
- import { readFileSync } from "node:fs";
14
- import { join } from "node:path";
15
- import { between as section, phrase } from "./prose-pin.mjs";
16
-
17
- const REPO = join(import.meta.dirname, "..");
18
- const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
19
-
20
- // SLICE SIZE is what does the anchoring. A regex over a whole section is
21
- // satisfied by incidental prose elsewhere in it, and an unbounded slice runs to
22
- // EOF where the red-flag list restates half of this vocabulary — enough to keep
23
- // every assertion below green with the section deleted outright.
24
- // The tick instruction only, ending where the next standing instruction
25
- // begins. Widened to the whole Phase 3 loop it would be satisfied by the wake
26
- // bullets' own mentions of the tick, which say nothing about the script.
27
- const tickBlock = () =>
28
- section(RUN_TEAM, "**Every wake ends in the tick.**", "**Own the CI waits.**", "run-team tick block");
29
-
30
- // The six counts a caller used to state (#1803 deleted them, spec 2026-09-24
31
- // § 6 §1). Any one of them back in the block is a controller told to supply a
32
- // number the tick now refuses as an unknown flag — exit 2 on every wake.
33
- const DELETED_FLAGS = ["--implementers", "--reviewers", "--merge-bots", "--pool", "--reviews-ready", "--merge-holds"];
34
-
35
- test("the tick block names the script and only the flags it still takes", () => {
36
- const s = tickBlock();
37
- assert.match(s, /fleet-tick\.mjs/);
38
- // The three configuration flags that survived, individually: a cap passed
39
- // from `$ARGUMENTS` and the review bound are the only things a caller says.
40
- for (const flag of ["--implementer-cap", "--reviewer-cap", "--max-reviews"]) {
41
- assert.ok(s.includes(flag), `tick block does not name ${flag}`);
42
- }
43
- // A lookahead after the name, so `--reviewer-cap` never reads as `--reviewers`
44
- // and `--pool` never matches inside a longer word.
45
- for (const flag of DELETED_FLAGS) {
46
- assert.doesNotMatch(s, new RegExp(`${flag}(?![\\w-])`), `tick block still names ${flag}, which fleet-tick.mjs refuses since #1803`);
47
- }
48
- });
49
-
50
- test("the tick block says the tick reads the run itself, and nobody states a count", () => {
51
- // Inverted from the caller-stated era. A reader told the counts are theirs to
52
- // state hunts for flags that no longer exist; one told nothing hand-edits a
53
- // row to make the tick see what it wants. The ledger is the input, written
54
- // through ledger.mjs, and a token the tick cannot read is a refusal.
55
- const s = tickBlock();
56
- assert.match(s, phrase("nobody states a count"));
57
- assert.match(s, /`\.fleet\/ledger\.md`/);
58
- assert.match(s, /`\.fleet\/shortlist\.json`/);
59
- assert.match(s, phrase("refuses rather than guessing"));
60
- assert.doesNotMatch(s, /refuses rather than\s+defaulting them/, "the block still says the live counts are the controller's to state");
61
- });
62
-
63
- // The rule itself, bounded to its own paragraph.
64
- const maxReviewsPair = () =>
65
- section(RUN_TEAM, "**`--max-reviews <n>`", "\n\n", "run-team --max-reviews rule");
66
-
67
- test("--max-reviews defaults to the reviewer cap, and omp leaves it there", () => {
68
- const region = maxReviewsPair();
69
- assert.match(region, phrase("Leave it at its default"));
70
- assert.match(region, phrase("task.maxConcurrency"));
71
- assert.doesNotMatch(region, /--max-reviews \d/, "the rule now hard-codes a numeric bound — the point of leaving it at its default is that no caller passes one");
72
- });
73
-
74
- test("the record-before-tick table names every wake, each with what it records", () => {
75
- // Spec 2026-09-24 § 6 §7. The table IS the edge list now: a wake missing from
76
- // it is a wake that records nothing and so is invisible to the tick, which
77
- // reads only the ledger. Row by row, each by its wake and its record.
78
- const table = section(RUN_TEAM, "| Wake | Record, then tick |", "\n\n", "record-before-tick table");
79
- const rows = table.split("\n").filter((l) => l.startsWith("| ") && !l.startsWith("| Wake"));
80
- const WAKES = [
81
- ["Implementer report", ["verify-sha.sh", "settle impl-<N>=PR#<M>", "=bailed"]],
82
- ["Review workflow notification / `review-pr-<n>` report", ["<scratch>/review-<pr>.json", "reviewed=<head>:"]],
83
- ["Fix-applier report", ["settle fix-pr-<M>=", "ruled"]],
84
- ["Finisher report", ["settle finisher-pr-<M>=labelled"]],
85
- // #2083: a halt is its own outcome, escalated on the PR itself, then resolved by cause.
86
- ["Finisher report (halted)", ["settle finisher-pr-<M>=halted:<cause>", "gh pr comment <M>", "**Resolving a finisher halt**"]],
87
- ["Finisher report (failed / killed)", ["settle finisher-pr-<M>=failed", "**Resolving a finisher that died**"]],
88
- ["Label seen (persistent Monitor)", ["nothing to record"]],
89
- ["CI run terminal", ["ci=<run-id>:<attempt>:<conclusion>", "finisher gate"]],
90
- ["Merge-bot pass report", ["held-behind:#<lower>", "settle merge-bot-<n>=done", "reap.sh --apply"]],
91
- ["Drain", ["ledger.mjs drain", "settle impl-<N>=released"]],
92
- ["Heartbeat", ["nothing to record"]],
93
- ];
94
- assert.equal(rows.length, WAKES.length, `the table has ${rows.length} wake rows, not the ${WAKES.length} the spec names`);
95
- for (const [wake, records] of WAKES) {
96
- const row = rows.find((r) => r.startsWith(`| ${wake} |`));
97
- assert.ok(row, `the record-before-tick table has no "${wake}" row`);
98
- for (const rec of records) assert.ok(row.includes(rec), `the "${wake}" row no longer records ${rec}`);
99
- }
100
- // What follows the table: the tick, every printed line acted on, the beat.
101
- assert.match(section(RUN_TEAM, "| Heartbeat |", "\n- **", "after the table"), phrase("act on every line it prints, and arm the beat"));
102
- });
103
-
104
- test("the tick block admits no wake covers a drained queue, and says whose case that is", () => {
105
- // A reader who takes the wakes for the whole cure stops looking for the
106
- // drained-queue case they cannot reach. The pointer is the part that must not
107
- // rot — an admission with nowhere to go is how #3 lost item 2.
108
- const s = tickBlock();
109
- assert.match(s, /none\s+covers a fully drained queue/);
110
- assert.match(s, /fleet-heartbeat\.mjs/);
111
- });
112
-
113
- // Both merge-side wakes, each sliced to its own bullet — the shared vocabulary
114
- // makes a section-wide match worthless here.
115
- test("the merge-bot-pass-done wake records, reaps, then ticks", () => {
116
- const bullet = section(RUN_TEAM, "- **Merge-bot pass reports done**", "\n- **The run ends", "merge-bot-done wake");
117
- assert.match(bullet, /reap\.sh --apply/);
118
- assert.match(bullet, /run the tick/);
119
- });
120
-
121
- test("the CI-terminal wake runs the tick", () => {
122
- const bullet = section(RUN_TEAM, "- **Monitor: CI run completes**", "\n- **A fix-applier reports", "CI-terminal wake");
123
- assert.match(bullet, /run the tick/);
124
- });
125
-
126
- // The queue-depth table's own slice, ending at the `/triage` note that follows
127
- // it. Anchored to the section heading instead, the pointer would be satisfied
128
- // by the Phase 3 block above, which lives in the same file.
129
- const queueDepthTable = () =>
130
- section(RUN_TEAM, "**Do not re-derive this by hand", "`/triage` is user-invoked only", "queue-depth table");
131
-
132
- test("the queue-depth table points at the executable reconcile", () => {
133
- const s = queueDepthTable();
134
- assert.match(s, /fleet-tick\.mjs/);
135
- assert.match(s, /computed, not remembered/);
136
- });
137
-
138
- test("the queue-depth table keeps the implementer row's four holds above its rows", () => {
139
- // The one ordering the script encodes that the table cannot show: implementers()
140
- // returns a HOLD for a drain, a tier mismatch, an unchecked tier or a saturated
141
- // review side before it ever reaches a PULL. A table read as authoritative
142
- // without them Pulls under a hold. All four, each by the ACTION string the tick
143
- // prints.
144
- const s = queueDepthTable();
145
- assert.match(s, /Four\s+holds\s+outrank\s+every\s+row/);
146
- for (const hold of ["`HOLD (draining)`", "`HOLD (tier mismatch impl-<N>)`", "`HOLD (tier unchecked impl-<N>)`", "`HOLD (review side saturated)`"]) {
147
- assert.ok(s.includes(hold), `the queue-depth table no longer names ${hold} above its rows`);
148
- }
149
- });
150
-
151
- test("the queue-depth table's empty row suggests /triage and asks nobody to tick (#1804)", () => {
152
- // Supply is automatic (ADR 0013): the old pool-0 rows asked the maintainer to
153
- // tick a multi-select that no longer exists. Exactly one row answers an empty
154
- // shortlist after the tick's own refresh, and it is the tick's own string.
155
- const s = queueDepthTable();
156
- assert.match(s, /\|\s*0 after that refresh\s*\|\s*`SUGGEST \/triage, hold idle`\s*\|/);
157
- assert.doesNotMatch(s, /ask the maintainer to tick/, "the queue-depth table asks the maintainer to tick — phase 0's multi-select is retired (ADR 0013)");
158
- });
159
-
160
- test("the review-backlog definition states what the script actually counts", () => {
161
- // The gate's input. Left as the narrow definition alone, a controller reading
162
- // a HOLD cannot tell an over-count from a real review-bound pipeline.
163
- const def = section(RUN_TEAM, "- **review backlog**", "\n\n**Defaults: 2 implementers, 6 reviewers", "review-backlog definition");
164
- assert.match(def, /open PR without `ready-to-merge`/);
165
- // The review state now lives on the ledger (spec 2026-09-24 § 3 §7), so the
166
- // count is exact rather than a wider read held "earlier, never later": a PR
167
- // with a `review=` token is under review or reviewed, and one settled
168
- // `=failed` is owed a review again.
169
- assert.match(def, /no\s+`review=`\s+token/);
170
- assert.match(def, /`=failed`/);
171
- assert.doesNotMatch(def, /lives in your head/, "the definition still says per-PR review state lives in the controller's head — the ledger records it");
172
- // Both halves of the closing-issue clause. The predicate alone is a rule a
173
- // reader can only obey; the reason is what stops the next narrowing pass
174
- // from dropping it as a stray filter, since a PR nothing will ever review
175
- // floors the gate's input permanently rather than transiently.
176
- assert.match(def, /that closes an\s+issue/);
177
- assert.match(def, /nothing in the run can drain/);
178
- // The exemption is scoped to the chore PR THIS run authors. Unscoped, a reader
179
- // applies it to an INHERITED chore PR too — which step 0 queues for review, so
180
- // a reader counts it BY HAND. The reviewBacklog number excludes it either way:
181
- // a PR closing no issue fails the closing-issue test whichever run left it
182
- // open, so nothing here is a claim about the script's output. That under-read
183
- // is the opposite error from #590's over-read, and the narrow phrase separates
184
- // them.
185
- //
186
- // Finding 2: \s+ between every pinned word, matching this file's own
187
- // convention above. The pinned clause spans a line break in SKILL.md, so
188
- // literal spaces red on a whitespace-only reflow — a false failure naming a
189
- // regression that did not happen.
190
- assert.match(def, /never\s+one\s+a\s+PRIOR\s+run\s+left\s+open/);
191
- // The corrected half: the prose must keep saying the mechanical number
192
- // excludes such a PR, or the by-hand reading silently becomes a claim about
193
- // fleet-tick.mjs again.
194
- assert.match(def, /number\s+still\s+excludes\s+it/);
195
- assert.match(def, /BY\s+HAND/);
196
- });
197
-
198
- // The step-0 fold-in bullet only, ending where the numbered candidate scan
199
- // begins. Widened to the whole of phase 0 it would be satisfied by the
200
- // candidate-scan and in-flight bullets, which talk about queueing and review
201
- // without saying inherited PRs are in scope at all.
202
- const foldInBlock = () =>
203
- section(
204
- RUN_TEAM,
205
- "**Fold in every PR a prior run left open, before shortlisting.**",
206
- "1. **Build the Shortlist**",
207
- "run-team step-0 fold-in block",
208
- );
209
-
210
- test("the fold-in block says inherited PRs are queued before shortlisting, as ordinary review work", () => {
211
- // #1237's own review found this bullet unpinned while its sibling addition in
212
- // the same PR was pinned. Unpinned, a reword silently reverts phase 0 to
213
- // scanning ISSUES only and inherited PRs go unreviewed again — the #1222
214
- // pattern this bullet cites as its own motivation.
215
- const s = foldInBlock();
216
- assert.match(s, /before\s+shortlisting/);
217
- // The three roles individually. "Queue it for review" without them reads as a
218
- // note to self; naming them is what makes it the same pipeline as ticket work.
219
- for (const role of ["review workflow", "fix-applier", "finisher"]) {
220
- assert.ok(s.includes(role), `fold-in block does not name the ${role}`);
221
- }
222
- // The #590 tie-back is the reason the rule survives a narrowing pass: a PR
223
- // that is both unreviewable and uncounted is what strands the gate.
224
- assert.match(s, /unreviewable AND uncounted/);
225
- });
226
-
227
- // --------------------------------------------------------------------------
228
- // The heartbeat's prose — #357. It belongs in this file for the reason the
229
- // header gives: these pins exist because a reconcile nothing invokes is #3 with
230
- // an extra file, and on a drained queue the heartbeat is the ONLY thing that
231
- // invokes it. The slice is the standing instruction, ending where the CI-wait
232
- // instruction begins.
233
- const heartbeatBlock = () =>
234
- section(RUN_TEAM, "**Beat when there is nothing to do", "**Own the CI waits.**", "run-team heartbeat block");
235
-
236
- test("the event loop tells the controller to arm the beat instead of ending its turn", () => {
237
- // The entry point. Every word of the block below is unreachable if the loop
238
- // never says to run it, which is exactly how item 2 of #3 went missing.
239
- const bullet = section(RUN_TEAM, "- **Nothing to do right now**", "- **Implementer report**",
240
- "nothing-to-do event");
241
- assert.match(bullet, /do not end your turn/);
242
- });
243
-
244
- test("the heartbeat block names the script and the re-issue protocol", () => {
245
- const s = heartbeatBlock();
246
- assert.match(s, /fleet-heartbeat\.mjs/);
247
- // The partial-hold branch IS the mechanism: nothing lets
248
- // one command block a whole interval, so a reader who stops at the first line
249
- // ends the turn mid-interval and the beat dies there. Prose that names the
250
- // script without the re-issue rule is a heartbeat with one beat.
251
- assert.match(s, /re-issue this command now, do not end your turn/);
252
- assert.match(s, /one blocking call per turn/);
253
- });
254
-
255
- test("the heartbeat block says why the ceiling is bounded", () => {
256
- // Without the reason, 20 minutes reads as arbitrary and the next reader
257
- // raises it to an hour — reintroducing #3's blindness at a slower rate, which
258
- // is the one failure this design can still be tuned into.
259
- assert.match(heartbeatBlock(), /supply grows from OUTSIDE the fleet/);
260
- assert.match(heartbeatBlock(), /Do not raise it past 30\s+minutes/);
261
- });
262
-
263
- test("the heartbeat block forbids stopping on an idle queue", () => {
264
- // The unattended-overnight ruling. A beat that ends when supply empties
265
- // terminates the run at 01:00 and misses every ticket triaged after it.
266
- assert.match(heartbeatBlock(), /does not stop on idleness/);
267
- });
268
-
269
- test("the heartbeat block gives the command for a deliberate stop", () => {
270
- // #1597. Nothing else can write the reason afterwards — the mark has one
271
- // writer and that writer is this script — so a controller that never reads
272
- // the flag leaves every deliberate stop indistinguishable from a crash, and
273
- // the next run reports "no recorded reason" for a death that named itself.
274
- // The literal invocation, not just the idea: a reader who knows a stop
275
- // "should be recorded" and not how has the same nothing.
276
- const s = heartbeatBlock();
277
- assert.match(s, /--stop "budget exhausted"/);
278
- assert.match(s, /holds nothing and returns at once/);
279
- // And that skipping it is survivable, because a controller told only that
280
- // it is required will burn a turn on it while the budget it is out of runs
281
- // down. The honest cost is one degraded field, not a lost run.
282
- assert.match(s, /Skipping it is not fatal/);
283
- });
284
-
285
- test("the heartbeat block says a stall line is the PREVIOUS run and names what is stranded", () => {
286
- // Both halves are load-bearing and neither is obvious. Read as this run's
287
- // own state, the line is a controller reporting itself dead — the shape
288
- // that gets a healthy run abandoned. And a stall whose stranded tickets go
289
- // unmentioned is read as an obituary rather than as work: those tickets
290
- // keep the claim label the candidate scan excludes, so nothing else in the
291
- // run will ever surface them again.
292
- const s = heartbeatBlock();
293
- assert.match(s, /is the PREVIOUS run, never this one/);
294
- assert.match(s, /in-progress/);
295
- assert.match(s, /EXCLUDES that label/);
296
- // Detection only — the ruling this ticket's whole scope rests on. Prose
297
- // that left this open invites a controller to invent a restart, which is
298
- // the question ADR 0008 ruled on and #1724 owns.
299
- assert.match(s, /nothing restarts the run that stranded them/);
300
- });