@feigi/fleet-ctl 3.23.35 → 3.23.37

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 (204) hide show
  1. package/package.json +1 -1
  2. package/scripts/main-checkout.mjs +1 -1
  3. package/scripts/member-write-guard.mjs +1 -1
  4. package/scripts/repo-root.mjs +1 -1
  5. package/skills/run-team/references/reaping.md +1 -1
  6. package/scripts/agent-test-dir-prose.test.mjs +0 -59
  7. package/scripts/agent-test.test.mjs +0 -1640
  8. package/scripts/ambient-git-vars-mjs-prose.test.mjs +0 -397
  9. package/scripts/ambient-git-vars-prose.test.mjs +0 -192
  10. package/scripts/ancestry-check-position-prose.test.mjs +0 -175
  11. package/scripts/apply-ruleset.test.mjs +0 -421
  12. package/scripts/arg-header-probes-prose.test.mjs +0 -394
  13. package/scripts/arg.test.mjs +0 -1354
  14. package/scripts/board-cli.test.mjs +0 -710
  15. package/scripts/board-identity.test.mjs +0 -429
  16. package/scripts/board-liveness-banner.test.mjs +0 -119
  17. package/scripts/board-prev-shape.test.mjs +0 -228
  18. package/scripts/board-tryparse-null.test.mjs +0 -119
  19. package/scripts/board.test.mjs +0 -3121
  20. package/scripts/brief-after-cut-prose.test.mjs +0 -53
  21. package/scripts/candidates-exit3-prose.test.mjs +0 -302
  22. package/scripts/candidates.test.mjs +0 -2312
  23. package/scripts/caveat-unification-prose.test.mjs +0 -98
  24. package/scripts/cell-readout.test.mjs +0 -615
  25. package/scripts/ci-comment-rot-prose.test.mjs +0 -2025
  26. package/scripts/ci-completes-premise-prose.test.mjs +0 -257
  27. package/scripts/ci-state-prose.test.mjs +0 -113
  28. package/scripts/ci-state.test.mjs +0 -1933
  29. package/scripts/ci-vacuous-green.test.mjs +0 -368
  30. package/scripts/citation-sweep-prose.test.mjs +0 -1712
  31. package/scripts/claim-lifecycle.test.mjs +0 -187
  32. package/scripts/claim-ticket.test.mjs +0 -1122
  33. package/scripts/closing-keyword-prose.test.mjs +0 -193
  34. package/scripts/cockpit-launch-idempotent-prose.test.mjs +0 -165
  35. package/scripts/cockpit-tick-nonblocking.test.mjs +0 -210
  36. package/scripts/compute-board.test.mjs +0 -1214
  37. package/scripts/compute-spend.test.mjs +0 -517
  38. package/scripts/consumer-technology-prose.test.mjs +0 -126
  39. package/scripts/cross-repo-citation-prose.test.mjs +0 -155
  40. package/scripts/cwd-isolation-pins.mjs +0 -83
  41. package/scripts/dedupe-guard-prose.test.mjs +0 -243
  42. package/scripts/delete-merged-branch.test.mjs +0 -576
  43. package/scripts/derive-testcmd.test.mjs +0 -595
  44. package/scripts/diff-stats.test.mjs +0 -404
  45. package/scripts/dispatch-block-golden-prose.test.mjs +0 -1130
  46. package/scripts/dispatch-block-pins-prose.test.mjs +0 -615
  47. package/scripts/dispositions-check.test.mjs +0 -936
  48. package/scripts/dispositions-gate-prose.test.mjs +0 -129
  49. package/scripts/drop-merged-label.test.mjs +0 -479
  50. package/scripts/exec-stub.mjs +0 -93
  51. package/scripts/exec-stub.test.mjs +0 -69
  52. package/scripts/expected-jobs-prose.test.mjs +0 -80
  53. package/scripts/fan-out-authorization-prose.test.mjs +0 -80
  54. package/scripts/filing-bar-seat-prose.test.mjs +0 -242
  55. package/scripts/filing-claim-bar-prose.test.mjs +0 -166
  56. package/scripts/finisher-died-prose.test.mjs +0 -31
  57. package/scripts/finisher-dispatch-premise-prose.test.mjs +0 -312
  58. package/scripts/finisher-halt-prose.test.mjs +0 -106
  59. package/scripts/finisher-name-prose.test.mjs +0 -134
  60. package/scripts/finisher-own-tree-prose.test.mjs +0 -299
  61. package/scripts/finisher-pin-race-prose.test.mjs +0 -339
  62. package/scripts/finisher-test-verdict-prose.test.mjs +0 -102
  63. package/scripts/fix-applier-correction-rules-prose.test.mjs +0 -202
  64. package/scripts/fix-applier-result-file-prose.test.mjs +0 -149
  65. package/scripts/fleet-bootstrap.test.mjs +0 -75
  66. package/scripts/fleet-heartbeat.test.mjs +0 -450
  67. package/scripts/fleet-provenance.test.mjs +0 -138
  68. package/scripts/fleet-run.test.mjs +0 -90
  69. package/scripts/fleet-state.test.mjs +0 -460
  70. package/scripts/fleet-tick-prose.test.mjs +0 -300
  71. package/scripts/fleet-tick.test.mjs +0 -2444
  72. package/scripts/force-with-lease-reason-prose.test.mjs +0 -184
  73. package/scripts/frontmatter-check.test.mjs +0 -436
  74. package/scripts/git-env.test.mjs +0 -149
  75. package/scripts/git-status-untracked-mode-sweep.test.mjs +0 -216
  76. package/scripts/gone-walk.test.mjs +0 -213
  77. package/scripts/gp-sep-invariant-prose.test.mjs +0 -188
  78. package/scripts/head-moved-after-label-prose.test.mjs +0 -233
  79. package/scripts/immutable-body-claim-prose.test.mjs +0 -204
  80. package/scripts/implementer-model-tier.test.mjs +0 -235
  81. package/scripts/inflight-citation-prose.test.mjs +0 -144
  82. package/scripts/inflight-exit2-prose.test.mjs +0 -81
  83. package/scripts/inflight-probe-guard-prose.test.mjs +0 -109
  84. package/scripts/inflight-scan-scope-prose.test.mjs +0 -57
  85. package/scripts/inflight.test.mjs +0 -2882
  86. package/scripts/injection-control-prose.test.mjs +0 -404
  87. package/scripts/install-root-audit.test.mjs +0 -464
  88. package/scripts/instrument-check-prose.test.mjs +0 -235
  89. package/scripts/instruments.test.mjs +0 -787
  90. package/scripts/is-cli.test.mjs +0 -99
  91. package/scripts/issue-tracker-prose.test.mjs +0 -71
  92. package/scripts/json.test.mjs +0 -364
  93. package/scripts/ledger-dispatch.test.mjs +0 -927
  94. package/scripts/ledger-grammar.test.mjs +0 -227
  95. package/scripts/ledger-read-require-file.test.mjs +0 -197
  96. package/scripts/ledger-rotate.test.mjs +0 -142
  97. package/scripts/ledger.test.mjs +0 -3436
  98. package/scripts/line-distance-prose.test.mjs +0 -245
  99. package/scripts/liveness-rationale-prose.test.mjs +0 -83
  100. package/scripts/locale-pin-prose.test.mjs +0 -189
  101. package/scripts/main-checkout.test.mjs +0 -332
  102. package/scripts/member-outcome-prose.test.mjs +0 -167
  103. package/scripts/member-outcomes-header.test.mjs +0 -129
  104. package/scripts/member-outcomes-prose.test.mjs +0 -63
  105. package/scripts/member-outcomes.test.mjs +0 -638
  106. package/scripts/member-prompt-prose.test.mjs +0 -165
  107. package/scripts/member-record.test.mjs +0 -541
  108. package/scripts/member-write-guard.test.mjs +0 -214
  109. package/scripts/merge-commit-probe-prose.test.mjs +0 -122
  110. package/scripts/merge-gate.test.mjs +0 -613
  111. package/scripts/muted-git-guard-sweep.test.mjs +0 -493
  112. package/scripts/net-ssh-precedence-prose.test.mjs +0 -91
  113. package/scripts/net-watchdog-prose.test.mjs +0 -79
  114. package/scripts/net.test.mjs +0 -211
  115. package/scripts/no-ci-gate-prose.test.mjs +0 -108
  116. package/scripts/no-undo-audit.test.mjs +0 -3961
  117. package/scripts/no-wave.test.mjs +0 -138
  118. package/scripts/node-floor-sweep.test.mjs +0 -611
  119. package/scripts/pointer-target-prose.test.mjs +0 -186
  120. package/scripts/pr-cost.test.mjs +0 -521
  121. package/scripts/pr-overlap.test.mjs +0 -692
  122. package/scripts/printf-die-sweep.test.mjs +0 -384
  123. package/scripts/prompt-renderer.mjs +0 -40
  124. package/scripts/prompt-renderer.test.mjs +0 -68
  125. package/scripts/prose-pin.mjs +0 -807
  126. package/scripts/prose-pin.test.mjs +0 -1034
  127. package/scripts/prove-merge.test.mjs +0 -995
  128. package/scripts/pull-table-relabel-prose.test.mjs +0 -60
  129. package/scripts/quiet-payload-prose.test.mjs +0 -222
  130. package/scripts/reap-cherry-check-prose.test.mjs +0 -80
  131. package/scripts/reap.test.mjs +0 -4432
  132. package/scripts/reaping-prose.test.mjs +0 -239
  133. package/scripts/reaping-reap-authorizers-prose.test.mjs +0 -112
  134. package/scripts/reaping-release-authorizers-prose.test.mjs +0 -85
  135. package/scripts/recipe-derivation-prose.test.mjs +0 -112
  136. package/scripts/recipe-prove.test.mjs +0 -1042
  137. package/scripts/refuter-scratch-prose.test.mjs +0 -135
  138. package/scripts/release-label-required-prose.test.mjs +0 -71
  139. package/scripts/release-label-split-prose.test.mjs +0 -184
  140. package/scripts/release-ticket-reap-pairing-prose.test.mjs +0 -63
  141. package/scripts/release-ticket.test.mjs +0 -5099
  142. package/scripts/renovate-release-contract.test.mjs +0 -379
  143. package/scripts/repo-root.test.mjs +0 -873
  144. package/scripts/reporter-output-rule-prose.test.mjs +0 -208
  145. package/scripts/review-agent-report-only.test.mjs +0 -49
  146. package/scripts/review-core-booking.test.mjs +0 -35
  147. package/scripts/review-core-cwd-isolation.test.mjs +0 -374
  148. package/scripts/review-core-reads.test.mjs +0 -478
  149. package/scripts/review-core-refuter-scratch.test.mjs +0 -148
  150. package/scripts/review-core-scratch-refusal.test.mjs +0 -64
  151. package/scripts/review-core-shared-test-run.test.mjs +0 -275
  152. package/scripts/review-core-snapshot-path.test.mjs +0 -830
  153. package/scripts/review-core-specialist-scratch.test.mjs +0 -191
  154. package/scripts/review-core-testcmd.test.mjs +0 -335
  155. package/scripts/review-core-unrun.test.mjs +0 -566
  156. package/scripts/review-core-unverified-discriminant.test.mjs +0 -208
  157. package/scripts/review-eval-resolver-path.test.mjs +0 -55
  158. package/scripts/review-host-fixture.mjs +0 -89
  159. package/scripts/review-in-run-retry.test.mjs +0 -211
  160. package/scripts/review-no-vendor-dispatch.test.mjs +0 -45
  161. package/scripts/review-path-default.test.mjs +0 -796
  162. package/scripts/review-runner-spawns.test.mjs +0 -95
  163. package/scripts/review-runner.test.mjs +0 -166
  164. package/scripts/review-tier-audit.test.mjs +0 -140
  165. package/scripts/run-artifact-pr-prose.test.mjs +0 -341
  166. package/scripts/run-merge-bot-prose.test.mjs +0 -1413
  167. package/scripts/run-team-local-hook.test.mjs +0 -442
  168. package/scripts/scratch-partition-invariant-prose.test.mjs +0 -74
  169. package/scripts/scripts-path-citation-sweep.test.mjs +0 -73
  170. package/scripts/section-between-guard-prose.test.mjs +0 -379
  171. package/scripts/select-dimensions.test.mjs +0 -674
  172. package/scripts/shared-refusal.test.mjs +0 -388
  173. package/scripts/shell-traps-prose.test.mjs +0 -504
  174. package/scripts/shortlist.test.mjs +0 -380
  175. package/scripts/slow-transport.mjs +0 -72
  176. package/scripts/snapshot-repo.test.mjs +0 -1006
  177. package/scripts/snapshot-runner-audience-prose.test.mjs +0 -130
  178. package/scripts/spend-view.test.mjs +0 -312
  179. package/scripts/staleness-qualifier-prose.test.mjs +0 -251
  180. package/scripts/staleness-verdict-prose.test.mjs +0 -142
  181. package/scripts/staleness.test.mjs +0 -893
  182. package/scripts/stalled-member-liveness-prose.test.mjs +0 -219
  183. package/scripts/stash-prohibition-prose.test.mjs +0 -313
  184. package/scripts/strip-comments.mjs +0 -44
  185. package/scripts/temp-dir.mjs +0 -47
  186. package/scripts/ticket-router.test.mjs +0 -981
  187. package/scripts/tier-check.test.mjs +0 -828
  188. package/scripts/tier-outcomes-header.test.mjs +0 -518
  189. package/scripts/tier-outcomes.test.mjs +0 -572
  190. package/scripts/tier-roles.test.mjs +0 -535
  191. package/scripts/tracker-block-copy-prose.test.mjs +0 -288
  192. package/scripts/triage-labels-gloss-prose.test.mjs +0 -97
  193. package/scripts/unattended-git-sweep.test.mjs +0 -142
  194. package/scripts/verify-sha-exit2-prose.test.mjs +0 -269
  195. package/scripts/verify-sha.test.mjs +0 -692
  196. package/scripts/watcher-degraded-block.test.mjs +0 -369
  197. package/scripts/watcher-key-prose.test.mjs +0 -106
  198. package/scripts/within-run-pair-prose.test.mjs +0 -212
  199. package/scripts/worktree-audit.test.mjs +0 -1408
  200. package/scripts/worktree-head-prose.test.mjs +0 -276
  201. package/scripts/worktree-listing-sweep.test.mjs +0 -217
  202. package/scripts/worktree-model-prose.test.mjs +0 -216
  203. package/scripts/worktree-porcelain.mjs +0 -35
  204. package/scripts/worktree-porcelain.test.mjs +0 -102
@@ -1,615 +0,0 @@
1
- // #400. Phase 2 hands the controller a run of `>` blocks and says to carry each
2
- // one VERBATIM into every implementer prompt. Those blocks are not prose about
3
- // the fleet — they are the only text a member ever sees, so a block that goes
4
- // missing does not misinform the member, it silently stops governing it.
5
- //
6
- // Measured against `origin/main` before this file existed: deleting the
7
- // enumerate-the-class block outright left the suite green, and no test file
8
- // mentioned `Commit incrementally` at all. `member-prompt-prose.test.mjs` pins
9
- // the identity block and the two `next-ticket` step handoffs;
10
- // `tracker-block-copy-prose.test.mjs` pins the issue-read block by comparing it
11
- // whole against `docs/agents/issue-tracker.md`. This file covers the blocks
12
- // between those, and adds a content pin to the issue-read block for the one
13
- // case the copy comparison cannot see: an identical gutting of BOTH files
14
- // agrees with itself and passes there.
15
- //
16
- // SHAPE, and the thing to preserve when editing these tests. A positive regex
17
- // over the whole member-prompt region is a vacuous pin — every word of every
18
- // block is somewhere in it, so the assertion passes with the block it names
19
- // deleted. Two things do the work instead:
20
- //
21
- // 1. Each block gets its OWN slice, bounded at both ends by the neighbouring
22
- // block's opening words. Slice size is what anchors a prose pin; assertion
23
- // count over a large slice does not.
24
- // 2. Each pinned fragment is bound to the content beside it, never asserted
25
- // alone. Independent presence checks pin N facts and never the relation
26
- // between them: two such checks on `**step 6**` and `**step 7**` stayed
27
- // green through a swap of the two numbers, which told a member to open its
28
- // PR at the sizing checkpoint. So a rule is pinned together with the
29
- // command that carries it out, and an instruction together with the
30
- // alternative it excludes — a swap then reds where presence would not.
31
- //
32
- // A word blacklist was tried for this and rejected on measurement, so do not
33
- // reach for one when this file next feels too loose: `doesNotMatch(/\bunless\b|
34
- // \bexcept\b/i)` scoped to a pinned sentence does not kill its own mutant,
35
- // broadened enough to kill it four trivial rewordings preserve the defect and
36
- // stay green, and it reddens on a legitimate edit this repo is likely to make —
37
- // a standing rule containing the word "unless" is exactly the kind of text that
38
- // belongs in a verbatim block.
39
- //
40
- // THE CEILING THESE PINS HAVE, and it is why they are no longer alone. These
41
- // are pins on text being PRESENT and adjacent. A sentence APPENDED inside a
42
- // block, carving an exception out of a pinned rule, touches no pinned fragment
43
- // and stays green; so does a meaning-changing clause inserted MID-GAP, inside
44
- // one of the six `.{0,N}?` spans below (five assertions, one of which spans
45
- // two gaps), wherever that gap still has headroom.
46
- // Both shapes were measured green here.
47
- //
48
- // #1002 closed that half with a mechanism that is not a regex —
49
- // `dispatch-block-golden-prose.test.mjs` holds a whole-block golden fixture for
50
- // every block this file slices, and any insertion reds there because the block
51
- // no longer equals its known-good copy. An LLM judge and a schema'd rule format
52
- // were the two candidates and both were rejected: a nondeterministic gate, and
53
- // a large change that still has to keep these blocks readable as prose.
54
- //
55
- // So read a green run here as "every pinned rule is still present and still
56
- // adjacent", never as "no exception was added to these blocks" — that second
57
- // claim belongs to the golden file, and these two are complementary. A golden
58
- // red says the block changed; a red HERE says WHICH RULE was lost, which is the
59
- // more actionable half and the reason none of these pins was deleted when the
60
- // golden landed.
61
- //
62
- // WHERE THE BLOCKS LIVE (#1804). They used to be a run of `>` quote blocks in
63
- // run-team/SKILL.md's phase 2, pasted into every implementer prompt. Spec
64
- // 2026-09-24 § 2 Decision 2 moved them into
65
- // the implementer agent body, `agents/fleet-implementer-<cell>.agent.md`
66
- // (byte-identical in every cell, pinned by implementer-model-tier.test.mjs), which each harness injects as the
67
- // member's system prompt, and #1804 deleted the SKILL.md copy. These pins
68
- // retargeted with them: same slices, same bounds, read off the agent body.
69
- import { test } from "node:test";
70
- import assert from "node:assert/strict";
71
- import { readFileSync } from "node:fs";
72
- import { join } from "node:path";
73
- import { between, phrase } from "./prose-pin.mjs";
74
-
75
- const REPO = join(import.meta.dirname, "..");
76
- // The body alone — everything after the frontmatter's closing `---` — so a
77
- // frontmatter field can never satisfy a pin meant for text the member reads.
78
- const AGENT_FILE = readFileSync(join(REPO, "agents", "fleet-implementer-slow-high.agent.md"), "utf8");
79
- const BODY = AGENT_FILE.split("---").slice(2).join("---");
80
-
81
- function region(text = BODY) {
82
- assert.ok(text.trim().length > 0, "agents/fleet-implementer-slow-high.agent.md has no body — the implementer background moved again; update this test");
83
- return text;
84
- }
85
-
86
- // Quote markers and `**` emphasis are stripped and whitespace collapsed before
87
- // matching, so a pinned span may cross a `>` gutter or a bold boundary, and
88
- // neither a rewrap nor an emphasis move is a failure. `phrase()` alone cannot
89
- // do either: its `\s+` joins do not span a `>`, so every multi-line pin here
90
- // would red on the wrap points rather than on the meaning, and it escapes `*`
91
- // as a regex metacharacter, which makes the exact position of a `**` seam
92
- // literal test surface. Measured: narrowing the bold span on the re-derive
93
- // sentence to `**Re-derive the ticket's claims** against ...` — same words,
94
- // same order, same meaning — reddened this file with a message claiming
95
- // `origin/main` was no longer pinned, which was false. A false red on a
96
- // meaning-preserving copy-edit is how a pin gets deleted by the next person to
97
- // touch the prose.
98
- //
99
- // Only `**` is stripped, deliberately. A single `*` and `_` are live characters
100
- // in this region — `*.test.mjs` globs and `SNAKE_CASE` identifiers inside code
101
- // spans — so stripping those would corrupt the text the pins match against
102
- // rather than normalize it. No `**` appears inside a code span here (measured);
103
- // if one ever does, this is the line that has to learn about backticks.
104
- const flatten = (s) =>
105
- s
106
- .split("\n")
107
- .map((l) => l.replace(/^>\s?/, ""))
108
- .join(" ")
109
- .replace(/\*\*/g, "")
110
- .split(/\s+/)
111
- .join(" ")
112
- .trim();
113
-
114
- // Each block is bounded by the opening words of the block that follows it, so a
115
- // block deleted outright reds on its own anchor and names itself. A closing
116
- // phrase would anchor on today's last sentence instead, leaving anything
117
- // appended after it outside the slice entirely.
118
- const block = (from, to, what) => flatten(between(region(), from, to, what));
119
-
120
- const worktreeBlock = () => block("You are ALREADY in worktree", "**`edit` and `read` resolve", "phase 2's worktree block");
121
- const editReadBlock = () => block("**`edit` and `read` resolve", "Read the issue with", "phase 2's edit/read session-root block");
122
- const issueReadBlock = () => block("Read the issue with", "**Re-derive the ticket", "phase 2's issue-read block");
123
- const rederiveBlock = () => block("**Re-derive the ticket", "Commit incrementally", "phase 2's re-derive block");
124
- const commitBlock = () => block("Commit incrementally", "**Every scratch file", "phase 2's commit-incrementally block");
125
- const scratchBlock = () => block("**Every scratch file", "**The `eval` kernel is shared", "phase 2's scratch-discipline block");
126
- const evalKernelBlock = () => block("**The `eval` kernel is shared", "Your ticket names the cases", "phase 2's eval-kernel-discipline block");
127
- const enumerateBlock = () => block("Your ticket names the cases", "Run `sizing-a-ticket`", "phase 2's enumerate-the-class block");
128
-
129
- // The LAST block in the body has no following block to bound it, so it runs to
130
- // the end of the body — which is also where the member's prompt ends, so
131
- // anything appended after it lands inside this slice rather than outside it.
132
- const sizingBlock = () => {
133
- const at = region().indexOf("Run `sizing-a-ticket`");
134
- assert.notEqual(at, -1, "the agent body's sizing-and-PR block ('Run `sizing-a-ticket`') moved — update this test");
135
- return flatten(region().slice(at));
136
- };
137
-
138
- test("the worktree block forbids a second worktree and carries the check that settles it", () => {
139
- const b = worktreeBlock();
140
- // Prohibition bound to the command that verifies it. Alone, "Do NOT create
141
- // another worktree" is an instruction a member cannot act on: what it needs
142
- // is the pair of `rev-parse` calls that tell it where it already is.
143
- assert.match(
144
- b,
145
- phrase("Do NOT create another worktree. Verify with `git rev-parse --git-dir` and `git rev-parse --git-common-dir`"),
146
- "the no-second-worktree rule is no longer carried with the rev-parse check that settles it",
147
- );
148
- assert.match(
149
- b,
150
- phrase("Skip the using-git-worktrees skill's Step 1"),
151
- "the block no longer names which step of using-git-worktrees the member skips",
152
- );
153
- });
154
-
155
- // #1727. The block above settles where the member's `bash` cwd is, and that is the
156
- // whole reason this one exists: `edit`/`read` resolve their own paths against
157
- // the session root, so a member can pass every `rev-parse` check the worktree
158
- // block prescribes and still aim a write at the main checkout. Since #1411 the
159
- // `member-write-guard` extension refuses that write, so the block no longer
160
- // carries the incident evidence or the by-hand detection and recovery steps
161
- // that stood in for a gate; what it keeps is the rule, the fact behind it, and
162
- // what a refusal means.
163
- test("the edit/read block binds the session-root mechanism to the discipline that does NOT cover it, and a guard refusal to its remedy", () => {
164
- const b = editReadBlock();
165
- // The resolution fact bound to BOTH trees it is not. "Use absolute paths"
166
- // alone is advice a member already believes it is following; what makes it
167
- // actionable is naming the root it actually resolves against and the two
168
- // roots a member wrongly assumes.
169
- assert.match(
170
- b,
171
- phrase(
172
- "`edit` and `read` resolve a bare relative path against the SESSION ROOT — the controller's own main checkout — not against your worktree and not against your `bash` cwd",
173
- ),
174
- "the session-root resolution fact no longer names the two roots it is NOT — the worktree and the bash cwd — so the rule reads as advice a careful member already believes it follows",
175
- );
176
- // The missing `cwd` parameter bound to the consequence that makes it matter.
177
- // A member that knows only "these tools take no cwd" concludes nothing; the
178
- // load-bearing half is that correct `bash` scoping therefore protects it from
179
- // nothing here, which is exactly what the four measured members assumed.
180
- assert.match(
181
- b,
182
- /take no `cwd` parameter.{0,140}?still leaks through `edit`\/`read` alone/,
183
- "the absent cwd parameter is no longer bound to the leak it permits despite correct bash scoping",
184
- );
185
- // The refusal bound to what it means and what to do about it. A member that
186
- // meets a refused `write` with no such line reads it as a tool fault or a
187
- // permission problem and works around it; the pin keeps the cause (the path
188
- // hit the main checkout) and the remedy (re-issue it absolute) in one span,
189
- // with the bash case between them.
190
- assert.match(
191
- b,
192
- phrase(
193
- "A `member-write-guard` refusal means the path hit the main checkout — for `bash`, a missing or main-checkout `cwd` — so re-issue it absolute, under your worktree",
194
- ),
195
- "the block no longer tells the member what a member-write-guard refusal means and that the remedy is to re-issue the path absolute under its worktree",
196
- );
197
- // The rule bound to the shape it excludes.
198
- assert.match(
199
- b,
200
- phrase(
201
- "prefix every `edit` and `read` path with an absolute path — the worktree `<abs-path>` for repo files, `<scratch>/impl-<N>/` for scratch — never a bare relative one, and never `plugin/scripts/foo.mjs` on its own",
202
- ),
203
- "the absolute-path rule no longer shows the bare relative path it excludes, so it states a preference rather than a prohibition",
204
- );
205
- });
206
-
207
- test("the issue-read block carries the command, the caveat that motivates it, and which text wins", () => {
208
- const b = issueReadBlock();
209
- // The `--json` form bound to the fields it must request. `gh issue view <N>`
210
- // on its own is satisfied by the very invocation the next sentence forbids.
211
- assert.match(
212
- b,
213
- phrase("Read the issue with `gh issue view <N> --json title,body,comments"),
214
- "the issue-read command no longer requests title, body and comments together",
215
- );
216
- // The caveat bound to its consequence. The defect is silent — exit 0 — so the
217
- // reason is the load-bearing half: a member told only "not `--comments`" has
218
- // no way to recognise the failure when it sees it.
219
- assert.match(
220
- b,
221
- /`gh issue view <N> --comments`.{0,200}?so the loss is silent/,
222
- "the bare --comments caveat is no longer bound to the silent-loss consequence it exists to explain",
223
- );
224
- // The precedence rule, and the direction it runs in. Asserting the two nouns
225
- // separately would pass with the precedence reversed.
226
- assert.match(
227
- b,
228
- phrase("The `## Agent Brief` comment is authoritative over the issue body"),
229
- "the block no longer says the Agent Brief outranks the issue body, or now says the reverse",
230
- );
231
- // The bail rule, bound to BOTH its timing and its trigger. This is the case
232
- // the header says these pins exist for, and it was measured open: the
233
- // sentence could be deleted from `run-team/SKILL.md` and
234
- // `docs/agents/issue-tracker.md` at once with the whole suite green — the
235
- // copy comparison in `tracker-block-copy-prose.test.mjs` agrees with an
236
- // identical gutting of both sides, and its only red was its own fixture
237
- // going stale, whose message instructs the edit that closes it.
238
- //
239
- // Bound this way rather than on the word "bail", which survives the inversion
240
- // that matters: "→ implement anyway" is the reading that puts an undecided
241
- // member into a tree it cannot reason about, and it reds here.
242
- assert.match(
243
- b,
244
- /Read the issue before touching code.{0,60}?still undecided or needing human hands you do not have.{0,40}?bail, name the cause, do not implement/,
245
- "the read-before-touching-code rule no longer sends an undecided member to bail instead of implementing",
246
- );
247
- });
248
-
249
- test("the re-derive block names origin/main as the reference, and says a contradicted criterion is a bail", () => {
250
- const b = rederiveBlock();
251
- // Reference bound to the alternatives it excludes. `origin/main` present
252
- // anywhere in the block satisfies a bare presence check even after the
253
- // sentence has been rewritten to send the member at its own working tree.
254
- assert.match(
255
- b,
256
- phrase("against `origin/main` before implementing — not the working tree, and not the ticket's line numbers"),
257
- "re-derivation is no longer pinned to origin/main against the working tree and the ticket's line numbers",
258
- );
259
- assert.match(
260
- b,
261
- phrase("Already fixed → report that with the commit and do NOT invent work"),
262
- "the already-fixed exit no longer tells the member to report the commit instead of inventing work",
263
- );
264
- // Bail bound to its trigger, and to the thing it is NOT. Swapping the two
265
- // halves — "is a thing to implement, not a bail" — is the reading that turns
266
- // a stale ticket into a shipped regression, and it reds here.
267
- assert.match(
268
- b,
269
- phrase("is a bail, not a thing to implement"),
270
- "a criterion the tree contradicts no longer reads as a bail, or now reads as a thing to implement",
271
- );
272
- });
273
-
274
- test("the commit-incrementally block carries the instruction with the loss that justifies it", () => {
275
- const b = commitBlock();
276
- assert.match(
277
- b,
278
- phrase("Commit incrementally as you go. Do not accumulate a large uncommitted diff"),
279
- "the commit-incrementally instruction is no longer carried verbatim to the member",
280
- );
281
- // The reason, bound to the instruction by the slice being this one paragraph.
282
- // `SKILL.md` calls this block not optional because a member that goes idle
283
- // leaves a diff the controller can neither see nor reap; a member told to
284
- // commit often, with no reason, treats it as style.
285
- assert.match(
286
- b,
287
- phrase("uncommitted work is invisible to the controller and effectively unrecoverable"),
288
- "the block no longer says why incremental commits are not optional — the stall consequence is gone",
289
- );
290
- });
291
-
292
- test("the scratch-discipline block names the shared injected root, the per-member path, and the false-measurement harm", () => {
293
- const b = scratchBlock();
294
- // The imperative itself, bound to the exclusion it carries. Every other
295
- // assertion here pins an explanatory sentence; measured on this PR's own
296
- // review, inverting this one clause — "goes under `<scratch>/impl-<N>/`,
297
- // never into the scratch root by itself" rewritten to "may go under ... or
298
- // straight into the scratch root — either is fine" — left all seven tests in
299
- // this file green, and all 298 in `*prose*.test.mjs` too. Rule 2 of this
300
- // file's header is exactly that: a rule is pinned together with the command
301
- // that carries it out, and an instruction together with the alternative it
302
- // excludes. The path and the prohibition are ONE span deliberately, so an
303
- // edit that keeps `<scratch>/impl-<N>/` and drops the "never" cannot pass.
304
- assert.match(
305
- b,
306
- phrase("copy you create goes under `<scratch>/impl-<N>/`, never into the scratch root by itself"),
307
- "the per-member path is no longer bound to the prohibition on writing into the scratch root itself",
308
- );
309
- // The root bound to it being shared and injected, not merely "use a subdir".
310
- // #581: an implementer is TOLD to use that root by its own system prompt
311
- // before SKILL.md ever reaches it, so the rule has to name the root and say
312
- // it is shared, or it reads as tidiness advice competing with an instruction
313
- // the member already received.
314
- assert.match(
315
- b,
316
- phrase("The scratchpad root your own system prompt names is injected unprompted into every dispatched member and is shared with every sibling"),
317
- "the block no longer names the injected scratch root as shared with every sibling member",
318
- );
319
- // The per-member path bound to the SAME derivation phase 1 already uses, not
320
- // a second scheme invented for this rule.
321
- assert.match(
322
- b,
323
- phrase("Derive your own path the same way `claim-ticket.sh` already derives per-ticket ports from the issue number (`postgres=16<N>`, `ollama=22<N>`): `<scratch>/impl-<N>/`, not a second scheme"),
324
- "the per-member scratch path is no longer derived the same way claim-ticket.sh derives per-ticket ports",
325
- );
326
- // Absence handled: nothing else creates this directory, so a member that
327
- // never `mkdir -p`s it has no path to write into.
328
- assert.match(
329
- b,
330
- phrase("`mkdir -p` it yourself the first time — nothing creates it for you"),
331
- "the block no longer tells the member to create its own scratch dir when absent",
332
- );
333
- // The harm bound to the mechanism, and stated as a false measurement, not
334
- // clutter — bare "keep things tidy" is the framing #581 says gets skipped
335
- // under time pressure, which is exactly when concurrency is highest.
336
- //
337
- // Two `phrase()` pins over the mechanism's two halves, NOT one regex spanning
338
- // both with a `.{0,N}?` cap between them. Measured on this PR's own review:
339
- // the cap was `{0,400}` and today's wording already spends 303 of it, so one
340
- // added clause in that sentence reds the pin — with a message claiming the
341
- // mechanism was removed, when it was extended. A false red that misdirects is
342
- // how a pin gets deleted by the next person to touch the prose (see the
343
- // `flatten` comment above for the same failure). Widening the cap only moves
344
- // the cliff; a contiguous span has no character budget to approach.
345
- assert.match(
346
- b,
347
- phrase("The harm is a false measurement, not untidiness: a mutation harness writes a broken copy of a file, measures against it, then restores from `.orig`"),
348
- "the harm is no longer stated as a false measurement bound to the mutation harness that produces it",
349
- );
350
- assert.match(
351
- b,
352
- phrase("one filename collision away from restoring a sibling's `.orig` over their own file, or measuring a \"clean baseline\" that is actually a sibling's mutant — silently, indistinguishable from a real result"),
353
- "the filename collision is no longer bound to the false result it produces, or to that result being indistinguishable from a real one",
354
- );
355
- // Explicitly NOT the worktree isolation rule — folding the two together is
356
- // the thing #581's brief rules out.
357
- assert.match(
358
- b,
359
- phrase("This is not the worktree isolation rule: `claim-ticket.sh` already gives you your own worktree"),
360
- "the scratch-discipline block no longer distinguishes itself from worktree isolation",
361
- );
362
- // #1150. The child rule, pinned with the path it names — rule 2 of this
363
- // file's header: the instruction together with the command that carries it
364
- // out. The parent writes the absolute directory into the child's prompt; the
365
- // child never derives one, so a rewording that keeps the path and hands the
366
- // derivation back to the child ("a subagent derives its own
367
- // `<scratch>/impl-<N>/<childName>/`") breaks the span and reds here.
368
- assert.match(
369
- b,
370
- phrase("A subagent you dispatch gets its own directory under yours, `<scratch>/impl-<N>/<childName>/`, and you write that path, absolute, into its prompt — it writes nowhere else, and never derives a path of its own"),
371
- "the child rule no longer binds a dispatched subagent's `<scratch>/impl-<N>/<childName>/` to the parent writing it, absolute, into the child's prompt — a child left to derive its own path collides in the shared root",
372
- );
373
- // The name the path is keyed on, bound to what makes it collision-free.
374
- assert.match(
375
- b,
376
- phrase("`<childName>` is a slug of the name you dispatch it under (omp's task `name`) — `[a-z0-9-]` only, never the raw field itself, which can carry spaces and `/` and would split or nest the path in an unquoted shell command — unique among your children and never one of your own entries (`probe`, `mutate`, or any other name you write under `<scratch>/impl-<N>/` yourself), so no child shares a directory with a sibling or with you"),
377
- "`<childName>` is no longer defined as a slugged, own-entry-safe dispatch name unique among the parent's children",
378
- );
379
- });
380
-
381
- // #1447. Two of this block's three hazards leave NO trace in the repo: a
382
- // shared-kernel variable collision and a kernel `reset` write no file, so
383
- // `git status`, `worktree-audit.sh` and the instrument re-check all stay
384
- // green through them. The third — a relative path resolving into the main
385
- // checkout — only shows up when the cell writes (the stray `work/` tree it
386
- // names is that case); a read leaves nothing either. That is why the rule
387
- // has to reach the member as text — there is no gate behind it to catch a
388
- // member that never read it.
389
- test("the eval-kernel block binds the sharing fact to all three of its rules, and to the citation that proves it", () => {
390
- const b = evalKernelBlock();
391
- // The imperative bound to BOTH exclusions it carries. Split into two
392
- // independent presence checks ("namespace" somewhere, "relative path"
393
- // somewhere), this passes with either rule deleted — the sharing premise and
394
- // the two duties it implies are one span deliberately.
395
- assert.match(
396
- b,
397
- phrase("The `eval` kernel is shared with every sibling member and with the controller that dispatched you — namespace every binding you make in it, and never hand it a relative path"),
398
- "the shared-kernel premise is no longer bound to the namespacing duty and the no-relative-path duty it implies",
399
- );
400
- // The naming rule bound to the counter-example. `WT` is not decoration: it is
401
- // the exact bare name the reported collision happened on, so a member reading
402
- // this sees the shape it must not repeat, not an abstract "use good names".
403
- // Keyed on the member's NAME, not its ticket number, so a recovery member
404
- // sharing the same ticket does not also share the same prefix.
405
- assert.match(
406
- b,
407
- phrase("prefix what you bind with your own member NAME, not its bare ticket number"),
408
- "the member-prefixed binding rule no longer keys the prefix on the member's name",
409
- );
410
- assert.match(
411
- b,
412
- phrase("`WT_impl_1447`, never a bare `WT` and never a prefix a recovery member for the same ticket (`impl-1447-b`) would also produce"),
413
- "the member-prefixed binding rule no longer shows the bare name it excludes, or the recovery-collision case the name-keyed prefix avoids",
414
- );
415
- // The cwd fact bound to WHY it cannot be fixed the way `bash` calls are. A
416
- // member that knows only "use absolute paths" reaches for eval's cwd
417
- // parameter, finds none, and improvises.
418
- assert.match(
419
- b,
420
- /The kernel's cwd is the MAIN CHECKOUT, not your worktree.{0,60}?unlike `bash`, `eval` takes no `cwd` parameter at all/,
421
- "the eval-cwd hazard is no longer bound to the absence of a cwd parameter that would otherwise fix it",
422
- );
423
- // The measured resolution, bound to the tree it landed in AND the tree it
424
- // did not. This is the half of #1447 that WAS independently visible (the
425
- // stray `work/` tree), so the evidence stays attached to the rule it
426
- // justifies. Deliberately not a literal checkout path: `install-root-audit`
427
- // rule (b) forbids one in prose under `plugin/skills/` (ADR 0003), and this
428
- // block reaches members on machines where such a path is simply wrong.
429
- assert.match(
430
- b,
431
- /a bare `work\/scripts` in a member's cell resolved under the main checkout root, never under that member's own worktree/,
432
- "the measured relative-path resolution into the main checkout is gone, or no longer contrasts with the worktree it skipped",
433
- );
434
- // `reset` bound to its blast radius. A member reads `reset: true` as
435
- // house-keeping on its OWN kernel; the prohibition only makes sense with the
436
- // sibling damage stated beside it.
437
- assert.match(
438
- b,
439
- phrase("never call `eval` with `reset: true`, which is destructive to every other member sharing that backend session"),
440
- "the reset prohibition no longer names the sibling damage that is its whole reason",
441
- );
442
- // The citation, bound to the keying it is evidence for. Quoted from
443
- // `omp://tools/eval.md` so the next editor can re-check the claim at its
444
- // source rather than trusting this file.
445
- assert.match(
446
- b,
447
- /keyed by `python:\$\{sessionId\}`, normalized cwd and interpreter.{0,80}?Parent and ordinary task subagents may share an inherited eval executor id/,
448
- "the kernel-keying claim is no longer bound to the upstream sentence that establishes subagents inherit the executor id",
449
- );
450
- // THE ACCEPT CASE. Every assertion above pins something the block must
451
- // FORBID; a rule this emphatic is one edit away from being read as "do not
452
- // use the kernel", which would be wrong — eval's own `agent()` children are
453
- // isolated by construction, and per-member use is fine once namespaced. This
454
- // pin is what keeps the permission in the block alongside the prohibitions.
455
- assert.match(
456
- b,
457
- phrase("Using the kernel is not the defect, and this is not the `isolated` question — the bare name, the relative path and the reset are"),
458
- "the block no longer states what it permits, so its prohibitions read as a ban on using the eval kernel at all",
459
- );
460
- });
461
-
462
- test("the enumerate-the-class block carries all three of its halves, each with its own instruction", () => {
463
- const b = enumerateBlock();
464
- // Half one: enumerating bound to declaring. Enumerating privately and fixing
465
- // the named cases is the exact failure the block exists to stop, and it
466
- // satisfies a pin on "enumerate" alone.
467
- assert.match(
468
- b,
469
- /enumerate every member of that class.{0,120}?say which you cover and which you deliberately leave/,
470
- "enumerating the class is no longer bound to declaring what is covered and what is left",
471
- );
472
- // The ordering, as one span: prose FIRST, mechanism second. Two independent
473
- // presence checks pass with the two sources swapped, which is precisely the
474
- // enumeration order that missed a case its own ticket named in passing.
475
- assert.match(
476
- b,
477
- phrase("Build that list from the ticket's own prose first, then from the mechanism"),
478
- "the enumeration order no longer runs from the ticket's prose to the mechanism",
479
- );
480
- // Half two: the false-positive question bound to the test it demands. The
481
- // question alone is answerable on paper; the test is what makes it evidence.
482
- assert.match(
483
- b,
484
- /what can this change wrongly REFUSE\?.{0,300}?leave one test behind that feeds it input it must ACCEPT/,
485
- "the wrongly-REFUSE half no longer asks for a test feeding input the change must accept",
486
- );
487
- // Half three, and the one most easily read as a restatement of half one: it
488
- // is about the EDIT, not the bug class. Bound to the instruction that makes
489
- // it actionable, or it degenerates into advice.
490
- assert.match(
491
- b,
492
- phrase("The third is about YOUR EDIT: enumerate what your change newly does"),
493
- "the third half no longer distinguishes the edit's own effects from the bug class",
494
- );
495
- assert.match(
496
- b,
497
- phrase("Ask which of the ticket's own acceptance criteria your restructuring could newly violate, and test that path"),
498
- "the third half no longer names the acceptance criteria a restructuring can newly violate",
499
- );
500
- // The closing rule, bound to what a green suite does and does not prove.
501
- assert.match(
502
- b,
503
- /check the suite can even see the mode you changed.{0,400}?A green suite is evidence only about the paths it exercises/,
504
- "the suite-visibility rule is no longer bound to what a green suite is evidence of",
505
- );
506
- });
507
-
508
- test("the sizing block makes the verdict checkable — signal beside it, and the run dated in the report", () => {
509
- // #1070. The controller's whole read of this covariate is one `Sizing:` line,
510
- // and a line typed in before `sizing-a-ticket` ever ran is byte-identical to
511
- // one the skill produced. Measured on a member that wrote the verdict first
512
- // and caught itself afterwards; nothing in the pipeline would have.
513
- //
514
- // Two halves, pinned as spans rather than as presence, for this file's
515
- // standing reason: the instruction to emit a verdict already existed and was
516
- // already pinned (tier-outcomes-header.test.mjs), and every mutation that
517
- // matters here leaves that instruction intact while gutting what makes it
518
- // checkable.
519
- const b = sizingBlock();
520
-
521
- // Half one: the verdict bound to the signal it must carry. A pin on
522
- // `Sizing: light`/`Sizing: heavy` alone is satisfied by the pre-#1070 wording.
523
- assert.match(
524
- b,
525
- /`Sizing: light` or `Sizing: heavy`, and name the signal it turned on beside it/,
526
- "the sizing line no longer has to carry the signal the verdict turned on",
527
- );
528
- // …and the consequence, which is what a spliced "the verdict alone is fine"
529
- // has to contradict rather than merely sit beside.
530
- assert.match(
531
- b,
532
- phrase("A verdict with nothing beside it is indistinguishable from a guess, and is recorded as one"),
533
- "a bare verdict no longer costs the member anything, so the signal is advisory",
534
- );
535
- // The form the signal takes, bound to its reason. Without the reason this
536
- // reads as style advice; with it, pasting the skill's output is the named
537
- // wrong answer — which is the half that keeps this line alive across a
538
- // `sizing-a-ticket` output change.
539
- assert.match(
540
- b,
541
- phrase("never paste the skill's output, because that format will change and this line has to outlive it"),
542
- "the signal's form is no longer held independent of the sizing skill's own output layout",
543
- );
544
-
545
- // Half two: the report's ordering clause, bound to what it is ordered
546
- // AGAINST. "Report when you ran it" alone is satisfied by a member reporting
547
- // a wall-clock time nobody can compare the PR against.
548
- assert.match(
549
- b,
550
- phrase("the head SHA, and WHEN you ran `sizing-a-ticket` relative to opening the PR"),
551
- "the report no longer has to date the sizing run against the PR being opened",
552
- );
553
- // The direction, as one span. `before` and `after` are a one-word splice, and
554
- // a pin that matched either would pass on the exact defect this ticket is.
555
- assert.match(
556
- b,
557
- phrase('"ran sizing-a-ticket at step 6, before `gh pr create`"'),
558
- "the worked example no longer shows the sizing run preceding the PR, so the clause no longer has a direction",
559
- );
560
- assert.match(
561
- b,
562
- phrase("an unreported ordering costs the covariate"),
563
- "omitting the ordering clause no longer costs the member anything, so the clause is optional in practice",
564
- );
565
- });
566
-
567
- test("a rewrapped block still matches — these pins refuse drift, not reflow", () => {
568
- // The ACCEPT side. Re-wrapping a paragraph is not drift, and a pin that
569
- // reddened on it would be deleted by the next person who reflowed this file.
570
- //
571
- // What this test uniquely holds open: every block pin above spans a line
572
- // break, so all of them hold `flatten`'s line join open at TODAY'S wrap
573
- // points, and this is the only test that exercises it at wrap points the file
574
- // does not currently contain. A `flatten` that handled today's breaks by
575
- // accident would survive every one. (Before #1804 the blocks carried a `>`
576
- // gutter too, which `flatten` still strips for any pin that meets one.)
577
- //
578
- // Stated as a property, not a count, deliberately. This comment said "six"
579
- // and "the five of them" until the PR one block below it added a seventh and
580
- // did not update them — a count is false the moment the next test lands, and
581
- // this one rotted inside the single PR that measured it.
582
- //
583
- // The fixture is DERIVED from the live block, never a quoted line. Measured:
584
- // the first draft quoted one, and then any reword of that line reddened this
585
- // test on the fixture guard rather than on the pin — an accept control that
586
- // reddens on the edits it exists to accept is worse than none.
587
- const raw = between(region(), "Commit incrementally", "**Every scratch file", "phase 2's commit-incrementally block");
588
- // Trimmed back to the BLOCK: `between`'s `to` anchor is the next block's
589
- // opening words, so `raw` runs past this block's last line through the blank
590
- // line that separates the two. The separator is re-appended explicitly below,
591
- // so the next block still opens its own paragraph after the splice.
592
- const body = raw.replace(/\s*$/, "");
593
- // Re-wrapped at a narrower width than the file uses, so every wrap point
594
- // lands somewhere different from today's. Wrapping at word boundaries, not
595
- // one word per line: an unconditional break would split the slice's own
596
- // opening anchor and red this test on the anchor rather than on the pin.
597
- const words = body.split(/\s+/).filter(Boolean);
598
- const lines = words.reduce((acc, w) => {
599
- const last = acc[acc.length - 1];
600
- if (last && `${last} ${w}`.length <= 45) acc[acc.length - 1] = `${last} ${w}`;
601
- else acc.push(w);
602
- return acc;
603
- }, []);
604
- // The separator re-appended explicitly, so the next block still opens its own
605
- // paragraph. With `body` bounded to the block this guard is load-bearing
606
- // again: it now reds when the source block is already at this width.
607
- const narrow = lines.join("\n") + "\n\n";
608
- assert.notEqual(narrow, raw, "the rewrap fixture no longer changes the block's wrapping — update it");
609
- // Replacer function, not a replacement string: `$&`, `$'` and `` $` `` are
610
- // interpreted in the latter. The commit block carries no `$` today, which is
611
- // exactly the kind of thing that stops being true without anyone noticing.
612
- const flat = flatten(between(region(BODY.replace(raw, () => narrow)), "Commit incrementally", "**Every scratch file", "rewrapped commit block"));
613
- assert.match(flat, phrase("Commit incrementally as you go. Do not accumulate a large uncommitted diff"));
614
- assert.match(flat, phrase("uncommitted work is invisible to the controller and effectively unrecoverable"));
615
- });