@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,216 +0,0 @@
1
- // #1344, ruled on #1315. The worktree/claim model section documents five
2
- // rulings: claim, release and reap are git-native and unchanged on omp;
3
- // `isolated: true` is never used for a fleet member, because it
4
- // patch-applies into the CALLING SESSION's cwd on completion rather than
5
- // confining a member to its claimed worktree — the precise spill this
6
- // section exists to prevent; a member addresses its worktree by absolute
7
- // path — the shared invariant, with a stated recipe for handing a member
8
- // its cwd; `release-ticket.sh`/`inflight.sh` are unaffected by a live
9
- // member; and the controller's own cwd stays the main checkout.
10
- //
11
- // The one measured gap: whether omp's `task` tool accepts a per-dispatch
12
- // working directory. It does not — `omp://tools/task.md`'s item schema has no
13
- // `cwd` field, and a probe subagent dispatched with none of those fields
14
- // returned the calling session's own `pwd`, not a claimed worktree. So the
15
- // cwd-recipe paragraph states the absolute-path discipline as the recipe,
16
- // not a translation of a feature that does not exist. `effort` and
17
- // `isolated` are themselves conditional fields on that schema (present only
18
- // when `task.enableEffort`/`task.isolation.enabled` are on), so the
19
- // paragraph only claims a missing cwd field for the schema as it actually
20
- // appears, not for a fixed field list.
21
- //
22
- // CEILING: presence and doesNotMatch pins over bounded slices, one contiguous
23
- // regex per claim, gaps sized to the actual prose plus a small margin rather
24
- // than a round number — a round, generous gap (e.g. `{0,400}`) has room for an
25
- // inserted "unless X" exception clause to survive inside it; a tight one does
26
- // not (checked: splicing a ~140-char clause into the isolated-prohibition gap
27
- // reds the test). What these still cannot catch is a whole new sentence
28
- // appended AFTER a clause carving out an exception, or a reflow that keeps
29
- // every pinned word but reorders which paragraph they sit in.
30
- import { test } from "node:test";
31
- import assert from "node:assert/strict";
32
- import { readFileSync } from "node:fs";
33
- import { join } from "node:path";
34
- import { between, phrase } from "./prose-pin.mjs";
35
-
36
- const REPO = join(import.meta.dirname, "..");
37
- const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
38
-
39
- const section = () =>
40
- between(
41
- RUN_TEAM,
42
- "## Worktree and claim model",
43
- "## Queue depth",
44
- "run-team/SKILL.md",
45
- );
46
-
47
- // Nested inside `section()` (never `RUN_TEAM` directly), so a sibling
48
- // ticket's own prose elsewhere in the file cannot satisfy or break these
49
- // anchors.
50
- const cwdRecipe = () =>
51
- between(section(), "**A member's tree is the claimed worktree", "\n\n**The one open gap", "run-team/SKILL.md cwd recipe");
52
-
53
- test("run-team/SKILL.md: claim, release and reap are named unchanged on omp, with no dialect branch", () => {
54
- assert.match(
55
- section(),
56
- /Claim,\s+release\s+and\s+reap\s+are\s+unchanged\s+on\s+omp[\s\S]{0,400}none\s+of\s+the\s+four\s+scripts\s+carries\s+a\s+dialect\s+branch/,
57
- "the four scripts (claim/release/reap/inflight) are no longer named as unchanged and dialect-branch-free on omp",
58
- );
59
- });
60
-
61
- test("run-team/SKILL.md: isolated is never used, with the calling-session-cwd spill measured", () => {
62
- // ONE contiguous span: the prohibition alone, without the measured spill
63
- // mechanism, reads as an unexplained rule a future editor could "simplify"
64
- // away — the mechanism is why the prohibition cannot move. Gaps are sized
65
- // to the actual prose (60/138/3/91 chars measured) plus a small margin, not
66
- // a round generous number: a round `{0,300}` has room for a spliced-in
67
- // "unless X" exception clause (~140 chars) to survive inside it; these do
68
- // not.
69
- assert.match(
70
- section(),
71
- /`isolated:\s+true`[\s\S]{0,80}~\/\.omp\/wt\/<hash>\/m[\s\S]{0,160}patch-applied\s+into\s+the[\s\S]{0,20}calling\s+session's\s+own\s+cwd[\s\S]{0,120}probe-isolated\.txt/,
72
- "the isolated-never-used rule or its measured evidence (workspace path, patch-apply-into-calling-session's-cwd, the probe file) is gone, or an exception clause was spliced into one of the tightened gaps",
73
- );
74
- assert.match(
75
- section(),
76
- phrase("`isolated` stays unused for every member and `task.isolation.enabled` stays off"),
77
- );
78
- // The measured/inferred split the review demanded: the probe measured its
79
- // own session's cwd, not "the controller's main checkout" directly — the
80
- // controller case is stated as the explicit inference it is, not folded
81
- // into the measurement.
82
- assert.match(
83
- section(),
84
- phrase("in the probe session's own cwd — which for an actual fleet run is the controller's main checkout"),
85
- "the probe-cwd sentence no longer distinguishes what was measured from the controller case it infers",
86
- );
87
- });
88
-
89
- // #1447. The third measurement this section carries, and the one whose
90
- // hazard is least visible to the repo: `isolated` and the missing `cwd`
91
- // field are both about where BYTES land, so `git status` can catch them
92
- // after the fact. A shared kernel's bare-name collision and its `reset`
93
- // collide and destroy in memory, leaving nothing behind; only its
94
- // relative-path case shows up, and only when the cell writes — which is
95
- // why the measurement is recorded here rather than left to the incident
96
- // that found it.
97
- test("run-team/SKILL.md: the shared eval kernel is measured, with the isolated-by-construction exception kept", () => {
98
- // The claim bound to its evidence, and to the fact that it was measured in a
99
- // LIVE run — every other measurement in this section came from a throwaway
100
- // probe clone, and a reader who assumes the same of this one would discount
101
- // it as not reproducing the real dispatch path.
102
- assert.match(
103
- section(),
104
- /`task`-dispatched\s+members\s+share\s+one\s+`eval`\s+kernel[\s\S]{0,80}live\s+run\s+rather\s+than\s+a\s+probe\s+clone[\s\S]{0,170}same\s+Python\s+kernel\s+pid[\s\S]{0,90}each\s+read\s+the\s+others'\s+top-level\s+bindings/,
105
- "the shared-kernel claim, its live-run provenance, or the pid/cross-read evidence behind it is gone",
106
- );
107
- assert.match(
108
- section(),
109
- phrase("a bare `WT` bound by one member was read back by a sibling and by the controller"),
110
- "the reproduced collision no longer names the bare variable the original report was filed on",
111
- );
112
- // WHY the sharing follows from the documented keying. Without this, the
113
- // keying reads as a partition and the conclusion looks unsupported — the
114
- // point is that both key components are constant across one run's members.
115
- assert.match(
116
- section(),
117
- phrase("the session id is inherited from the controller, and the cwd is the main checkout for all of them"),
118
- "the section no longer explains why the documented kernel key fails to separate two members of one run",
119
- );
120
- // THE EXCEPTION, quoted from upstream. This is the boundary that stops the
121
- // finding being generalised into "subagent state is never isolated": eval's
122
- // own `agent()` children are isolated by construction, and a future editor
123
- // deciding how to fix this needs to know which spawns already are.
124
- assert.match(
125
- section(),
126
- phrase("children created by eval's own `agent()` explicitly do not"),
127
- "the isolated-by-construction exception for eval's own agent() children is gone, so the finding reads as covering every spawn",
128
- );
129
- // The corollary bound to its blast radius — `reset` is the destructive half
130
- // of the same mechanism, and it is the one a member reaches for innocently.
131
- assert.match(
132
- section(),
133
- /corollary\s+is\s+`reset`[\s\S]{0,140}resetting\s+its\s+own\s+kernel\s+resets\s+every[\s\S]{0,20}concurrent\s+sibling's/,
134
- "the reset corollary or the sibling damage it causes is gone from the section",
135
- );
136
- // THE ANSWER TO #1447's REMEDY 2, recorded rather than left open. A reader
137
- // who knows only that the kernel is shared will go looking for the dispatch
138
- // flag that turns it off; the point is that there isn't one, which is what
139
- // makes the prose rules the remedy instead of a stopgap standing in for a
140
- // field. Bound to the lever that does exist, so "no knob" cannot be read as
141
- // "nobody checked".
142
- assert.match(
143
- section(),
144
- /No\s+per-dispatch\s+knob\s+turns\s+any\s+of\s+this\s+off[\s\S]{0,50}no\s+kernel,\s+executor\s+or\s+cwd\s+field[\s\S]{0,180}session\s+setting\s+a\s+child\s+inherits,\s+not\s+something\s+one\s+dispatch\s+can[\s\S]{0,30}set\s+for\s+one\s+member/,
145
- "the section no longer records that no per-dispatch knob isolates a member's kernel, or drops the inherited-session-setting reason behind it",
146
- );
147
- // The measurement is only worth recording if it reaches members. Phase 2 is
148
- // where the rules are carried verbatim, so the pointer is pinned with it.
149
- assert.match(
150
- section(),
151
- phrase("**Phase 2** carries all three rules to every member"),
152
- "the section no longer points at the phase that actually delivers these rules to a member",
153
- );
154
- });
155
-
156
- test("run-team/SKILL.md: absolute-path addressing is stated as the shared contract", () => {
157
- assert.match(
158
- section(),
159
- /member's\s+tree\s+is\s+the\s+claimed\s+worktree,\s+addressed\s+by\s+absolute\s+path/,
160
- "the absolute-path rule is no longer stated",
161
- );
162
- });
163
-
164
- test("run-team/SKILL.md: the cwd recipe names the task tool's missing cwd field, its conditional fields, and the measured pwd result", () => {
165
- assert.match(
166
- cwdRecipe(),
167
- /`task`\s+tool's\s+item\s+schema[\s\S]{0,250}only\s+when\s+their\s+own\s+settings\s+enable\s+them[\s\S]{0,80}carries\s+no\s+working-directory\s+field[\s\S]{0,250}returned\s+the\s+calling\s+session's\s+own\s+cwd,\s+not\s+the\s+claimed\s+worktree/,
168
- "the cwd recipe no longer names the task tool's schema, its conditional fields, or the measured pwd result",
169
- );
170
- // `effort`/`isolated` are conditional, not always-present fields — the
171
- // recipe must say so rather than presenting a fixed field list.
172
- assert.match(
173
- cwdRecipe(),
174
- phrase("`effort`/`isolated` only when their own settings enable them"),
175
- "the cwd recipe presents effort/isolated as always-present schema fields rather than conditional ones",
176
- );
177
- assert.match(
178
- cwdRecipe(),
179
- phrase("`bash`'s own `cwd` parameter set to it on every call and absolute paths for `write`/`edit`"),
180
- );
181
- });
182
-
183
- test("run-team/SKILL.md: the measured gap states task has no per-dispatch cwd, quoting the doc", () => {
184
- assert.match(
185
- section(),
186
- /`task`\s+does\s+not\s+accept\s+a[\s\S]{0,30}per-dispatch\s+working\s+directory[\s\S]{0,200}directly\s+with\s+parent\s+cwd[\s\S]{0,200}no\s+`cwd`\s+field\s+appears\s+anywhere\s+in\s+the\s+item\s+schema/,
187
- "the gap verdict, or the omp://tools/task.md quote it rests on, is gone",
188
- );
189
- });
190
-
191
- test("run-team/SKILL.md: release-ticket.sh is not a no-op on omp and inflight.sh's probes are unaffected", () => {
192
- assert.match(
193
- section(),
194
- /`release-ticket\.sh`\s+is\s+not\s+a\s+no-op\s+on\s+omp,\s+and\s+`inflight\.sh`'s\s+probes\s+are\s+unaffected\s+by\s+a\s+running\s+member/,
195
- "the release/inflight headline claim is gone",
196
- );
197
- assert.match(
198
- section(),
199
- phrase("`~/.omp/wt/` was empty after every isolated run: omp's own teardown touches only omp's own workspace, never the claim"),
200
- "the measured teardown-scope evidence behind 'not a no-op' is gone",
201
- );
202
- assert.match(
203
- section(),
204
- phrase("`inflight.sh` hides nothing from omp"),
205
- );
206
- });
207
-
208
- test("run-team/SKILL.md: the controller's own cwd staying the main checkout gets its own stated ruling", () => {
209
- // Ruling 4 on its own, not folded as a trailing clause onto the
210
- // release/inflight paragraph above it.
211
- assert.match(
212
- section(),
213
- phrase("The controller's own cwd stays the main checkout, unchanged"),
214
- "ruling 4 (the controller's own cwd is unchanged) no longer has its own stated sentence",
215
- );
216
- });
@@ -1,35 +0,0 @@
1
- // What a test guard may ask of a `git worktree list --porcelain` listing.
2
- //
3
- // Every `worktree` line carries the full path, and a fixture's path starts
4
- // with the operator's TMPDIR, so a guard that greps the whole listing for a
5
- // fixture's name or for an attribute answers for TMPDIR as well: one holding
6
- // `locked`, `stale-wt` or `79-brief` failed the guard that looks for its
7
- // absence (#2531). These read only the parts a fixture controls.
8
-
9
- /**
10
- * The names the listing gives its worktrees: each `worktree` line's last path
11
- * component, and each `branch refs/heads/` line's branch. The directories
12
- * above a worktree are never a name.
13
- */
14
- export const worktreeNames = (porcelain) =>
15
- porcelain.split("\n").flatMap((l) =>
16
- l.startsWith("worktree ") ? [l.slice("worktree ".length).replace(/.*\//, "")]
17
- : l.startsWith("branch refs/heads/") ? [l.slice("branch refs/heads/".length)]
18
- : []);
19
-
20
- const ATTRIBUTES = new Set(["locked", "prunable", "detached"]);
21
-
22
- /**
23
- * Whether any worktree in the listing carries the attribute `attr`
24
- * (`locked`, `prunable`, `detached`). git prints an attribute on a line of its
25
- * own, the bare word or the word, a space and a reason, so the line is matched
26
- * whole and a path containing the word never is. Any other `attr` throws: a
27
- * misspelling would answer false for ever, and a guard that asserts the
28
- * attribute's absence would pass on it.
29
- */
30
- export const hasAttribute = (porcelain, attr) => {
31
- if (!ATTRIBUTES.has(attr)) {
32
- throw new Error(`hasAttribute: unknown attribute ${JSON.stringify(attr)}; one of ${[...ATTRIBUTES].join(", ")}`);
33
- }
34
- return porcelain.split("\n").some((l) => l === attr || l.startsWith(`${attr} `));
35
- };
@@ -1,102 +0,0 @@
1
- // worktree-porcelain.mjs against real `git worktree list --porcelain` output.
2
- // Zero deps: `node --test plugin/scripts/worktree-porcelain.test.mjs`.
3
-
4
- import { test } from "node:test";
5
- import assert from "node:assert/strict";
6
- import { execFileSync } from "node:child_process";
7
- import { mkdirSync, mkdtempSync, realpathSync, rmSync } from "node:fs";
8
- import { tmpdir } from "node:os";
9
- import { join } from "node:path";
10
- import { hasAttribute, worktreeNames } from "./worktree-porcelain.mjs";
11
-
12
- const ENV = {
13
- ...process.env,
14
- GIT_DIR: undefined,
15
- GIT_WORK_TREE: undefined,
16
- GIT_AUTHOR_NAME: "t",
17
- GIT_AUTHOR_EMAIL: "t@example.com",
18
- GIT_COMMITTER_NAME: "t",
19
- GIT_COMMITTER_EMAIL: "t@example.com",
20
- GIT_CONFIG_GLOBAL: "/dev/null",
21
- GIT_CONFIG_SYSTEM: "/dev/null",
22
- };
23
-
24
- const git = (cwd, ...args) =>
25
- execFileSync("git", args, { cwd, env: ENV, encoding: "utf8" }).trim();
26
-
27
- /**
28
- * A checkout on `main` whose parent directories spell the attributes the guards
29
- * look for (`locked`, `prunable`, `detached`) and some of the names they look
30
- * for (`feature/merged`, `79-brief`), the way an operator's TMPDIR can.
31
- */
32
- function repoUnder(t) {
33
- const root = realpathSync(mkdtempSync(join(tmpdir(), "worktree-porcelain-")));
34
- t.after(() => rmSync(root, { recursive: true, force: true }));
35
- const w = join(root, "locked", "prunable", "detached", "feature", "merged", "79-brief", "w");
36
- mkdirSync(w, { recursive: true });
37
- execFileSync("git", ["-c", "init.defaultBranch=main", "init", "-q", w], { env: ENV });
38
- git(w, "commit", "-q", "--allow-empty", "-m", "root");
39
- return w;
40
- }
41
-
42
- const listing = (w) => git(w, "worktree", "list", "--porcelain");
43
-
44
- test("a name or attribute that is only in a worktree's parent directories is not reported", (t) => {
45
- const w = repoUnder(t);
46
- git(w, "worktree", "add", "-q", "-b", "fix/9-x", join(w, ".worktrees", "9-x"), "main");
47
- const l = listing(w);
48
- for (const word of ["locked", "prunable", "detached", "feature/merged", "79-brief"]) {
49
- assert.ok(l.includes(word), `fixture: the listing must carry ${word} in a path: ${l}`);
50
- }
51
-
52
- assert.deepEqual(worktreeNames(l), ["w", "main", "9-x", "fix/9-x"]);
53
- for (const attr of ["locked", "prunable", "detached"]) {
54
- assert.equal(hasAttribute(l, attr), false, `${attr} is only a parent directory here: ${l}`);
55
- }
56
- });
57
-
58
- test("a worktree's own basename, branch and attributes are reported", (t) => {
59
- const w = repoUnder(t);
60
- const brief = join(w, ".worktrees", "79-brief");
61
- git(w, "worktree", "add", "-q", "-b", "feature/merged", brief, "main");
62
- const lone = join(w, ".worktrees", "lone");
63
- git(w, "worktree", "add", "-q", "--detach", lone, "main");
64
-
65
- assert.deepEqual(worktreeNames(listing(w)), ["w", "main", "79-brief", "feature/merged", "lone"]);
66
- assert.equal(hasAttribute(listing(w), "detached"), true, "the bare-word form");
67
-
68
- git(w, "worktree", "lock", brief, "--reason", "held by a review");
69
- assert.match(listing(w), /^locked held by a review$/m, "fixture: a reason follows the word on its line");
70
- assert.equal(hasAttribute(listing(w), "locked"), true, "the word-and-reason form");
71
- git(w, "worktree", "unlock", brief);
72
- git(w, "worktree", "lock", brief);
73
- assert.equal(hasAttribute(listing(w), "locked"), true);
74
- git(w, "worktree", "unlock", brief);
75
- assert.equal(hasAttribute(listing(w), "locked"), false);
76
-
77
- rmSync(lone, { recursive: true, force: true });
78
- assert.equal(hasAttribute(listing(w), "prunable"), true);
79
- });
80
-
81
- test("a lock reason that spells a guard's prefix is not a name", (t) => {
82
- const w = repoUnder(t);
83
- const a = join(w, ".worktrees", "a");
84
- git(w, "worktree", "add", "-q", "-b", "fix/a", a, "main");
85
- git(w, "worktree", "lock", a, "--reason", "worktree on usb");
86
- const b = join(w, ".worktrees", "b");
87
- git(w, "worktree", "add", "-q", "-b", "fix/b", b, "main");
88
- git(w, "worktree", "lock", b, "--reason", "branch refs/heads/held");
89
- const c = join(w, ".worktrees", "c");
90
- git(w, "worktree", "add", "-q", "-b", "fix/c", c, "main");
91
- git(w, "worktree", "lock", c, "--reason", "see refs/heads/held");
92
- const l = listing(w);
93
- for (const reason of ["worktree on usb", "branch refs/heads/held", "see refs/heads/held"]) {
94
- assert.match(l, new RegExp(`^locked ${reason}$`, "m"), `fixture: the reason is on its own line: ${l}`);
95
- }
96
-
97
- assert.deepEqual(worktreeNames(l), ["w", "main", "a", "fix/a", "b", "fix/b", "c", "fix/c"]);
98
- });
99
-
100
- test("an attribute git never prints is refused, not answered false", () => {
101
- assert.throws(() => hasAttribute("worktree /x\nlocked\n", "lock"), /unknown attribute "lock"/);
102
- });