@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,135 +0,0 @@
1
- // #258. The dictated refuter prompt orders filesystem writes — "compile it, run
2
- // the test, apply the mutation" — and named no location. Three measured
3
- // instances: a refuter's mutation matrix collided with a sibling's in a shared
4
- // scratchpad; a probe built a throwaway git repo at the maintainer's checkout
5
- // root while its own report claimed a different path; and a fixture's `cd`
6
- // silently failed, leaving the following `git` commands running in the live
7
- // checkout, where they committed an uncommitted settings.json edit.
8
- //
9
- // A fourth measured instance is deliberately NOT cited above: fix-appliers on
10
- // different PRs colliding on `unv1`/`unv2`/`unv7`/`unv11`, because finding ids
11
- // restart at 1 every review. The clause pinned below binds only the REFUTER's
12
- // own writes — it opens "Everything you write" — and #258 is refuter-shaped, so
13
- // a fix-applier's own scratch path is out of scope. Citing that failure as
14
- // motivation here would claim coverage these pins do not have.
15
- //
16
- // The instruction is quoted VERBATIM in two documents — run-team/SKILL.md's
17
- // fix-applier dispatch block, and review-and-fix.md step 2 — and neither carried
18
- // a scratch clause. A fix added to only one is the one that does not reach
19
- // whichever path a given caller takes, so both slices are pinned here.
20
- //
21
- // THE CEILING, same as fleet-tick-prose.test.mjs and issue-tracker-prose.test.mjs:
22
- // these are PRESENCE pins over a bounded slice. Every one is a single regex —
23
- // one contiguous span, or `.{0,40}` joins between anchors — so text spliced
24
- // INSIDE a pinned clause reddens them (measured both ways). What they still
25
- // cannot catch is a WHOLE NEW sentence appended AFTER the clause that carves out
26
- // an exception: nothing pins the clause's neighbourhood. A reflow of the same
27
- // words (line wraps, `**bold**` moved) stays green by design — the words are
28
- // what is pinned, not their layout.
29
- import { test } from "node:test";
30
- import assert from "node:assert/strict";
31
- import { readFileSync } from "node:fs";
32
- import { join } from "node:path";
33
- import { between, phrase } from "./prose-pin.mjs";
34
-
35
- const REPO = join(import.meta.dirname, "..");
36
- const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
37
- const REVIEW_AND_FIX = readFileSync(join(REPO, "commands", "review-and-fix.md"), "utf8");
38
-
39
- // The run-team/SKILL.md copy sits inside a nested `> > ` blockquote, so a hard
40
- // wrap can land INSIDE a phrase with the quote gutter, not whitespace, at the
41
- // break — `\s+` does not span it, `>` is not whitespace. Strip the gutter per
42
- // line and rejoin with a single space, which restores exactly the original
43
- // inter-word space at a wrap point (markdown only ever wraps AT one). Harmless
44
- // on review-and-fix.md's copy, which carries no `>` prefix to strip.
45
- function stripQuoteGutter(text) {
46
- return text
47
- .split("\n")
48
- .map((l) => l.replace(/^(>\s?)+/, ""))
49
- .join(" ");
50
- }
51
-
52
- const runTeamPrompt = () =>
53
- stripQuoteGutter(
54
- between(RUN_TEAM, "Try to REFUTE this finding", "Survives → apply it, with one hold", "run-team/SKILL.md"),
55
- );
56
- const reviewAndFixPrompt = () =>
57
- stripQuoteGutter(
58
- between(
59
- REVIEW_AND_FIX,
60
- "Try to REFUTE this finding",
61
- "That last clause is the whole mechanism",
62
- "review-and-fix.md",
63
- ),
64
- );
65
-
66
- for (const [name, getPrompt] of [
67
- ["run-team/SKILL.md", runTeamPrompt],
68
- ["review-and-fix.md", reviewAndFixPrompt],
69
- ]) {
70
- // `\s+` between every word, never a literal space — a wrap point can land
71
- // INSIDE a pinned phrase, not just between clauses, and dropped this whole
72
- // group to 4/8 the first time it was measured (see the mutation-test note
73
- // at the top of this file). The words are pinned, not the exact bytes.
74
- test(`${name}: refuter prompt names a two-level scratch path and forbids checkout writes`, () => {
75
- const prompt = getPrompt();
76
- // ONE contiguous span, not two independent `assert.match` calls. Two
77
- // regexes with no bound on the gap between them let a spliced sentence
78
- // carve an exception INTO the write-ban and stay 8/8 green — measured on
79
- // this exact pair, and the same defect PR #488 fixed in
80
- // finisher-pin-race-prose.test.mjs. The real gap here is `; the `, so
81
- // pinning it costs nothing and closes the splice.
82
- assert.match(
83
- prompt,
84
- /`<scratch>\/pr<N>\/<finding>\/`\s+and\s+nowhere\s+else;\s+the\s+checkout\s+and\s+any\s+worktree\s+are\s+never\s+write\s+targets/,
85
- "the scratch-path clause is broken — either the two-level path is gone (a refuter falls back to a generic name and collides with a sibling, or with a fix-applier on another PR, since finding ids restart at 1 every review), or the write ban is gone, or a sentence was spliced BETWEEN them carving out an exception",
86
- );
87
- });
88
-
89
- test(`${name}: refuter prompt still permits reading the PR at a pinned ref`, () => {
90
- assert.match(
91
- getPrompt(),
92
- /`git\s+show`\/`git\s+archive`\s+at\s+a\s+pinned\s+ref\s+read\s+fine\s+anywhere/,
93
- "the write ban reads as a blanket ban — a refuter that cannot read the PR's own object store cannot verify anything",
94
- );
95
- });
96
-
97
- test(`${name}: refuter prompt chains cd into the git command, never semicolon`, () => {
98
- assert.match(
99
- getPrompt(),
100
- /cd\s+"\$D"\s+&&\s+git\s+….{0,40}never.{0,40}cd\s+"\$D";\s+git\s+…/s,
101
- 'no cd-chaining rule — a fixture\'s silently failed `cd` can leave a `git` command running in the checkout, the actual failure during the PR #488 run',
102
- );
103
- });
104
-
105
- test(`${name}: refuter prompt requires a toplevel assertion around git init/commit, including the realpath remedy for macOS's /private/tmp symlink`, () => {
106
- assert.match(
107
- getPrompt(),
108
- /`git\s+rev-parse\s+--show-toplevel`.{0,40}before\s+`git\s+init`\s+it\s+must\s+NOT\s+resolve\s+to\s+the\s+repository.{0,40}`fatal:\s+not\s+a\s+git\s+repository`.{0,40}is\s+the\s+pass.{0,40}before\s+any\s+`git\s+commit`\s+it\s+must\s+resolve\s+to\s+your\s+scratch\s+path.{0,80}compare\s+resolved\s+forms.{0,60}realpath/s,
109
- "no toplevel assertion around git init/commit, or the realpath remedy for macOS's /private/tmp symlink is gone — the observed failure is the agent BELIEVING it is already in scratch and being wrong, which naming a path alone does not catch. Both halves are pinned because they have OPPOSITE expected outcomes: a single `resolves to your scratch path` guard is unsatisfiable before `git init` (a fresh scratch dir has no toplevel and exits 128), and a guard that cannot pass on the clean path gets ignored",
110
- );
111
- });
112
- }
113
-
114
- // #1150. The clause above names `<scratch>/pr<N>/<finding>/` inside the
115
- // instruction the REFUTER reads, which left the refuter to resolve it — a
116
- // child deriving its own path. The ruling is that the parent assigns it: the
117
- // fix-applier resolves the placeholder to an absolute path (its own `pr<N>`,
118
- // the finding's id) and writes that path into the refuter's prompt. That
119
- // clause sits in the lead-in the FIX-APPLIER reads, ahead of the quoted
120
- // instruction, so it is sliced from the dispatch line to the instruction's
121
- // opening words — both copies, one phrase, for this file's two-copies reason.
122
- const SUBSTITUTION =
123
- "with one substitution: resolve `<scratch>/pr<N>/<finding>/` in it to an absolute path under your own run root — `mktemp -d` once per round for `<scratch>/pr<N>/fix-XXXXXXXX/`, never bare `pr<N>`, since finding ids restart at 1 each round too — and write that absolute path into the refuter's prompt in its place; a refuter never derives its own path";
124
- for (const [name, getLeadIn] of [
125
- ["run-team/SKILL.md", () => stripQuoteGutter(between(RUN_TEAM, "In scope → dispatch ONE refuter", "Try to REFUTE this finding", "run-team/SKILL.md"))],
126
- ["review-and-fix.md", () => between(REVIEW_AND_FIX, "In scope → dispatch one refuter", "Try to REFUTE this finding", "review-and-fix.md")],
127
- ]) {
128
- test(`${name}: the fix-applier resolves the refuter's scratch path to an absolute one and writes it into the refuter's prompt`, () => {
129
- assert.match(
130
- getLeadIn(),
131
- phrase(SUBSTITUTION),
132
- "the fix-applier is no longer told to resolve `<scratch>/pr<N>/<finding>/` to an absolute path of its own and write it into the refuter's prompt — the refuter is back to deriving its own path from a placeholder",
133
- );
134
- });
135
- }
@@ -1,71 +0,0 @@
1
- // #1347, hand-off from #1294: commands/review-and-fix.md step 6 used to
2
- // document the release-label gate as CONDITIONAL — "a repo defining none of
3
- // them does not gate on one" — true before this repo had any release
4
- // pipeline to gate. #1347 ports `release-label.yml`/`release.yml`
5
- // (agent-brain's shape): `release-label.yml`'s `auto-label-bots` job adds
6
- // `patch` when no release label is present and `validate-release-label`
7
- // hard-fails on more than one, so every PR on this repo now carries exactly
8
- // one release label by the time it reaches step 6 — the conditional clause
9
- // is stale and this ticket flips it to state the gate as required.
10
- //
11
- // Cited by step NAME, not by line — this repo's own convention
12
- // (ci.yml: "a refactor that shifts that file silently re-points a line
13
- // number at unrelated code"): #1361 is in flight on this same file, inside
14
- // its Specialists section, well below step 6; this pin's slice starts and
15
- // ends inside step 6's own paragraph and cannot reach that section either
16
- // way, regardless of which lines either one currently sits on.
17
- //
18
- // Mutation-tested by hand, 2026-09-09, against a scratch copy of
19
- // commands/review-and-fix.md (never the real checkout): (1) reverting
20
- // "required on every PR" back to the old "a repo defining none of them does
21
- // not gate on one" wording reddened this file's presence pin and left the
22
- // count/label-name pins (already covered by release-label-split-prose.test.mjs)
23
- // unaffected; (2) deleting the `release-label.yml` citation entirely also
24
- // reddened it; (3) the unrelated Specialists section was untouched
25
- // throughout, confirming the slice below cannot see that far.
26
- //
27
- // CEILING: a presence pin over a bounded slice, same shape and same limits
28
- // as every other prose test here (release-label-split-prose.test.mjs's own
29
- // header states them) — this proves the required-gate clause is PRESENT in
30
- // step 6's own paragraph, not that no later edit could dilute it.
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, phrase } from "./prose-pin.mjs";
36
-
37
- const REPO = join(import.meta.dirname, "..");
38
- const REVIEW_AND_FIX = readFileSync(join(REPO, "commands", "review-and-fix.md"), "utf8");
39
-
40
- // Bounded to step 6's own paragraph — starts at the step's own opening
41
- // clause, ends at the `ready-to-merge` label command that closes its first
42
- // sentence. Never widened past that, so #1361's in-flight Specialists
43
- // section is out of this slice's reach in either direction, wherever it
44
- // currently sits.
45
- const step6ReleaseLabelClause = () =>
46
- between(
47
- REVIEW_AND_FIX,
48
- "the PR carrying exactly one release label",
49
- "gh pr edit <pr> --add-label ready-to-merge",
50
- "review-and-fix.md step 6",
51
- );
52
-
53
- test("review-and-fix.md step 6 states the release-label gate as required, not conditional on the repo defining one", () => {
54
- const slice = step6ReleaseLabelClause();
55
- assert.match(slice, phrase("required on every PR"));
56
- assert.match(slice, phrase("release-label.yml"));
57
- assert.match(slice, phrase("auto-adds `patch` when none is present and hard-fails on more than one"));
58
- });
59
-
60
- test("review-and-fix.md step 6 no longer states the old conditional wording", () => {
61
- const slice = step6ReleaseLabelClause();
62
- assert.doesNotMatch(slice, phrase("a repo defining none of them does not gate on one"));
63
- });
64
-
65
- test("review-and-fix.md step 6 still names the exact three release labels, unchanged by the flip", () => {
66
- const slice = step6ReleaseLabelClause();
67
- assert.match(slice, phrase("patch"));
68
- assert.match(slice, phrase("minor"));
69
- assert.match(slice, phrase("major"));
70
- assert.match(slice, phrase("counting only those three"));
71
- });
@@ -1,184 +0,0 @@
1
- import { test } from "node:test";
2
- import assert from "node:assert/strict";
3
- import { readFileSync } from "node:fs";
4
- import { join } from "node:path";
5
- import { between, phrase } from "./prose-pin.mjs";
6
-
7
- // #375. A `gh pr create --label patch` that exceeds the caller's tool timeout is
8
- // backgrounded with the PR ALREADY OPEN and the label unapplied, and a timeout
9
- // carries no exit status for anything downstream to react to. Measured live: the
10
- // member noticed only because it happened to re-read the labels afterwards.
11
- //
12
- // Two independent guards, because they fail at different points. Splitting the
13
- // create gives the label write its own exit status, so it fails loudly at
14
- // creation; the finisher's assertion catches the loss wherever it happened,
15
- // including on a hand-created PR. Neither subsumes the other, so each is pinned
16
- // separately here.
17
- //
18
- // Known ceiling: these are presence pins over bounded slices, so they hold the
19
- // wording and its location, not the absence of a later carve-out — the same
20
- // ceiling `member-prompt-prose.test.mjs` records for its own slice.
21
- const REPO = join(import.meta.dirname, "..");
22
- const read = (...p) => readFileSync(join(REPO, ...p), "utf8");
23
-
24
- const NEXT_TICKET = read("skills", "next-ticket", "SKILL.md");
25
- const RUN_TEAM = read("skills", "run-team", "SKILL.md");
26
- const REVIEW_AND_FIX = read("commands", "review-and-fix.md");
27
-
28
- const step7 = () =>
29
- between(NEXT_TICKET, "## 7. When the sizing-a-ticket path reports done", "## Red flags", "next-ticket/SKILL.md step 7");
30
-
31
- // The member reads the implementer agent body verbatim — its system prompt
32
- // since #1804 moved the blocks there out of run-team's phase 2
33
- // (spec 2026-09-24 § 2 Decision 2); the same slice `member-prompt-prose.test.mjs`
34
- // takes, for the same reason.
35
- const memberBlocks = () => read("agents", "fleet-implementer-slow-high.agent.md").split("---").slice(2).join("---");
36
-
37
- const finisherLabelDuty = () =>
38
- between(RUN_TEAM, "Add `ready-to-merge`", "A halt at step 1 reads identical from a bare SHA mismatch", "run-team finisher duty 3");
39
-
40
- test("next-ticket's step 7 writes the label with a command of its own, not a flag on the create", () => {
41
- const s = step7();
42
- // The whole command, not its first physical line: the create's body string
43
- // spans lines, so a line-anchored match never sees `--label` folded onto the
44
- // body-closing continuation — the very fold this asserts against.
45
- const create = between(s, "gh pr create", "\ngh pr edit", "step 7 create command");
46
-
47
- // The defect in one assertion: a flag on the create shares the create's fate,
48
- // and that fate is a timeout with no exit status.
49
- assert.doesNotMatch(
50
- create,
51
- /--label/,
52
- "step 7 folds `--label` back into `gh pr create` — a timed-out create then opens the PR with the label silently unapplied",
53
- );
54
- assert.match(
55
- s,
56
- /^gh pr edit .*--add-label/m,
57
- "step 7 no longer writes the release label with its own command, so the write has no exit status of its own",
58
- );
59
- });
60
-
61
- test("next-ticket says why the label write stands alone, so it is not folded back in as a tidy-up", () => {
62
- const s = step7();
63
- assert.match(
64
- s,
65
- phrase("Never fold `--label` into the create"),
66
- "step 7 lost the instruction against folding the label into the create",
67
- );
68
- // Not a `/timeout|backgrounded/` keyword search: that is polarity-blind and
69
- // slice-wide — it stayed GREEN with the mechanism sentence replaced by one
70
- // NEGATING it, satisfied by the word "timeout" in the paragraph's tail clause.
71
- assert.match(
72
- s,
73
- phrase("outruns the caller's tool timeout is backgrounded with the PR already open"),
74
- "step 7 no longer names the timeout the split exists for, so the split reads as an arbitrary extra call",
75
- );
76
- // Not a bare `own exit status`: the command block's own trailing comment
77
- // carries that phrase, so the loose form stayed GREEN with the prose rationale
78
- // rewritten to "a tidier shape" — measured. Pin the sentence, not the words.
79
- assert.match(
80
- s,
81
- phrase("it has its own exit status and fails loudly"),
82
- "step 7 no longer says the separate command carries its own exit status — the whole reason it is separate",
83
- );
84
- });
85
-
86
- test("the split reaches the fleet member verbatim, inside the agent body it is dispatched with", () => {
87
- const blocks = memberBlocks();
88
-
89
- // Location, not vocabulary: a member reads only its agent body and its prompt.
90
- // The instruction sitting in controller-facing prose reaches it by paraphrase
91
- // or not at all.
92
- assert.match(
93
- blocks,
94
- /gh pr edit --add-label/,
95
- "the member is not told to write the release label as its own command — it will pass `--label` to the create, which is the bug",
96
- );
97
- assert.match(
98
- blocks,
99
- phrase("Never fold `--label` into the create"),
100
- "the member block lost the prohibition, leaving the split as an example a member may collapse back into one call",
101
- );
102
- });
103
-
104
- test("the finisher refuses a PR with zero or more than one release label, and says which", () => {
105
- const duty = finisherLabelDuty();
106
- assert.match(
107
- duty,
108
- phrase("exactly one"),
109
- "the finisher no longer asserts a release-label count before labelling",
110
- );
111
- assert.match(
112
- duty,
113
- /`patch`\/`minor`\/`major`/,
114
- "the finisher's assertion no longer names the release labels it counts",
115
- );
116
- assert.match(
117
- duty,
118
- /[Zz]ero or more than one/,
119
- "the finisher's assertion covers only one of the two failures — a PR wearing two release labels passes, or a bare PR does",
120
- );
121
- assert.match(
122
- duty,
123
- /naming which|says which|report(s|ing)? which/,
124
- "the finisher may halt without naming what it found, which is the bare-SHA-mismatch failure shape this file's neighbours already record",
125
- );
126
- });
127
-
128
- test("the finisher's assertion accepts a normally-labelled PR — it counts release labels, not labels", () => {
129
- const duty = finisherLabelDuty();
130
-
131
- // The wrongly-REFUSE half. The finisher is about to add `ready-to-merge`,
132
- // which is itself a label, and PRs carry others; an assertion reading
133
- // "exactly one label" halts every correctly-created PR in the fleet.
134
- assert.match(
135
- duty,
136
- phrase("Count only those three"),
137
- "the finisher's assertion is no longer scoped to the release labels — any other label on the PR now trips it",
138
- );
139
- assert.match(
140
- duty,
141
- phrase("passes unchanged"),
142
- "the finisher no longer states that a PR carrying one release label beside its other labels passes",
143
- );
144
- });
145
-
146
- // #2331: duty 3 read as one item let two finishers stop at the release-label
147
- // check and report `labelled` with no `ready-to-merge` on the PR. The add is
148
- // its own sub-step, after the check, and carries the command itself — sliced
149
- // to each sub-step, so a command left elsewhere in duty 3 does not satisfy it.
150
- test("duty 3 is two sub-steps — the release-label check, then the add-label command", () => {
151
- const a = between(RUN_TEAM, "- **(a) Exactly one release label.**", "- **(b) Add the label:**", "finisher duty 3(a)");
152
- const b = between(RUN_TEAM, "- **(b) Add the label:**", "4. Report you the label", "finisher duty 3(b)");
153
- assert.match(a, phrase("exactly one"), "3(a) no longer holds the release-label count");
154
- assert.doesNotMatch(a, /--add-label/, "3(a) adds a label — the precondition and the action are one step again");
155
- assert.match(b, /`gh pr edit <pr> --add-label ready-to-merge`/, "3(b) no longer spells out the add-label command");
156
- assert.ok(RUN_TEAM.indexOf("- **(a) Exactly one release label.**") < RUN_TEAM.indexOf("- **(b) Add the label:**"), "the add precedes its precondition");
157
- assert.match(between(RUN_TEAM, "4. Report you the label", "\n\n", "finisher duty 4"), phrase("post-add read-back: `gh pr view <pr> --json labels`"),
158
- "duty 4 no longer reports the label read back after the add");
159
- });
160
-
161
- test("the solo labelling step gates on the release label too — the fleet finisher is not its only writer", () => {
162
- // `review-and-fix.md` step 6 is the other writer of `ready-to-merge`. A guard
163
- // on the fleet path alone leaves the standalone path labelling PRs with no
164
- // release label at all.
165
- const step6 = between(REVIEW_AND_FIX, "6. Diff-check green", "**Bind green to the *run*", "review-and-fix.md step 6");
166
- assert.match(
167
- step6,
168
- phrase("exactly one release label"),
169
- "step 6 labels `ready-to-merge` without asserting a release label, so the standalone path still ships PRs with none",
170
- );
171
- // The same two halves test 4 pins on the fleet path. A count with no halt
172
- // reads the labels back and labels anyway; a halt with no naming is the
173
- // bare-SHA-mismatch failure shape this file's neighbours already record.
174
- assert.match(
175
- step6,
176
- /[Zz]ero or more than one/,
177
- "step 6 covers only one of the two failures — a PR wearing two release labels gets `ready-to-merge`, or a bare PR does",
178
- );
179
- assert.match(
180
- step6,
181
- /naming which|says which|report(s|ing)? which/,
182
- "step 6 may halt without naming what it found, leaving the standalone path's halt unactionable",
183
- );
184
- });
@@ -1,63 +0,0 @@
1
- // release-ticket.sh's comment above its branch delete contrasts the release's
2
- // pairing (the `ahead` and `git cherry` guards, the recount at the delete, the
3
- // fresh worktree check) with reap.sh's. It said reap.sh authorizes its own
4
- // [gone] deletes with `git cherry` ALONE, but reap.sh also re-reads the
5
- // worktree listing and keeps any branch `wt_holding` reports held or cannot
6
- // resolve, before the same kind of compare-and-swap delete. What reap.sh does
7
- // lack is the `ahead` count and the recount: `git cherry` is the only check
8
- // there that asks whether the branch is merged.
9
- import { test } from "node:test";
10
- import assert from "node:assert/strict";
11
- import { readFileSync } from "node:fs";
12
- import { join } from "node:path";
13
- import { phrase, runAbove, stripHashGutter } from "./prose-pin.mjs";
14
-
15
- const RELEASE = readFileSync(join(import.meta.dirname, "release-ticket.sh"), "utf8");
16
- // reap.sh's code lines only: a whole-line `#` comment that mentions a command
17
- // is neither a call nor a guard, so it must satisfy no check below and fail none.
18
- const REAP = readFileSync(join(import.meta.dirname, "reap.sh"), "utf8")
19
- .split("\n")
20
- .filter((line) => !/^\s*#/.test(line))
21
- .join("\n");
22
-
23
- const deleteComment = () => {
24
- const comment = stripHashGutter(
25
- runAbove(RELEASE, 'echo "\\$ git update-ref -d refs/heads/$branch $tip" >&2', "release-ticket.sh branch delete", "#"),
26
- );
27
- // runAbove returns "" rather than throwing when no comment run sits directly
28
- // above the anchor; without this the negative pin would pass on nothing.
29
- assert.notEqual(comment, "", "no comment run sits directly above release-ticket.sh's branch delete — the pins have nothing to read");
30
- return comment;
31
- };
32
-
33
- test("release-ticket.sh: the delete comment does not say reap.sh deletes on `git cherry` alone", () => {
34
- assert.doesNotMatch(
35
- deleteComment(),
36
- new RegExp(phrase("deletes with `git cherry` alone").source, "i"),
37
- "release-ticket.sh's delete comment says reap.sh authorizes its [gone] deletes with `git cherry` alone — reap.sh also re-checks the worktree with `wt_holding` before its delete",
38
- );
39
- });
40
-
41
- test("release-ticket.sh: the delete comment still says how reap.sh's pairing differs", () => {
42
- // Input the pin above must ACCEPT: the contrast the sentence exists for —
43
- // reap.sh has no `ahead` count and no recount — survives, beside the
44
- // worktree check reap.sh shares with the release.
45
- const comment = deleteComment();
46
- assert.match(comment, phrase("with `git cherry` alone — no `ahead` count, no recount"));
47
- assert.match(comment, phrase("re-checks the worktree with `wt_holding`"));
48
- });
49
-
50
- test("reap.sh: the branch delete still follows a `wt_holding` check and has no `ahead` recount", () => {
51
- // The target side of the comment's claim, so a change to reap.sh that makes
52
- // it false reds here rather than leaving release-ticket.sh's prose stale.
53
- const held = REAP.indexOf('if wt_holding "refs/heads/$b"');
54
- const del = REAP.indexOf('git update-ref --no-deref -d "refs/heads/$b" "$tip"');
55
- assert.ok(held !== -1, "reap.sh no longer checks `wt_holding` on the [gone] branch");
56
- assert.ok(del !== -1, "reap.sh no longer deletes the [gone] branch with a compare-and-swap `update-ref -d`");
57
- assert.ok(held < del, "reap.sh's `wt_holding` check no longer runs before its branch delete");
58
- assert.doesNotMatch(
59
- REAP,
60
- /rev-list\b[^\n]*--count|--count[^\n]*rev-list/,
61
- "reap.sh now counts commits ahead — release-ticket.sh's comment says it has no `ahead` count",
62
- );
63
- });