@feigi/fleet-ctl 3.24.21 → 3.24.22

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feigi/fleet-ctl",
3
- "version": "3.24.21",
3
+ "version": "3.24.22",
4
4
  "description": "Agent fleet: run-team controller, merge bot, PR reviewer, and the ticket pipeline they share",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  #!/bin/sh
2
2
  # Read one command of a repository's proven Recipe out of its Recipe cache:
3
- # `install` (the Install step) or `test` (the Test entrypoint). ADR 0015.
3
+ # `install` (the Install step) or `test` (the Test entrypoint).
4
4
  #
5
5
  # The fleet keeps no table of technologies. A Recipe is DERIVED by an agent
6
6
  # reasoning over the repository and PROVEN before it is written — the Install
@@ -8,12 +8,12 @@
8
8
  # and showed real tests — so this script infers nothing. A missing cache is a
9
9
  # refusal naming the step that derives one, never a guess: a guessed command
10
10
  # that passes vacuously reads as a green suite to every consumer, which is the
11
- # #142 hazard the old inference already refused over.
11
+ # hazard the old inference already refused over.
12
12
  #
13
13
  # The ONE reader of the cache — reused, not reimplemented, by claim-ticket.sh
14
14
  # (the Install step it runs and the Test entrypoint it bakes into the runner)
15
15
  # and by review-core.mjs's snapshot agent (the Test entrypoint handed to the
16
- # specialists). Two independent readers is what drifts; see #142.
16
+ # specialists). Two independent readers is what drifts.
17
17
  #
18
18
  # THE CACHE is `<workspace>/.fleet/recipe.json`, where <workspace> is the
19
19
  # directory holding the repository's COMMON git dir — the main checkout, the
@@ -65,7 +65,7 @@ set -eu
65
65
  export LC_ALL=C
66
66
 
67
67
  # Below the locale pin, not above it with `set -eu`: `unset` touches no
68
- # byte-sensitive tool, but locale-pin-prose.test.mjs treats ANY line here that
68
+ # byte-sensitive tool, but the locale-pin prose test treats ANY line here that
69
69
  # is not a comment, a blank, or `set -[eux]+` as work the pin must sit above,
70
70
  # and refuses on principle rather than on this line's own behaviour. Same
71
71
  # placement, same reason, as release-ticket.sh's copy.
@@ -81,7 +81,7 @@ export LC_ALL=C
81
81
  # and `--git-common-dir` consult no work tree. It stays on the line because the
82
82
  # pair is one hazard with one remedy, and "inert today" is a measurement of the
83
83
  # current call set, not a property of the script.
84
- # ambient-git-vars-prose.test.mjs pins the line itself.
84
+ # A prose test pins the line itself.
85
85
  unset GIT_DIR GIT_WORK_TREE
86
86
 
87
87
  # shellcheck disable=SC2100 # literal name "derive-testcmd", not arithmetic — the unrelated $derive var assigned below is what the heuristic collides on, not this line
@@ -124,7 +124,7 @@ cache="${common%/*}/.fleet/recipe.json"
124
124
  # that ends it rather than anything about a parser.
125
125
  [ -e "$cache" ] || die "no Recipe cache at $cache — refusing to infer an Install step or a Test entrypoint; $derive"
126
126
 
127
- # An INVOCATION, not a name lookup (#1141): a version-manager shim satisfies
127
+ # An INVOCATION, not a name lookup: a version-manager shim satisfies
128
128
  # `command -v node` and then fails, and its stderr would arrive below under the
129
129
  # cache's name — a corrupt-cache refusal for a cache nobody read.
130
130
  nodeerr=$(node -e 0 </dev/null 2>&1) || unrunnable "node is unusable, refusing to read the Recipe cache without the interpreter — $nodeerr"
@@ -137,10 +137,10 @@ nodeerr=$(node -e 0 </dev/null 2>&1) || unrunnable "node is unusable, refusing t
137
137
  # is guarded on its own:
138
138
  #
139
139
  # stderr is kept APART — to a file, never merged into the capture — because
140
- # NODE_OPTIONS or NODE_DEBUG chatter lands there (#752, #1175).
140
+ # NODE_OPTIONS or NODE_DEBUG chatter lands there.
141
141
  #
142
142
  # stdout carries the value FRAMED, `recipe<` before it and `>recipe` after,
143
- # and the WHOLE capture must be exactly that frame, byte for byte (#2217):
143
+ # and the WHOLE capture must be exactly that frame, byte for byte:
144
144
  # the anchored match alone only proves the ends line up, so a shim whose
145
145
  # own chatter happens to spell out `recipe<`/`>recipe` around the real
146
146
  # frame would still pass it and splice that chatter into the value — node
@@ -237,7 +237,7 @@ value=${value%"$close"}
237
237
  # caller's "$@" as an unrelated top-level command instead of args reaching
238
238
  # the Test entrypoint, and one containing a `#`-led word swallows everything
239
239
  # after it, "$@" included, as a comment — measured on both. A trailing
240
- # newline is checked here too (#2217): the frame above lets a value keep one
240
+ # newline is checked here too: the frame above lets a value keep one
241
241
  # where an unframed `$(…)` capture always dropped it silently, so a value
242
242
  # that used to read as `true;` now reads as `true;\n` and would otherwise
243
243
  # slip past a check written for the no-newline case. Checked on the raw
@@ -19,7 +19,7 @@
19
19
  # and this file is sourced by the same scripts.
20
20
  #
21
21
  # Not folded into json.sh, which is scoped to JSON escaping: a filesystem
22
- # predicate and a `git` reader are neither. #725
22
+ # predicate and a `git` reader are neither.
23
23
 
24
24
  # The byte `wt_listing` substitutes for a newline found INSIDE a worktree path.
25
25
  #
@@ -71,7 +71,7 @@ nl_path() {
71
71
  # split into two and every consumer's `substr($0,10)` truncated the path at the
72
72
  # newline. Measured on a real linked worktree at `.../wt/fix-33<LF>slug`, git
73
73
  # 2.50.1: three scripts each handed a downstream consumer a path not on disk,
74
- # and none of them refused. #551, the defect #185 fixed in inflight.sh.
74
+ # and none of them refused — the defect already fixed in inflight.sh.
75
75
  #
76
76
  # `--porcelain -z` terminates every attribute with NUL instead, which needs git
77
77
  # 2.36.0 — a floor this repo already exceeds through no-undo-audit.sh's
@@ -80,7 +80,7 @@ nl_path() {
80
80
  # NOT `awk -v RS='\0'`. That is a gawk/BWK extension, and the awk this fleet
81
81
  # actually runs on macOS — /usr/bin/awk, BWK awk 20200816 — does not merely
82
82
  # ignore it: it stops dead at the first NUL and reports ONE record for a listing
83
- # of any length. Measured under #185, all three spellings, `-v RS='\0'`,
83
+ # of any length. Measured, all three spellings, `-v RS='\0'`,
84
84
  # `-v RS='\000'` and `BEGIN{RS="\0"}`, every one of them `count=1`. No awk
85
85
  # program can hold a NUL byte either, so the swap has to happen before awk sees
86
86
  # the stream at all.
@@ -153,14 +153,14 @@ wt_listing() {
153
153
  # alone reads its absence as unknown, which is the permanent refusal the callers
154
154
  # exist to stop producing.
155
155
  #
156
- # `[ ! -L "$look" ]` in the loop condition, and it is the whole of #725. Every
156
+ # `[ ! -L "$look" ]` in the loop condition, and it is the whole fix. Every
157
157
  # `test` primary except `-L` STATS, so it follows a symlink: on a dangling one
158
158
  # `-e` is false while `-L` is true, and the predicate answered established-absent
159
159
  # for a path `git worktree add` treats as occupied. Measured — worktree-audit.sh
160
160
  # reported such a path as `MISSING on disk` with `ahead=0, dirty=0`, which is
161
161
  # what the fleet controller reads to decide whether a replacement member would
162
- # redo work or destroy it. Same `-e`/lstat split #188 fixed one layer up in
163
- # claim-ticket.sh.
162
+ # redo work or destroy it. Same `-e`/lstat split claim-ticket.sh guards one
163
+ # layer up.
164
164
  #
165
165
  # In the LOOP condition rather than as a fourth clause on the result, because
166
166
  # that placement answers a second shape for free: a dangling symlink standing in
@@ -175,19 +175,19 @@ wt_listing() {
175
175
  # remove` that deleted a symlink's target, with no live claim; and
176
176
  # release-ticket.sh's rc-255 halt path, which leaves the link with the branch and
177
177
  # the `in-progress` label still alive — a live claim, mid-release, that failed
178
- # partway. "Not established-absent" is the only answer true of both. #728
178
+ # partway. "Not established-absent" is the only answer true of both.
179
179
  #
180
- # `look=${look:-/}` INSIDE the loop, and that placement is the whole of #178:
180
+ # `look=${look:-/}` INSIDE the loop, and that placement is the whole fix:
181
181
  # `${p%/*}` on `/x` yields the empty string, not `/`, so a path whose every
182
182
  # ancestor below the root is gone used to fall out on "" and answer unknown about
183
183
  # an absence the searchable root proves. The same restore written AFTER the loop
184
184
  # reads identically and is wrong — nothing enters the loop on an empty `$1`, so
185
185
  # it would rewrite that to `/` too and turn `gone ""` into established-absent.
186
- # Inside, it only ever rewrites what the loop just truncated. gone-walk.test.mjs
187
- # holds that matrix, `gone ""` included, because no caller can reach it: the
188
- # callers test the path non-empty first, and worktree-audit.sh reads its own off
189
- # `git worktree list`, which never emits an empty one — so a caller-level suite
190
- # alone cannot tell the two placements apart.
186
+ # Inside, it only ever rewrites what the loop just truncated. The suite's direct
187
+ # test of `gone` holds that matrix, `gone ""` included, because no caller can
188
+ # reach it: the callers test the path non-empty first, and worktree-audit.sh
189
+ # reads its own off `git worktree list`, which never emits an empty one — so a
190
+ # caller-level suite alone cannot tell the two placements apart.
191
191
  #
192
192
  # `!=`, not a non-empty test: `${p%/*}` returns p unchanged when p holds no
193
193
  # slash, so the emptiness form spins forever on one. git emits absolute paths to
@@ -197,8 +197,8 @@ wt_listing() {
197
197
  # One definition, in one file, because every caller asks one question. Answered
198
198
  # separately they drift, and the halves of this fleet that protect a member's
199
199
  # work stop agreeing about whether there is any work there to protect — which is
200
- # exactly what #725 found: three copies, and only one compensating, at a call
201
- # site rather than in the predicate.
200
+ # exactly what separate copies of it did: three, and only one compensating, at
201
+ # a call site rather than in the predicate.
202
202
  #
203
203
  # 0 ONLY for established absent; 1 covers present AND cannot-stat, so a caller
204
204
  # needing those apart pairs this with its own `[ ! -e ]`, as release-ticket.sh's
@@ -217,7 +217,7 @@ gone() {
217
217
  # worktree on disk holding an uncommitted file and for which prune is a no-op
218
218
  # — the permanent-refusal shape the surrounding guards exist to prevent.
219
219
  # Refused in the predicate rather than at each call site for the reason the
220
- # rest of this comment gives: answered separately, the callers drift. #551
220
+ # rest of this comment gives: answered separately, the callers drift.
221
221
  nl_path "$1" && return 1
222
222
  look=$1
223
223
  while [ ! -e "$look" ] && [ ! -L "$look" ] && [ "$look" != "${look%/*}" ]; do
@@ -259,11 +259,11 @@ gone() {
259
259
  # started from a detached HEAD is different: `BISECT_START` holds that HEAD's
260
260
  # full SHA, which the code below still turns into `refs/heads/<sha>` and
261
261
  # collects — matching only a branch literally named with that 40-hex string,
262
- # which nothing in this fleet's naming ever produces. #2218
262
+ # which nothing in this fleet's naming ever produces.
263
263
  #
264
264
  # `2>/dev/null` on the admin-dir read, NOT the `2>&1` the fleet's message-text
265
- # captures fold in, because this capture is used as a PATH. Measured (PR #985
266
- # review): a `~/.gitconfig` with a key outside any section makes every git
265
+ # captures fold in, because this capture is used as a PATH. Measured: a
266
+ # `~/.gitconfig` with a key outside any section makes every git
267
267
  # command print `error: key does not contain a section: …` to stderr AT EXIT 0,
268
268
  # so `2>&1` returns that line glued in front of the git dir, every `[ -e ]`
269
269
  # below then matches nothing, and a worktree holding an interrupted rebase reads
@@ -274,7 +274,7 @@ gone() {
274
274
  # that is not there, and only the second is an answer.
275
275
  #
276
276
  # `wt_op` is this function's OUTPUT, read by the sourcing script; so is
277
- # `wt_op_held`, read by `wt_holding` below and by worktree-audit.sh (#2220) —
277
+ # `wt_op_held`, read by `wt_holding` below and by worktree-audit.sh —
278
278
  # SC2034, as for `wt_listing`.
279
279
  #
280
280
  # The admin dir is normally found by asking git FROM $1 (`rev-parse
@@ -294,7 +294,7 @@ gone() {
294
294
  # the worktree path it was registered for, and that registry lives under this
295
295
  # repo's `.git`, never under the worktree — a directory `rm -rf`'d out from
296
296
  # under git leaves its bookkeeping, and whatever rebase or bisect state it
297
- # held, untouched. #2218
297
+ # held, untouched.
298
298
  # shellcheck disable=SC2034
299
299
  wt_op_state() {
300
300
  wt_op=
@@ -357,7 +357,7 @@ wt_op_state() {
357
357
  # there, is marked `prunable` too — the two are not the same fault), is what
358
358
  # tells `wt_op_state` it may look for that admin dir a different way; the
359
359
  # ordinary route — asking git FROM the worktree's own directory — cannot,
360
- # because there is no directory left to ask from. #2218
360
+ # because there is no directory left to ask from.
361
361
  #
362
362
  # A record naming neither a `branch` nor the literal `detached` line is a HEAD
363
363
  # git itself could not classify from the worktree's own directory — measured,
@@ -368,7 +368,7 @@ wt_op_state() {
368
368
  # is untouched — so this case resolves through the SAME registry route as a
369
369
  # gone worktree, unconditionally, rather than answering "cannot tell" for a
370
370
  # worktree that may hold nothing of this caller's at all. Only once even that
371
- # route cannot read an admin dir does this fall back to "cannot tell". #2218
371
+ # route cannot read an admin dir does this fall back to "cannot tell".
372
372
  #
373
373
  # Each record is read whole before it is judged — `branch`, `detached`, and
374
374
  # the boundary that ends it — never decided line by line, because a record's
@@ -462,7 +462,7 @@ wt_h_settle() {
462
462
  fi
463
463
  # Neither a `branch` line nor the literal `detached` line: git could not
464
464
  # classify this record's HEAD from the worktree's own directory at all (a
465
- # corrupted admin HEAD is the shape #2218 measured) — go straight to the
465
+ # corrupted admin HEAD is that shape, measured) — go straight to the
466
466
  # registry route, unconditionally, since the ordinary one already failed by
467
467
  # definition of being here.
468
468
  wt_h_check_op "$1" 1