@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,188 +0,0 @@
1
- // #1212. `git_probe`'s separator comment justified `gp_sep` as "a byte no
2
- // porcelain line or ordinary warning contains" — a property of the BYTE, and
3
- // not the property that actually holds. What holds is a property of GIT, and
4
- // only for the commands the helper is currently pointed at. That distinction
5
- // is the whole finding: `git_probe` takes `git "$@"`, nothing in its body
6
- // checks the separator's absence, and a caller pointed at output git does not
7
- // quote the same way gets a truncated `$gp_out` plus a non-numeric `$gp_rc`
8
- // fed to `return`. The review that produced it split 1-1 — one refuter
9
- // measured the corruption reproducible against a stub `git`, the other
10
- // measured it unreachable and failing closed — and the single point both
11
- // agreed on is that the comment asserted a boundary the code does not
12
- // enforce.
13
- //
14
- // Re-measured while writing the comment, git 2.50.1 (Apple Git-155):
15
- //
16
- // `status --porcelain -uall` and `--porcelain -unormal --ignored`, over a
17
- // file named `weird<0x02>file` and a chmod-000 directory `dir<0x02>name`:
18
- // zero raw 0x02 bytes, under core.quotePath true AND false. stdout C-quotes
19
- // the path (`?? "weird\002file"`); stderr renders the byte as `?`
20
- // (`warning: could not open directory 'dir?name/'`) — two different rules,
21
- // both landing outside the separator.
22
- // The SAME command with `-z`: one raw 0x02, straight through. So do
23
- // `log --format=%s` and `show <rev>:<path>`. The boundary is one flag away
24
- // from an existing call site, which is why the comment now names it.
25
- //
26
- // WHY THIS FILE EXISTS AT ALL, given the fix is comment-only. The ticket's own
27
- // thesis is that a comment asserted a boundary nothing enforced. Correcting
28
- // the prose and pinning nothing reproduces that one level up — the corrected
29
- // boundary would again rest on whoever read it last. And no behavioural test
30
- // can see this change: the script's bytes below the `#` lines are identical,
31
- // so `reap.sh` behaves identically and `reap.test.mjs` cannot tell the two
32
- // revisions apart. A prose pin is the only enforcement available here, and
33
- // the only thing in the suite that can see the mode this ticket changed.
34
- //
35
- // NOT pinned, deliberately: the corruption path itself. It is unreachable from
36
- // every existing caller — three `status --porcelain` variants protected by
37
- // git's path-quoting, and a fourth (`for-each-ref`, #1413) protected because
38
- // a refname carrying the byte cannot exist in the first place — and a
39
- // test would have to stub `git` to reach it, pinning a hypothetical rather
40
- // than a behaviour. That is the ticket's own out-of-scope ruling, and the same
41
- // reason the competing `$gp_rc` numeric guard was rejected: every call site is
42
- // shaped `if ! git_probe …; then keep …`, so a garbled exit code cannot come
43
- // back 0 and cannot turn a KEEP into a REAP. Nothing here asserts the helper's
44
- // runtime shape; `reap.test.mjs` owns that.
45
- //
46
- // THE SLICE is the run of `#` lines immediately above the `gp_sep`
47
- // declaration, bounded by CODE at both ends. `quiet-payload-prose.test.mjs`
48
- // takes the same bound at `ci-state.mjs`'s header and its own notes say why,
49
- // both halves measured under #695: in source a blank-line bound runs past the
50
- // end of the comment into live code, so a decoy pasted in the code below took
51
- // a whole suite green — and a phrase anchor sits INSIDE the prose it pins, so
52
- // every edit to that prose reads as a moved anchor and reports the wrong
53
- // fault. A one-line declaration is neither. `anchorAt` carries the
54
- // exactly-once half, so a second copy of that declaration reds here rather
55
- // than binding these pins to whichever copy comes first.
56
- //
57
- // This file names its one source by path and globs nothing, so its own text —
58
- // which quotes the old wording in the first paragraph above — is not in the
59
- // corpus and cannot satisfy or defeat the pins it carries.
60
- //
61
- // THE CEILING. These are PRESENCE pins over a bounded slice, plus one revert
62
- // guard. What they catch is a required statement gutted, or the old
63
- // property-of-the-byte wording restored. What they do NOT catch: a
64
- // differently worded restatement of the false claim, or a sentence appended
65
- // after a correct one to walk it back. They also say nothing about whether the
66
- // measurements in the comment are right — they pin that the comment
67
- // attributes the safety to git rather than to the byte, names the scope it
68
- // holds at, names each call-site group's OWN safety rule rather than one
69
- // rule for all of them, says the code does not check either invariant, and
70
- // warns the next caller off.
71
- //
72
- // Zero deps: `node --test plugin/scripts/gp-sep-invariant-prose.test.mjs`.
73
-
74
- import { test } from "node:test";
75
- import assert from "node:assert/strict";
76
- import { readFileSync } from "node:fs";
77
- import { join } from "node:path";
78
- import { phrase, runAbove, stripHashGutter } from "./prose-pin.mjs";
79
-
80
- const REPO = join(import.meta.dirname, "..");
81
- const REAP = "scripts/reap.sh";
82
- const SOURCE = readFileSync(join(REPO, ...REAP.split("/")), "utf8");
83
-
84
- // The declaration the comment documents, and the slice's lower bound.
85
- const ANCHOR = "gp_sep=$(printf '\\002')";
86
-
87
- // The `#` run immediately above the anchor, gutter stripped and flattened to a
88
- // single line: a wrapped comment breaks a sentence at the `# ` gutter, which
89
- // `phrase()`'s `\s+` does not span.
90
- //
91
- // The shared bound, not a local copy of it (#1604). `runAbove` owns the slice —
92
- // the exactly-once anchor through `anchorAt`, and the run matched only where a
93
- // `#` is a line's first token, so the bound is code at both ends rather than a
94
- // blank line that would run past the comment into the script. Only the gutter
95
- // strip is this file's: the `//` consumers of the same bound compare raw bytes
96
- // and must not have it.
97
- const separatorComment = (text) => stripHashGutter(runAbove(text, ANCHOR, REAP, "#"));
98
-
99
- const COMMENT = separatorComment(SOURCE);
100
-
101
- // Each row is one thing the comment has to say, and the acceptance criterion it
102
- // answers. Kept as a table rather than inline so the rewrap check at the foot
103
- // runs the same regexes rather than a second copy of them that could drift.
104
- const PINS = [
105
- [
106
- "attributes the safety to git's quoting, not to the byte",
107
- "git C-quotes the path",
108
- "the separator is safe because of what GIT does to a control byte in a path, which is the claim that actually holds",
109
- ],
110
- [
111
- "says the code does not check either invariant",
112
- "Nothing in the body checks either invariant",
113
- "the one point both refuters agreed on: the invariant is asserted here and enforced nowhere",
114
- ],
115
- [
116
- "names the scope the invariant holds at",
117
- "safe only for the commands this helper is currently pointed at",
118
- "an invariant with no stated scope is one a future caller inherits without knowing it exists",
119
- ],
120
- [
121
- "names the porcelain-reading call sites by an exact count, not by \"every\"",
122
- "Three call sites below read `status --porcelain`",
123
- "\"every call site\" was the false claim (#1601 review): a fourth call site, `for-each-ref`, was added by #1413 and does not read `status --porcelain` at all — the boundary has to name an exact, checkable count",
124
- ],
125
- [
126
- "names the for-each-ref call site's different safety rule",
127
- "a REFNAME, unlike a path, can never contain the byte at all",
128
- "the fourth call site is safe for a reason that has nothing to do with git quoting a path — collapsing the two mechanisms into one claim is exactly how #1601's false \"every call site\" wording happened",
129
- ],
130
- [
131
- "warns the next caller off output carrying neither guarantee",
132
- "DO NOT POINT `git_probe` AT A COMMAND WHOSE OUTPUT CARRIES NEITHER GUARANTEE",
133
- "`git_probe` takes `git \"$@\"`, so the invariant is the caller's to keep and this warning is the only thing that tells them so",
134
- ],
135
- [
136
- "keeps the `set -e` rationale it sits above",
137
- "under `set -e` a bare failing assignment aborts the subshell",
138
- "a separate, still-accurate finding (PR #1068) that shares this comment block and must survive edits to the separator paragraph",
139
- ],
140
- [
141
- "keeps the bare-assignment note that rationale is about",
142
- "never a bare `gp_o=$(...); gp_rc=$?`",
143
- "the shape the `set -e` finding is about — the rationale without it names no construct",
144
- ],
145
- ];
146
-
147
- // The guard on the guard. Every positive pin below reds on an empty slice, so
148
- // those are self-diagnosing; the revert guard is a `doesNotMatch` and would
149
- // pass vacuously over one. A moved or duplicated anchor already throws inside
150
- // `anchorAt` — this covers the remaining way the slice comes back empty, the
151
- // declaration losing the comment run above it altogether.
152
- test("the comment run above the gp_sep declaration is found at all", () => {
153
- assert.ok(
154
- COMMENT.trim().length > 0,
155
- `${REAP}: no \`#\` run sits immediately above \`${ANCHOR}\`, so the slice these pins assert over is empty and they prove nothing. Re-derive the bound — never widen it to the whole file.`,
156
- );
157
- });
158
-
159
- for (const [what, text, why] of PINS) {
160
- test(`the git_probe separator comment ${what}`, () => {
161
- assert.match(
162
- COMMENT,
163
- phrase(text),
164
- `${REAP}: the comment above \`${ANCHOR}\` no longer says "${text}". ${why} (#1212)`,
165
- );
166
- });
167
- }
168
-
169
- // The revert guard, and the half AC 1 states negatively: the comment must no
170
- // longer describe 0x02 as a byte git's output cannot contain, in any casing.
171
- // Measured false — `status --porcelain -uall -z` emits it, and so does any
172
- // command printing content rather than paths — and it is the wrong shape of
173
- // claim regardless, since it reads as a property of the byte that needs no
174
- // scope. Matched case-insensitively, unlike every positive pin above: those
175
- // are satisfied by phrase() finding the words ANYWHERE, so casing never hides
176
- // a false negative, but this is the one `doesNotMatch` in the file, and a
177
- // caller who reintroduces this exact retired clause as a sentence's opening —
178
- // this file's own prose style, see "WHY THIS FILE EXISTS", "THE SLICE",
179
- // "THE CEILING" above — capitalizes its first letter for free, which a
180
- // case-sensitive doesNotMatch would silently let back in.
181
- test("the git_probe separator comment no longer claims 0x02 is absent from porcelain output", () => {
182
- assert.doesNotMatch(
183
- COMMENT,
184
- new RegExp(phrase("a byte no porcelain line or ordinary warning contains").source, "i"),
185
- `${REAP}: the comment above \`${ANCHOR}\` is back to describing \`gp_sep\` as a byte git's output cannot contain. That states a property of the BYTE and carries no scope, so a caller pointed at `
186
- + "`status --porcelain -uall -z` (which does emit the raw byte, measured) inherits an assumption nothing checks. State what git does to a control byte in a path, and where that stops holding. (#1212)",
187
- );
188
- });
@@ -1,233 +0,0 @@
1
- // #493. Every guard protecting `ready-to-merge` sits UPSTREAM of the label —
2
- // the finisher's dispatch pin, the halt on a moved head, the worktree audit all
3
- // run before the label exists. Downstream the label is unconditional: measured
4
- // on PR #426, a finisher audited a head and labelled it, a fix-applier then
5
- // surfaced a defect, the controller approved a fix, and the label sat on a
6
- // commit nobody had audited with nothing left to go stale. #180 is the
7
- // confirmed half of the mechanism — a GitHub label does not follow the branch.
8
- //
9
- // The ruled fix is that the merge bot re-derives the head, as a REQUIREMENT
10
- // rather than bot discretion. It already held in practice — the merge bots that
11
- // merged #1090 and #1091 both re-derived every gate at the merge instant — but
12
- // it held because their dispatch prompts said so, which is precisely what this
13
- // file exists to stop being the only reason.
14
- //
15
- // THE CEILING: these are presence pins on prose. They prove the rules are
16
- // stated where their reader reaches them; they cannot prove a merge bot obeys
17
- // them, and nothing here runs `gh`.
18
- import { test } from "node:test";
19
- import assert from "node:assert/strict";
20
- import { readFileSync } from "node:fs";
21
- import { join } from "node:path";
22
- import { between, phrase } from "./prose-pin.mjs";
23
-
24
- const REPO = join(import.meta.dirname, "..");
25
- const DOC = readFileSync(join(REPO, "commands", "run-merge-bot.md"), "utf8");
26
- const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
27
-
28
- // Bounded at both ends. Unbounded to EOF, `ready-to-merge`, `head` and
29
- // `finisher` each occur freely through the per-PR sequence and the watcher
30
- // loop, so every assertion below would survive deletion of the section itself.
31
- // The end anchor is the NEXT heading — `## Per-PR sequence` again since #1806
32
- // retired the gate-proof section #966 had put between them.
33
- const labelledHead = () =>
34
- between(DOC, "## The labelled head", "## Per-PR sequence", "run-merge-bot.md");
35
-
36
- // Step 3 is the merge gate, run twice, so the head leg has to be IN it — not
37
- // in a later paragraph a reader reaches the merge without having read.
38
- const step3 = () =>
39
- between(DOC, "3. **Gate the merge with `merge-gate.mjs`", "4. `gh pr merge <pr> --merge`", "run-merge-bot.md");
40
-
41
- test("the head re-derivation is stated as a requirement, not left to bot discretion", () => {
42
- assert.match(labelledHead(), phrase("re-deriving the head is a requirement here, not bot discretion"));
43
- });
44
-
45
- test("the labelled head names why no upstream guard covers this window", () => {
46
- // Without the reason this reads as a redundant fourth check and gets deleted
47
- // as one. The two facts it rests on: the label does not move with the branch,
48
- // and every other guard runs before the label exists.
49
- assert.match(labelledHead(), phrase("A GitHub label does not follow the branch"));
50
- assert.match(
51
- labelledHead(),
52
- phrase("runs *before* the label exists, so none of them is watching this window"),
53
- );
54
- });
55
-
56
- test("the timeline read is the mechanism, keyed on the three events that move a head", () => {
57
- const s = labelledHead();
58
- assert.match(s, /issues\/<pr>\/timeline\?per_page=100/);
59
- assert.match(s, /\.event == "labeled" and \.label\.name == "ready-to-merge"/);
60
- assert.match(s, /\.event == "committed" or \.event == "head_ref_force_pushed"/);
61
- });
62
-
63
- test("the read's ordering constraint rides in the same sentence as its reason", () => {
64
- // The whole rule is WHEN. `gh pr update-branch` lands commits dated after the
65
- // label by construction — measured on this repo: #1090 (never rebased) lists
66
- // `labeled ready-to-merge` after its commits, #1091 (rebased by its merge
67
- // bot) lists three `committed` plus a `head_ref_force_pushed` after the
68
- // label. So a read taken post-rebase cannot tell the bot's own commits from a
69
- // member's. One contiguous span, so splitting the constraint away from the
70
- // command it governs reds this.
71
- assert.match(
72
- labelledHead(),
73
- phrase("Read the timeline before `gh pr update-branch` and before anything else that can move the head"),
74
- );
75
- assert.match(
76
- labelledHead(),
77
- phrase("once you have rebased this read can no longer tell your commits from someone else's"),
78
- );
79
- });
80
-
81
- // The decision rule itself — WHICH SIDE of the label line a commit has to fall
82
- // on. Everything above pins that the query is present and that a refusal
83
- // follows; nothing pinned the predicate between them. Measured on the commit
84
- // BEFORE this one: inverting `after` to `BEFORE` left this file 14/14 green,
85
- // and deleting the sentence outright left 36/36 green across both prose
86
- // suites. Inverted, the doc tells the bot to refuse the ordinary PR and
87
- // to merge #180's shape — the head this ticket exists to stop.
88
- //
89
- // One contiguous span through `**Refuse:`, not two matches: N separate matches
90
- // pin N facts and never the text between them. Verified as-of-commit on three
91
- // mutants and two controls — the two above red, so does splicing `unless the
92
- // commits are plausibly your own predecessor's, in which case proceed` between
93
- // the predicate and its verdict (the informative one: every pinned token
94
- // survives it and only the binding flips), while re-wrapping the same wording
95
- // across three lines and rewording the unpinned sentence above both stay
96
- // green. `phrase`, not a raw regex, is what makes that rewrap green.
97
- test("a commit AFTER the last label line is what the refusal keys on", () => {
98
- assert.match(
99
- labelledHead(),
100
- phrase(
101
- "A `committed` or `head_ref_force_pushed` line after the last `labeled ready-to-merge` means the head moved after the audit. **Refuse:",
102
- ),
103
- );
104
- });
105
-
106
- test("the refusal names its token, leaves the label alone, and sends a fresh finisher", () => {
107
- const s = labelledHead();
108
- assert.match(s, phrase("report `head-moved-after-label-#<pr>` and stop on that PR"));
109
- assert.match(s, phrase("Leave the label where it is"));
110
- assert.match(s, phrase("the first audit does not transfer, because it verified a different tree"));
111
- });
112
-
113
- // AC-4, the ACCEPT side. A bot that refuses whenever the labelled SHA is not
114
- // the current head must not refuse the ordinary PR. Pinned as one span
115
- // with its verdict, because a bare "this is the normal case" with the outcome
116
- // deleted is what leaves a reader guessing.
117
- test("the normal path — label applied, head unchanged — is stated as proceeding untouched", () => {
118
- assert.match(
119
- labelledHead(),
120
- phrase(
121
- "Nothing after that label line is the normal case, and it proceeds untouched** — label applied, head unchanged, merge goes ahead exactly as it did before this gate existed",
122
- ),
123
- );
124
- });
125
-
126
- // Step 3's comparison has an operand, and this section is the only place that
127
- // captures it. Step 1's `pre` exists only where step 1 runs, so a PR already
128
- // current has none — the instruction has to stand on its own read, and it has
129
- // to say the read happens BEFORE the rebase or it captures the wrong SHA.
130
- test("the pre-rebase head is recorded here, since step 3 compares against it and nothing rebuilds it", () => {
131
- const s = labelledHead();
132
- assert.match(s, phrase("Record the head before you rebase"));
133
- // `phrase`, not a raw regex: this command sits in prose, not in a fenced
134
- // block, so a hard-wrap can put a newline between any two of its words.
135
- // Measured — the raw form reddened on a same-wording rewrap of the section.
136
- assert.match(s, phrase("gh pr view <pr> --json headRefOid -q .headRefOid"));
137
- assert.match(s, phrase("on an already-current PR it is simply the head you merge"));
138
- });
139
-
140
- // The other ACCEPT-side half: the two things the gate deliberately does NOT
141
- // answer. A hand-added label reads clean here (run-team owns reviewer-only),
142
- // and a head rebased by an abandoned earlier pass refuses on purpose rather
143
- // than as a false positive. Both are the sentences a later reader would delete
144
- // as hedging, and deleting either turns a stated limit into a silent one.
145
- test("the gate declares what it does not cover, and which refusal is intended", () => {
146
- const s = labelledHead();
147
- assert.match(s, phrase("a hand-added `ready-to-merge` with no finisher behind it reads clean here"));
148
- assert.match(s, phrase("earlier, abandoned pass of this command** refuses too"));
149
- });
150
-
151
- test("step 3 re-derives the head at the merge instant, against pre or the rebase's post", () => {
152
- // The gate compares the PR head against `--pre`/`--post`, so the operands
153
- // have to be the labelled head and the bot's own rebase — any other source
154
- // for `--pre` certifies whatever head the bot read last.
155
- const s = step3();
156
- assert.match(s, phrase("`--pre` is the head you recorded at **The labelled head**; `--post` is the head step 1's rebase produced"));
157
- assert.match(s, phrase("**`head-moved-after-label`** — the PR head is neither `pre` nor `post`"));
158
- });
159
-
160
- test("step 3 says why no CI gate above it can see a push that landed during the wait", () => {
161
- // The reason is the load-bearing half: `ci-state.mjs` selects the run whose
162
- // headSha equals the CURRENT PR head (`r.headSha === prHead`), so a member's
163
- // push plus its own green run clears step 2 outright. Without this sentence
164
- // the head comparison looks like a duplicate of the CI binding and gets cut.
165
- const s = step3();
166
- assert.match(s, phrase("Any third SHA is a push that landed while you waited on CI, and no CI check can see it"));
167
- assert.match(s, phrase("`r.headSha === prHead` filter"));
168
- });
169
-
170
- // #493 AC-3, and the reason it reaches into run-team: the merge bot's refusal
171
- // stops a bad merge but costs a pass. The cheap half is upstream — the
172
- // controller not dispatching a finisher into a window a member is about to
173
- // move. Sliced to the finisher-dispatch paragraph; `question`, `outbox` and
174
- // `dispatch` all recur through a 2000+ line file.
175
- const dispatchGate = () =>
176
- between(
177
- RUN_TEAM,
178
- "**finisher** — a fresh small agent, not the fix-applier resumed.",
179
- "**A final report is not proof the member stopped.**",
180
- "run-team/SKILL.md",
181
- );
182
-
183
- test("an unanswered member question blocks finisher dispatch, with the same weight as an owed ruling", () => {
184
- const s = dispatchGate();
185
- assert.match(
186
- s,
187
- phrase(
188
- "An unanswered question from the member is an outbox item, and it blocks dispatch with the same weight as a ruling you have already made",
189
- ),
190
- );
191
- // WHY it does not feel like one is what stops it being read as a restatement
192
- // of the owed-ruling rule directly above and deleted as duplication.
193
- assert.match(s, phrase("you have decided nothing yet, so the outbox reads empty"));
194
- // Both exits, or "answer it" reads as a mandate to rule on everything.
195
- assert.match(s, phrase("tell the member you are not ruling and it should proceed on its own default"));
196
- });
197
-
198
- // The recovery the ticket asks to keep in the runbook, at the moment it
199
- // applies: the label is already on and the controller is about to approve a
200
- // push. Sliced to that paragraph — `ready-to-merge` and `finisher` are
201
- // everywhere in this file.
202
- const labelRecovery = () =>
203
- between(
204
- RUN_TEAM,
205
- "**Once the label is on, take it off before you approve any push.**",
206
- "A halt at step 1 reads identical from a bare SHA mismatch",
207
- "run-team/SKILL.md",
208
- );
209
-
210
- test("the recovery removes the label before approving, and says why messaging the bot is not the stop", () => {
211
- const s = labelRecovery();
212
- assert.match(s, phrase("removing the artifact the merge bot gates on is the reliable stop"));
213
- assert.match(s, phrase("a label has been observed holding until after an abort message arrived"));
214
- assert.match(s, phrase("dispatch a **fresh** finisher against the new head"));
215
- });
216
-
217
- // Cross-file, same hazard #447 recorded: run-team's failure table is the
218
- // controller's index of merge-bot outcomes, so a token that exists only in
219
- // run-merge-bot.md leaves the controller with a report it cannot place.
220
- const failureTable = () =>
221
- between(RUN_TEAM, "## Failure handling", "A red PR never silently becomes", "run-team/SKILL.md");
222
-
223
- test("the failure table carries the head-moved outcome and its response", () => {
224
- const s = failureTable();
225
- assert.match(s, phrase("Merge bot finds the head moved after `ready-to-merge` was applied"));
226
- assert.match(s, phrase("`head-moved-after-label-#<pr>`, PR stays queued, label untouched"));
227
- });
228
-
229
- test("the report vocabulary includes head-moved-after-label", () => {
230
- // Bounded to the Report line itself: the token survives elsewhere in the doc,
231
- // so a whole-file match would mask its removal from the vocabulary list.
232
- assert.match(DOC, /^Report merged [^\n]*head-moved-after-label-#X/m);
233
- });
@@ -1,204 +0,0 @@
1
- // A claim written into a commit body or a PR body needs its settling command
2
- // re-run at the commit that ships it, written inline beside it, because a
3
- // pushed body cannot be edited and none of the diff-scoped rules reach it. The
4
- // rule itself and the literal-text `-F` rule live in the claim-discipline block
5
- // every implementer agent body carries; run-team's SKILL.md keeps the rationale
6
- // paragraph and the two settling-command paragraphs that follow it. This file
7
- // pins both homes. The same block's anti-count rule is pinned in
8
- // `fix-applier-correction-rules-prose.test.mjs`, as one ordered span.
9
- //
10
- // Measured against `origin/main` before this file existed: no test read the
11
- // words `commit body` in `run-team/SKILL.md` at all, so the whole rule could be
12
- // deleted with the suite green.
13
- //
14
- // SHAPE. The SKILL.md slice runs from the rationale paragraph to the
15
- // `#### Fallback` heading that follows the settling-command paragraphs —
16
- // bounded at both ends, so a presence check inside it says something about
17
- // these paragraphs and not about the rest of the Reviewers section. The agent
18
- // body's block is sliced from its own lead to the commit-incrementally block
19
- // that follows it.
20
- //
21
- // THE CEILING, the same one `dispatch-block-pins-prose.test.mjs` records:
22
- // these are pins on text being PRESENT. A sentence APPENDED after a pinned one
23
- // that carves an exception out of it — "a claim already settled earlier in the
24
- // branch needs no re-run" — touches no pinned fragment and stays green here.
25
- // For the agent body that ceiling is closed elsewhere: the claim-discipline
26
- // block is verbatim dispatch text, so `dispatch-block-golden-prose.test.mjs`
27
- // holds a whole-block golden fixture of it and an appended carve-out reds
28
- // there. The SKILL.md paragraphs are ordinary prose, and stay presence-pinned
29
- // by ruling: a golden over them would red on every legitimate rewording, with
30
- // no change-control convention to make that red a review point.
31
- import { test } from "node:test";
32
- import assert from "node:assert/strict";
33
- import { readFileSync } from "node:fs";
34
- import { join } from "node:path";
35
- import { between, paragraph, phrase } from "./prose-pin.mjs";
36
-
37
- const REPO = join(import.meta.dirname, "..");
38
- const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
39
-
40
- // `**` emphasis is stripped and whitespace collapsed before matching, so a
41
- // pinned span may cross a bold boundary or a hard wrap and neither an emphasis
42
- // move nor a reflow is a failure. `phrase()` alone cannot do the first: it
43
- // escapes `*` as a regex metacharacter, which makes the exact position of a
44
- // `**` seam literal test surface, and a false red on a meaning-preserving
45
- // copy-edit is how a pin gets deleted by the next person to touch the prose.
46
- //
47
- // Only `**` is stripped, deliberately. Single `*` is a live character in this
48
- // slice — `*instead of*` italicises the word that carries the `Verified:`
49
- // rationale — so stripping it would corrupt the text rather than normalize it.
50
- // The `>` gutter strip is inert here (this rule is not a blockquote) and kept
51
- // so that quoting it into a member prompt does not red every pin below.
52
- const flatten = (s) =>
53
- s
54
- .split("\n")
55
- .map((l) => l.replace(/^>\s?/, ""))
56
- .join(" ")
57
- .replace(/\*\*/g, "")
58
- .split(/\s+/)
59
- .join(" ")
60
- .trim();
61
-
62
- const FROM = "Every implementer body carries the";
63
- const TO = "#### Fallback: hand-dispatched reviewer member";
64
- const rule = () => flatten(between(RUN_TEAM, FROM, TO, "the claim-discipline rationale and settling-command rules"));
65
-
66
- // The claim-discipline block of the implementer agent body — the hand-over
67
- // itself, since the harness injects that body as every implementer's system
68
- // prompt.
69
- const AGENT = readFileSync(join(REPO, "agents", "fleet-implementer-slow-high.agent.md"), "utf8");
70
- const discipline = () =>
71
- flatten(between(AGENT, "**Claim discipline, on every ticket:**", "Commit incrementally as you go", "the agent body's claim-discipline block"));
72
-
73
- test("the literal-path grep is forbidden AND the method that replaces it is given", () => {
74
- const r = rule();
75
- // Prohibition bound to remedy. Separately, a slice keeping "must never be a
76
- // literal-path grep" with the mutation method deleted stays green and leaves
77
- // a member told what not to run and nothing to run instead — the state the
78
- // issue was written in, where two successive greps returned two wrong
79
- // answers.
80
- assert.match(
81
- r,
82
- /must never be a literal-path grep.{0,500}?Replace the file with `MUTATED` in a throwaway copy, run the suite/,
83
- "the literal-path grep prohibition is no longer carried with the mutation method that replaces it",
84
- );
85
- // Why the grep fails, in both directions. One direction alone reads as a
86
- // precision problem a tighter pattern would fix, which is the refinement the
87
- // issue measured returning a second wrong answer.
88
- assert.match(
89
- r,
90
- /merely \*name\* it — comments included — and misses the files that build it/,
91
- "the rule no longer says a path grep both over-reports mentions and misses assembled paths — one direction alone reads as a pattern that needs tightening",
92
- );
93
- // The question the mutation actually answers, which is narrower than "reads".
94
- assert.match(
95
- r,
96
- phrase("that answers which ones depend on its contents"),
97
- "the mutation method no longer states what it settles — depending on a file's contents is a different question from naming its path",
98
- );
99
- });
100
-
101
- test("a settling command over literal text takes -F, and its zero counts only after a known match", () => {
102
- const r = rule();
103
- // #1087. The `-F` half, bound to the measured case that shows why: a
104
- // literal line holding `\s+` is read as a pattern and answers 0 against
105
- // itself. Without the case the rule reads as style, not as a false zero.
106
- assert.match(
107
- r,
108
- phrase("A settling command over literal text uses `grep -F`"),
109
- "the rule no longer tells a settling command over literal text to use grep -F",
110
- );
111
- assert.match(
112
- r,
113
- phrase("`grep -c 'settled by:\\s+x'` answers 0 against a file holding that exact line, and `grep -cF` answers 1"),
114
- "the -F rule lost the measured case it rests on — the bare grep answering 0 against its own literal line",
115
- );
116
- // The positive-control half, which the `-F` half does not imply: a command
117
- // with `-F` can still be one that never finds a match, and its zero then
118
- // settles nothing while reading as a checked absence.
119
- assert.match(
120
- r,
121
- phrase("A zero or an absence counts only after the same command, with the same flags, finds a line known to match"),
122
- "the rule no longer requires a settling command to find a known match before its zero is trusted",
123
- );
124
- assert.match(
125
- r,
126
- phrase("a command that cannot find a match settles nothing"),
127
- "the rule no longer says a command incapable of finding a match settles nothing",
128
- );
129
- // #1087's ruling: the trap is harness-independent, so the rule names no
130
- // grep implementation or harness. A tool-specific warning goes false on the
131
- // next harness while reading as the whole of the rule. Substring match, no
132
- // leading `\b` before `bsd` — `\bbsd\b` cannot match inside "FreeBSD" (no
133
- // boundary between "ree" and "BSD"), and this repo's own dev grep reports
134
- // itself as "2.6.0-FreeBSD" (measured), so that miss is not hypothetical.
135
- assert.doesNotMatch(
136
- paragraph(RUN_TEAM, "**A settling command over literal text uses `grep -F`", "the literal-text grep rule"),
137
- /ugrep|ripgrep|claude code|bsd|gnu/i,
138
- "the literal-text grep rule now names a grep implementation or harness — #1087 ruled it harness-independent",
139
- );
140
- });
141
-
142
- test("the rationale says why every implementer gets the discipline and why a body claim is settled at write time", () => {
143
- const r = rule();
144
- assert.match(
145
- r,
146
- phrase("Nothing before dispatch can see the diff, so the discipline goes to every implementer"),
147
- "the rationale no longer says why the discipline reaches every implementer rather than a selected few",
148
- );
149
- assert.match(
150
- r,
151
- phrase("A pushed commit body cannot be edited, so its claims are settled at write time"),
152
- "the rationale no longer says why a commit-body claim is settled at write time",
153
- );
154
- });
155
-
156
- test("the agent body hands every implementer the commit/PR-body rule", () => {
157
- assert.match(
158
- discipline(),
159
- phrase("Every claim in a commit body or PR body gets its settling command re-run at the commit that ships it, written inline beside the claim"),
160
- "the agent body no longer carries the commit/PR-body rule",
161
- );
162
- });
163
-
164
- test("the agent body hands every implementer the literal-text -F rule, positive control included", () => {
165
- assert.match(
166
- discipline(),
167
- phrase("A settling command over literal text uses `grep -F`, and its zero counts only after the same command, with the same flags, finds a line known to match"),
168
- "the agent body no longer tells an implementer that literal text is grepped with -F, its zero trusted only after a known match",
169
- );
170
- });
171
-
172
- test("a rewrapped rule still matches — these pins refuse drift, not reflow", () => {
173
- // The ACCEPT side. Re-wrapping this paragraph is not drift, and a pin that
174
- // reddened on it would be deleted by the next person who reflowed the file.
175
- // The fixture is DERIVED from the live text, never a quoted line: a quoted
176
- // one turns every reword into a red on the fixture guard rather than on the
177
- // pin, which is an accept control that reddens on the edits it exists to
178
- // accept.
179
- const raw = between(RUN_TEAM, FROM, TO, "the claim-discipline rationale and settling-command rules");
180
- const body = raw.replace(/\n*#*\s*$/, "");
181
- // Re-wrapped narrower than the file's ~80 columns, so every wrap point lands
182
- // somewhere different from today's. At word boundaries, not one word per
183
- // line: an unconditional break would split the slice's own opening anchor and
184
- // red this test on the anchor rather than on the pin.
185
- const words = body.split(/\s+/).filter(Boolean);
186
- const lines = words.reduce((acc, w) => {
187
- const last = acc[acc.length - 1];
188
- if (last && `${last} ${w}`.length <= 45) acc[acc.length - 1] = `${last} ${w}`;
189
- else acc.push(w);
190
- return acc;
191
- }, []);
192
- const narrow = lines.join("\n");
193
- // Load-bearing: it reds if the source is already at this width, which would
194
- // make the rewrap a no-op and this whole test vacuous.
195
- assert.notEqual(narrow, body, "the rewrap fixture no longer changes the rule's wrapping — update it");
196
- // Replacer function, not a replacement string: `$&`, `$'` and `` $` `` are
197
- // interpreted in the latter, and this slice carries a `$` today in `%b`'s
198
- // neighbourhood the moment anyone adds a shell variable to the example.
199
- const flat = flatten(between(RUN_TEAM.replace(raw, () => narrow), FROM, TO, "rewrapped rule"));
200
- assert.match(flat, phrase("A pushed commit body cannot be edited, so its claims are settled at write time"));
201
- assert.match(flat, phrase("that answers which ones depend on its contents"));
202
- assert.match(flat, phrase("A zero or an absence counts only after the same command, with the same flags, finds a line known to match"));
203
- assert.match(flat, phrase("A settling command over literal text uses `grep -F`"));
204
- });