@feigi/fleet-ctl 3.30.23 → 3.30.25

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.30.23",
3
+ "version": "3.30.25",
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": {
package/scripts/board.mjs CHANGED
@@ -1647,11 +1647,12 @@ function bindFailure(server, port) {
1647
1647
  // it. Linux refuses that bind outright; this check gives both the same answer.
1648
1648
  // Resolves in bindFailure()'s vocabulary so the loop reads one shape: null
1649
1649
  // when the connection is refused (nothing holds the port), an EADDRINUSE
1650
- // error when it connects or times out, and any other error as itself — a
1651
- // fault of its own, like EACCES on a bind. A timeout counts as held because
1652
- // a live holder whose accept backlog is full drops the SYN rather than
1653
- // refusing it. The window between this check and the bind is a race the
1654
- // loop accepts, like its others.
1650
+ // error when it connects or times out, and any other error as itself,
1651
+ // marked `heldCheck` — a fault of its own, like EACCES on a bind, which the
1652
+ // loop reports as this check's rather than the bind's, whatever code the
1653
+ // error carries. A timeout counts as held because a live holder whose accept
1654
+ // backlog is full drops the SYN rather than refusing it. The window between
1655
+ // this check and the bind is a race the loop accepts, like its others.
1655
1656
  function heldFailure(port) {
1656
1657
  return new Promise((resolve) => {
1657
1658
  const socket = connect({ host: COCKPIT_HOST, port });
@@ -1661,7 +1662,7 @@ function heldFailure(port) {
1661
1662
  };
1662
1663
  socket.setTimeout(PROBE_TIMEOUT_MS, held);
1663
1664
  socket.once("connect", held);
1664
- socket.once("error", (e) => resolve(e.code === "ECONNREFUSED" ? null : e));
1665
+ socket.once("error", (e) => resolve(e.code === "ECONNREFUSED" ? null : Object.assign(e, { heldCheck: true })));
1665
1666
  });
1666
1667
  }
1667
1668
 
@@ -1940,7 +1941,12 @@ export async function serve({ ledgerFile, port, interval, open, spendDir } = {})
1940
1941
  // on a privileged port, EADDRNOTAVAIL on an unusable address, a pre-bind
1941
1942
  // connect that fails with anything but ECONNREFUSED: those are faults of
1942
1943
  // their own, and scanning past them would bury each one under an
1943
- // exhausted-range message at the end that names the wrong problem.
1944
+ // exhausted-range message at the end that names the wrong problem. A bind
1945
+ // error dies with its own text; a held-check error dies naming the check,
1946
+ // which a raw connect message does not, and does so whatever code the
1947
+ // connect error carries: only a bare EADDRINUSE from the bind itself, or
1948
+ // the held signal heldFailure() resolves, means the port is taken.
1949
+ if (failure.heldCheck) die(`cannot check whether port ${candidate} is held: ${failure.message}`);
1944
1950
  if (failure.code !== "EADDRINUSE") die(failure.message);
1945
1951
  if (!scannable) die(`port ${candidate} in use — pass --port <n>`);
1946
1952
  const holder = await probeCockpitWorkspace(candidate);
@@ -344,6 +344,8 @@ function writeCache(cache, recipe, repo) {
344
344
  throw noVerdict(e.message);
345
345
  }
346
346
  if (!probe.ok) {
347
+ // A git that exited 0 failed on a spawn error alone, which `err` names.
348
+ if (probe.status === 0) throw noVerdict(`git started but does not run: \`git --version\` failed: ${probe.err}`);
347
349
  const exit = probe.status === null ? "did not exit 0" : `exited ${probe.status}`;
348
350
  const stderrNote = probe.err ? `: ${probe.err}` : " and wrote nothing to stderr";
349
351
  throw noVerdict(`git started but does not run: \`git --version\` ${exit}${stderrNote}`);