@biffo/cli 0.296.16 → 0.296.17

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 (2) hide show
  1. package/dist/index.js +53 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4287,11 +4287,39 @@ async function refreshInstanceLockfiles(cwd, applied, deps) {
4287
4287
  for (const message of describeFailures(outcomes)) log.warn(message);
4288
4288
  return outcomes;
4289
4289
  }
4290
+ var runCommandTimeoutMs = () => {
4291
+ const raw = process.env.BIFFO_RUN_TIMEOUT_MS;
4292
+ const parsed = raw === void 0 ? Number.NaN : Number(raw);
4293
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 6e5;
4294
+ };
4290
4295
  var defaultRunCommand = async (command, cwd) => {
4291
4296
  const [bin, ...args] = command;
4292
4297
  if (!bin) return { ok: false, error: "empty command" };
4293
4298
  try {
4294
- await execa3(bin, args, { cwd });
4299
+ await execa3(bin, args, {
4300
+ cwd,
4301
+ // TWO REASONS THIS HUNG FOR 29 HOURS, AND THE FIX NEEDS BOTH.
4302
+ //
4303
+ // Measured 2026-08-22: `biffo core upgrade --apply` on tabsii-platform sat for
4304
+ // 29 hours on `pnpm install` having done NOTHING -- node_modules untouched since
4305
+ // two days earlier, git tree clean, no network connections, main thread idle in
4306
+ // ep_poll. It was waiting on stdin for input that could never arrive.
4307
+ //
4308
+ // 1. `stdin: 'ignore'`. execa 9 gives the child a PIPE for stdin by default
4309
+ // (verified directly: the child reports `socket:[...]`, not the parent's fd).
4310
+ // This process's own stdin was /dev/null -- it runs headless -- so had the pipe
4311
+ // not been created the child would have read EOF at once and either carried on
4312
+ // or failed fast. Instead pnpm got a live socket nothing would ever write to.
4313
+ // Closing it turns a silent forever-wait into an immediate, legible outcome.
4314
+ //
4315
+ // 2. `timeout`. Nothing bounded the wait: 0 of 38 execa call sites in this CLI
4316
+ // passed one. A subprocess that blocks blocks the whole upgrade, unattended and
4317
+ // unreported -- the same class as wait-for-checks outliving its caller. Ten
4318
+ // minutes is generous for a cold `pnpm install` and still finite; override with
4319
+ // BIFFO_RUN_TIMEOUT_MS where an instance genuinely needs longer.
4320
+ stdin: "ignore",
4321
+ timeout: runCommandTimeoutMs()
4322
+ });
4295
4323
  return { ok: true };
4296
4324
  } catch (err) {
4297
4325
  const cause = err;
@@ -10152,7 +10180,30 @@ var defaultRunCommand2 = async (command, cwd) => {
10152
10180
  const [bin, ...args] = command;
10153
10181
  if (!bin) return { ok: false, error: "empty command" };
10154
10182
  try {
10155
- await execa7(bin, args, { cwd });
10183
+ await execa7(bin, args, {
10184
+ cwd,
10185
+ // TWO REASONS THIS HUNG FOR 29 HOURS, AND THE FIX NEEDS BOTH.
10186
+ //
10187
+ // Measured 2026-08-22: `biffo core upgrade --apply` on tabsii-platform sat for
10188
+ // 29 hours on `pnpm install` having done NOTHING -- node_modules untouched since
10189
+ // two days earlier, git tree clean, no network connections, main thread idle in
10190
+ // ep_poll. It was waiting on stdin for input that could never arrive.
10191
+ //
10192
+ // 1. `stdin: 'ignore'`. execa 9 gives the child a PIPE for stdin by default
10193
+ // (verified directly: the child reports `socket:[...]`, not the parent's fd).
10194
+ // This process's own stdin was /dev/null -- it runs headless -- so had the pipe
10195
+ // not been created the child would have read EOF at once and either carried on
10196
+ // or failed fast. Instead pnpm got a live socket nothing would ever write to.
10197
+ // Closing it turns a silent forever-wait into an immediate, legible outcome.
10198
+ //
10199
+ // 2. `timeout`. Nothing bounded the wait: 0 of 38 execa call sites in this CLI
10200
+ // passed one. A subprocess that blocks blocks the whole upgrade, unattended and
10201
+ // unreported -- the same class as wait-for-checks outliving its caller. Ten
10202
+ // minutes is generous for a cold `pnpm install` and still finite; override with
10203
+ // BIFFO_RUN_TIMEOUT_MS where an instance genuinely needs longer.
10204
+ stdin: "ignore",
10205
+ timeout: runCommandTimeoutMs()
10206
+ });
10156
10207
  return { ok: true };
10157
10208
  } catch (err) {
10158
10209
  const cause = err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.296.16",
3
+ "version": "0.296.17",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",