@feigi/fleet-ctl 3.29.6 → 3.29.8

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.29.6",
3
+ "version": "3.29.8",
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": {
@@ -182,9 +182,9 @@ export function readout({ features, members }) {
182
182
  * before the ruling, and only when that Pull is
183
183
  * countable: admissible, at a cell named in `added` other than the policy
184
184
  * cell, and dated on or after the day that cell's definition was added.
185
- * Throws on the ruling of a ticket with a countable Pull whose
186
- * `closed_own_ticket` or `minted_false_claim` is not `yes` or `no`, on a
187
- * non-blank ruling row of such a ticket whose `run_date` is not `YYYY-MM-DD`,
185
+ * Throws on a non-blank ruling row of a ticket with a countable Pull whose
186
+ * `closed_own_ticket` or `minted_false_claim` is not `yes` or `no` or whose
187
+ * `run_date` is not `YYYY-MM-DD`,
188
188
  * on an admissible Pull at a cell named in `added` whose `run_date` is not
189
189
  * `YYYY-MM-DD`, on any Pull of a ruled ticket with a countable Pull whose
190
190
  * `run_date` is not `YYYY-MM-DD`, and on a member-outcomes session+agent
@@ -47,8 +47,9 @@
47
47
  # Exit status: 0 the command is printed; 1 a refusal about the cache, the
48
48
  # repository or the arguments; 3 a tool this script needs to read the cache
49
49
  # (git, node, mktemp, cat) could not be started, mktemp could not create its
50
- # temp file, git did not run to an answer, or node died mid-read, so nothing
51
- # was read and the cache's usability is unknown.
50
+ # temp file, git did not run to an answer, node died mid-read, or node exited
51
+ # non-zero with no reason and a status other than 2, its only verdict on the
52
+ # cache, so nothing was read and the cache's usability is unknown.
52
53
  set -eu
53
54
 
54
55
  # Byte semantics for every construct below that reads a string by bytes:
@@ -98,10 +99,10 @@ die() { printf '%s: %s\n' "$NAME" "$1" >&2; exit 1; }
98
99
  # A refusal about the environment, not the cache: a tool this script needs to
99
100
  # read the cache (git, the interpreter, mktemp, cat) could not be started,
100
101
  # mktemp could not create its temp file, git did not run to an answer, or the
101
- # interpreter died mid-read, so nothing was read and the cache's usability is
102
- # unknown. Exit 3, where every refusal about the cache, the repository or the
103
- # arguments is exit 1. A consumer that only tests for non-zero sees no
104
- # difference.
102
+ # interpreter died mid-read or failed without a reason, so nothing was read
103
+ # and the cache's usability is unknown. Exit 3,
104
+ # where every refusal about the cache, the repository or the arguments is
105
+ # exit 1. A consumer that only tests for non-zero sees no difference.
105
106
  unrunnable() { printf '%s: %s\n' "$NAME" "$1" >&2; exit 3; }
106
107
 
107
108
  # Named once: every refusal that sends the caller to re-derive names the same
@@ -229,6 +230,8 @@ process.stdout.write(open + value + close);
229
230
  # node's own refusal of the cache is exit 2 (an uncaught fault is exit 1), the
230
231
  # reason on stderr either way; a status of 126 or above is the shell failing to
231
232
  # run node or the system killing it mid-read, which says nothing about the cache.
233
+ # Only status 2 is node's verdict on the cache: every check above refuses
234
+ # through `bad`, so any other status is a fault outside those checks.
232
235
  if [ "$rc" -ge 126 ]; then
233
236
  unrunnable "node did not finish reading the Recipe cache (exit $rc), so its usability is unknown"
234
237
  fi
@@ -244,16 +247,26 @@ fi
244
247
  # which `set -u` then trips on) fails the substitution, and the `||` names that
245
248
  # in the reason instead of aborting on the shell's own error, which under dash
246
249
  # would also be an exit outside 0/1/3. A stderr that was read back but held
247
- # nothing, only newlines, or only blanks (spaces, tabs, CRs) names the exit
248
- # status instead of a reason that reads as blank. The blank set is spelled out,
249
- # not a `[:space:]` class: this script's locale inventory stays what the pin
250
- # comment above says it is. The `.` guards the newline that `$(…)` would strip.
250
+ # nothing, only newlines, or only blanks (spaces, tabs, CRs) is no reason: with
251
+ # status 2 it names the exit status instead of a reason that reads as blank;
252
+ # with any other status node failed and said nothing about the cache, so its
253
+ # usability is unknown and that is exit 3.
254
+ # The blank set is spelled out, not a `[:space:]` class: this script's locale
255
+ # inventory stays what the pin comment above says it is. The `.` guards the
256
+ # newline that `$(…)` would strip.
251
257
  if [ "$rc" -ne 0 ]; then
252
258
  reason=$({ while IFS= read -r line || [ -n "$line" ]; do printf '%s\n' "$line"; done <"$errf"; } 2>/dev/null) ||
253
259
  reason="(node's reason could not be read back from $errf)"
254
260
  blank=$(printf ' \t\r\n.')
255
261
  blank=${blank%.}
256
- case $reason in *[!"$blank"]*) ;; *) reason="(node gave no reason, exit $rc)" ;; esac
262
+ case $reason in
263
+ *[!"$blank"]*) ;;
264
+ *)
265
+ [ "$rc" -eq 2 ] ||
266
+ unrunnable "node exited $rc without a reason, so its usability is unknown — an environment fault, not a verdict on the cache"
267
+ reason="(node gave no reason, exit $rc)"
268
+ ;;
269
+ esac
257
270
  die "the Recipe cache at $cache is unusable: $reason — $derive"
258
271
  fi
259
272
  carriedmsg="node's stdout carried more than the framed Recipe value — expected exactly the value between '$open' and '$close', got '$framed'. The cache at $cache passed validation; the extra output comes from how node is launched here (a version-manager or proxy shim, a preload), and is refused rather than cut out of the command"
@@ -63,10 +63,10 @@
63
63
  // included, or that git started and could not run; the reader's `sh`,
64
64
  // `node`, `mktemp` or `cat` could not be started, its `mktemp` could
65
65
  // not create its temp file, its `sh` was killed by a signal, or its
66
- // `node` died mid-read — a `cat` that ran and failed stays the
67
- // reader's refusal, exit 1; the cache or its temp file could not be
68
- // written). The log directory under $TMPDIR is
69
- // removed.
66
+ // `node` died mid-read or exited without a reason and a status other
67
+ // than 2 — a `cat` that ran and failed stays the reader's refusal,
68
+ // exit 1; the cache or its temp file could not be written). The log
69
+ // directory under $TMPDIR is removed.
70
70
 
71
71
  import { spawnSync } from "node:child_process";
72
72
  import { closeSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
@@ -120,7 +120,8 @@ const notProven = (message) => new Refusal(1, message);
120
120
 
121
121
  // The exit status derive-testcmd.sh uses for a refusal about its own
122
122
  // environment — a tool it needs would not start, git did not run to an answer,
123
- // or node died mid-read — where every refusal about the cache is 1.
123
+ // or node died mid-read or failed without a reason —
124
+ // where every refusal about the cache is 1.
124
125
  const READER_COULD_NOT_RUN = 3;
125
126
 
126
127
  function parseArgs(argv) {
@@ -300,7 +301,8 @@ function prove(o, wt, logs) {
300
301
  // status and reached no verdict; a reader that exits READER_COULD_NOT_RUN
301
302
  // could not start its git, `node`, `mktemp` or `cat`, could not create its
302
303
  // temp file, saw git end on any status but git's own 128, or lost its `node`
303
- // mid-read; and the reader reads a git that ends on 128 as no repository at
304
+ // mid-read or saw it exit without a reason on a status other than 2; and the
305
+ // reader reads a git that ends on 128 as no repository at
304
306
  // all, so its refusal is a verdict on what was proven only while git still
305
307
  // runs. `git --version` is the probe for that exit-1 refusal: a working git
306
308
  // always passes it, so a git that cannot be started fails it, and so does one
@@ -160,22 +160,20 @@ export class RulingError extends Error {}
160
160
 
161
161
  // The row ruling `ticket`'s Pull dated `pullDate`, from `rulingsByTicket`: its
162
162
  // last ruling in file order dated on or after the Pull, since a ruling never
163
- // predates the Pull it rules — or null. Throws a `RulingError` on a ruling of
164
- // the ticket whose `run_date` is not YYYY-MM-DD, which cannot be placed against
165
- // the Pull and whose drop would uncount the ticket, and on the ruling it picks
166
- // holding anything but `yes` or `no` in a verdict column, which would otherwise
163
+ // predates the Pull it rules — or null. Throws a `RulingError` on any ruling of
164
+ // the ticket, picked or not, whose `run_date` is not YYYY-MM-DD, which cannot be
165
+ // placed against the Pull and whose drop would uncount the ticket, or which
166
+ // holds anything but `yes` or `no` in a verdict column, which would otherwise
167
167
  // read as a pass.
168
168
  export function rulingFor(rulings, ticket, pullDate) {
169
169
  const own = rulings.get(String(ticket)) ?? [];
170
170
  for (const r of own) {
171
171
  if (!DATE.test(r.run_date)) throw new RulingError(`ticket #${ticket} (PR #${r.pr}): run_date is '${r.run_date}', expected YYYY-MM-DD`);
172
+ for (const c of VERDICT_COLUMNS) {
173
+ if (!VERDICT.includes(r[c])) throw new RulingError(`ticket #${ticket} (PR #${r.pr}): ${c} is '${r[c]}', expected yes or no`);
174
+ }
172
175
  }
173
- const v = own.findLast((r) => r.run_date >= pullDate);
174
- if (!v) return null;
175
- for (const c of VERDICT_COLUMNS) {
176
- if (!VERDICT.includes(v[c])) throw new RulingError(`ticket #${ticket} (PR #${v.pr}): ${c} is '${v[c]}', expected yes or no`);
177
- }
178
- return v;
176
+ return own.findLast((r) => r.run_date >= pullDate) ?? null;
179
177
  }
180
178
 
181
179
  // Every member-outcomes.tsv row for the ticket's implementer, of ANY agent