@bakers-build/conductor 0.21.0 → 0.21.1-next.2

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.
@@ -49,7 +49,7 @@ ${inputs.label ? ` label: ${JSON.stringify(inputs.label)},\n` : ''}};
49
49
  }
50
50
  export function renderCommittedConfig(inputs) {
51
51
  return `// The project's bakers.build configuration — committed and identical for
52
- // everyone. A conductor is this machine (machine.config.js) + this project +
52
+ // everyone. A runner is this machine (machine.config.js) + this project +
53
53
  // the variant (project.<name>.config.js). Connections are private files.
54
54
  //
55
55
  // Each addon in \`addons\` fills its slots through its preset: herdr supplies
@@ -61,7 +61,7 @@ export default {
61
61
  project: { name: ${JSON.stringify(inputs.project)}${inputs.bakersWorkspace ? `, workspace: ${JSON.stringify(inputs.bakersWorkspace)}` : ''} },
62
62
  // The run budget (max_parallel) is set on the machine in the backend.
63
63
  // Transcripts upload only where the server's run-log storage allows it.
64
- // Set to false to keep this conductor's transcripts local even then.
64
+ // Set to false to keep this runner's transcripts local even then.
65
65
  // Metrics are unaffected either way.
66
66
  capture_logs: true,
67
67
  ${inputs.hooks?.after_create || inputs.hooks?.after_done
@@ -110,7 +110,7 @@ export declare function classify(hub: ConductorStatus, thisHostKey?: string, pro
110
110
  * provider); otherwise logs a single clear line and returns false.
111
111
  */
112
112
  export declare function ensureAuthenticated(config: ConductorFileConfig, logger: ConductorLogger): Promise<boolean>;
113
- /** `oven start --adopt <uuid>` / `--new`: the takeover decision, given up front. */
113
+ /** `runner start --adopt <uuid>` / `--new`: the takeover decision, given up front. */
114
114
  export interface TakeoverChoice {
115
115
  adopt?: string;
116
116
  createNew?: boolean;
@@ -123,7 +123,7 @@ export interface TakeoverChoice {
123
123
  */
124
124
  export declare function strayConductorsOf(rows: ConductorStatus[], own: ConductorStatus): ConductorStatus[];
125
125
  /** Prompt for the developer Kürzel / user id on an interactive terminal. */
126
- /** Build the `oven` subcommand tree (lifecycle + registry). */
126
+ /** Build the `runner` subcommand tree (lifecycle + registry). */
127
127
  export declare function createConductorCommand(deps: BbCliDeps): Command;
128
128
  /** The `conductor` command plugin the host mounts (BB-201). BB-224
129
129
  * (Finding 7): the `bakers deployment` batch helper is no longer registered here —
@@ -31,7 +31,7 @@ async function defaultMigrateConfig() {
31
31
  ]);
32
32
  }
33
33
  /**
34
- * `oven start --dry-run` in a child with this process's own runtime and argv:
34
+ * `runner start --dry-run` in a child with this process's own runtime and argv:
35
35
  * the changed files are imported fresh there, never into this process.
36
36
  */
37
37
  async function defaultCheckConfig() {
@@ -61,7 +61,7 @@ async function runChild(args) {
61
61
  }
62
62
  }
63
63
  /**
64
- * `oven start --dry-run`: load what a start would load — config with project
64
+ * `runner start --dry-run`: load what a start would load — config with project
65
65
  * resolution, executor, workspace and agents — then stop before registering.
66
66
  */
67
67
  async function cmdDryRun(deps) {
@@ -255,7 +255,7 @@ async function buildLsRows(remote, config, onlyId, probe) {
255
255
  }
256
256
  function printRows(rows) {
257
257
  if (rows.length === 0) {
258
- console.log('no conductors on the control plane');
258
+ console.log('no runners on the control plane');
259
259
  return;
260
260
  }
261
261
  for (const r of rows) {
@@ -366,7 +366,7 @@ async function refuseIfAlreadyRunning(remote, id, thisHostKey, force, deps) {
366
366
  return false;
367
367
  if (!force) {
368
368
  const age = heartbeatAgeSeconds(existing);
369
- console.log(`conductor ${id} already running (pid ${existing.lastPid ?? 'unknown'}, ` +
369
+ console.log(`runner ${id} already running (pid ${existing.lastPid ?? 'unknown'}, ` +
370
370
  `heartbeat ${age === undefined ? 'age unknown' : `${age}s old`})`);
371
371
  return true;
372
372
  }
@@ -378,7 +378,7 @@ async function refuseIfAlreadyRunning(remote, id, thisHostKey, force, deps) {
378
378
  probe,
379
379
  });
380
380
  if (!stopOutcome.ok) {
381
- console.log(`failed to restart conductor ${id}: could not stop the running conductor — ${stopOutcome.message}`);
381
+ console.log(`failed to restart runner ${id}: could not stop the running runner — ${stopOutcome.message}`);
382
382
  process.exitCode = 1;
383
383
  return true;
384
384
  }
@@ -391,17 +391,17 @@ async function refuseIfAlreadyRunning(remote, id, thisHostKey, force, deps) {
391
391
  probe,
392
392
  });
393
393
  if (!killOutcome.ok) {
394
- console.log(`failed to restart conductor ${id}: still running after the grace period, and could not force-stop it — ${killOutcome.message}`);
394
+ console.log(`failed to restart runner ${id}: still running after the grace period, and could not force-stop it — ${killOutcome.message}`);
395
395
  process.exitCode = 1;
396
396
  return true;
397
397
  }
398
398
  if (!(await waitForNotRunning(probe, killOutcome.pid, deps))) {
399
- console.log(`failed to restart conductor ${id}: sent SIGKILL but it is still reported running — refusing a second spawn`);
399
+ console.log(`failed to restart runner ${id}: sent SIGKILL but it is still reported running — refusing a second spawn`);
400
400
  process.exitCode = 1;
401
401
  return true;
402
402
  }
403
403
  }
404
- console.log(`stopped conductor ${id} for restart (--force)`);
404
+ console.log(`stopped runner ${id} for restart (--force)`);
405
405
  return false;
406
406
  }
407
407
  async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
@@ -427,7 +427,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
427
427
  if (execve)
428
428
  return reExec(env);
429
429
  delete process.env.BAKERS_RUN_UUID;
430
- logger.warn({ node: process.version }, 'without process.execve (Node >= 22.15) the run cleanup can still end this conductor');
430
+ logger.warn({ node: process.version }, 'without process.execve (Node >= 22.15) the run cleanup can still end this runner');
431
431
  }
432
432
  delete process.env.BAKERS_RESTART_SINCE;
433
433
  // Every start path ends here: detached child, self-restart and update re-exec.
@@ -465,7 +465,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
465
465
  let restart = false;
466
466
  let reason = 'serve ended';
467
467
  let signalled = false;
468
- // A stop wins over a restart already decided: `oven stop` must stay a stop.
468
+ // A stop wins over a restart already decided: `runner stop` must stay a stop.
469
469
  const onSignal = (signal) => {
470
470
  restart = false;
471
471
  signalled = true;
@@ -484,7 +484,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
484
484
  return loadEnvFiles();
485
485
  }
486
486
  catch (err) {
487
- logger.error({ path: secretsFilePath() }, `${err.message}; keeping the running conductor on its last good secrets`);
487
+ logger.error({ path: secretsFilePath() }, `${err.message}; keeping the running runner on its last good secrets`);
488
488
  cancelRestart();
489
489
  return undefined;
490
490
  }
@@ -522,7 +522,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
522
522
  const readVersion = deps.readCliVersion ?? readCliVersion;
523
523
  const migrate = deps.migrateConfig ?? defaultMigrateConfig;
524
524
  const prefix = process.env.BAKERS_CONDUCTOR
525
- ? `bakers --conductor ${process.env.BAKERS_CONDUCTOR}`
525
+ ? `bakers --runner ${process.env.BAKERS_CONDUCTOR}`
526
526
  : 'bakers';
527
527
  let lastRead;
528
528
  let settled; // the new version already handled or refused
@@ -532,7 +532,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
532
532
  mkdirSync(join(envsDir(), level), { recursive: true, mode: 0o700 });
533
533
  if (config.restart_on_change !== false && config.watch_paths) {
534
534
  if (!execve && !supervised()) {
535
- logger.warn({ node: process.version }, 'restart_on_change needs process.execve (Node >= 22.15); the conductor does not restart itself on config changes');
535
+ logger.warn({ node: process.version }, 'restart_on_change needs process.execve (Node >= 22.15); the runner does not restart itself on config changes');
536
536
  }
537
537
  else {
538
538
  watcher = (deps.watchForRestart ?? watchForRestart)({
@@ -563,10 +563,10 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
563
563
  if (read !== UNKNOWN_VERSION && read !== startVersion) {
564
564
  // A new CLI starts only after migrate and check: retry the upgrade on the next poll.
565
565
  settled = undefined;
566
- logger.info({ path: envPath, to: read }, 'secrets file changed; the pending CLI upgrade restarts the conductor');
566
+ logger.info({ path: envPath, to: read }, 'secrets file changed; the pending CLI upgrade restarts the runner');
567
567
  return;
568
568
  }
569
- logger.info({ path: envPath }, 'secrets file changed; restarting conductor');
569
+ logger.info({ path: envPath }, 'secrets file changed; restarting runner');
570
570
  requestRestart(cut);
571
571
  return;
572
572
  }
@@ -577,11 +577,11 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
577
577
  if (controller.signal.aborted)
578
578
  return;
579
579
  if (error !== undefined) {
580
- logger.error({ path, err: error }, `config check failed; keeping the running conductor: ${error}`);
580
+ logger.error({ path, err: error }, `config check failed; keeping the running runner: ${error}`);
581
581
  cancelRestart();
582
582
  return;
583
583
  }
584
- logger.info({ path }, 'config check passed; restarting conductor');
584
+ logger.info({ path }, 'config check passed; restarting runner');
585
585
  requestRestart(cut);
586
586
  }, undefined, loadedAt);
587
587
  }
@@ -623,11 +623,11 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
623
623
  settled = read;
624
624
  const changed = `CLI version changed ${startVersion} → ${read}`;
625
625
  if (config.restart_on_change === false) {
626
- logger.warn({ from: startVersion, to: read }, `${changed}; restart_on_change is off, restart with \`${prefix} oven start --force\``);
626
+ logger.warn({ from: startVersion, to: read }, `${changed}; restart_on_change is off, restart with \`${prefix} runner start --force\``);
627
627
  return;
628
628
  }
629
629
  if (!execve && !supervised()) {
630
- logger.error({ from: startVersion, to: read, node: process.version }, `${changed}; restarting needs process.execve (Node >= 22.15), restart with \`${prefix} oven start --force\``);
630
+ logger.error({ from: startVersion, to: read, node: process.version }, `${changed}; restarting needs process.execve (Node >= 22.15), restart with \`${prefix} runner start --force\``);
631
631
  return;
632
632
  }
633
633
  logger.info({ from: startVersion, to: read }, `${changed}; upgrading config`);
@@ -643,7 +643,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
643
643
  if (controller.signal.aborted)
644
644
  return;
645
645
  if (error !== undefined) {
646
- logger.error({ from: startVersion, to: read, step, err: error }, `${step} failed; keeping the running conductor on ${startVersion}: ${error}. Recover with \`${prefix} config upgrade --scope all --yes\`, then \`${prefix} oven start --force\``);
646
+ logger.error({ from: startVersion, to: read, step, err: error }, `${step} failed; keeping the running runner on ${startVersion}: ${error}. Recover with \`${prefix} config upgrade --scope all --yes\`, then \`${prefix} runner start --force\``);
647
647
  cancelRestart();
648
648
  return;
649
649
  }
@@ -652,7 +652,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
652
652
  finally {
653
653
  busy = false;
654
654
  }
655
- logger.info({ to: read }, 'config check passed; restarting conductor');
655
+ logger.info({ to: read }, 'config check passed; restarting runner');
656
656
  requestRestart();
657
657
  }, config.poll_interval_ms);
658
658
  try {
@@ -660,7 +660,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
660
660
  }
661
661
  catch (err) {
662
662
  reason = 'error';
663
- logger.error({ err: String(err) }, `conductor failed: ${err}`);
663
+ logger.error({ err: String(err) }, `runner failed: ${err}`);
664
664
  throw err;
665
665
  }
666
666
  finally {
@@ -687,7 +687,7 @@ async function cmdStartForeground(deps, log = {}, force = false, choice = {}) {
687
687
  logger.warn({ conductorId: conductor.id, err: String(err) }, 'could not write offline status on shutdown; the lease reaper will');
688
688
  }
689
689
  }
690
- logger.info({ reason }, 'conductor stopped');
690
+ logger.info({ reason }, 'runner stopped');
691
691
  }
692
692
  if (restart && supervised()) {
693
693
  logger.info({ reason }, `restart requested; exiting for supervisor (${reason})`);
@@ -851,7 +851,7 @@ async function cmdStart(deps, log = {}, updateCheck = true, body = cmdStartBody,
851
851
  throw new Error(`bakers ${args[0]} exited ${status}`);
852
852
  });
853
853
  const prefix = env.BAKERS_CONDUCTOR
854
- ? `bakers --conductor ${env.BAKERS_CONDUCTOR}`
854
+ ? `bakers --runner ${env.BAKERS_CONDUCTOR}`
855
855
  : 'bakers';
856
856
  if (accepted) {
857
857
  try {
@@ -869,7 +869,7 @@ async function cmdStart(deps, log = {}, updateCheck = true, body = cmdStartBody,
869
869
  catch (err) {
870
870
  console.error(`bakers config upgrade failed: ${String(err)}`);
871
871
  console.error(`Retry with: ${prefix} config upgrade --scope all --yes`);
872
- console.error(`Then run \`${prefix} conductor start${force ? ' --force' : ''}\`.`);
872
+ console.error(`Then run \`${prefix} runner start${force ? ' --force' : ''}\`.`);
873
873
  process.exitCode = 1;
874
874
  return;
875
875
  }
@@ -1049,12 +1049,12 @@ async function cmdStartBody(deps, log, force = false, choice = {}) {
1049
1049
  // this host (same proof as `ls`) is offline: its offline write was lost.
1050
1050
  const recordOnline = existing !== undefined && classify(existing) === 'online';
1051
1051
  if (recordOnline && classify(existing, thisHostKey, probe) !== 'online') {
1052
- console.log(`conductor ${id}: recorded pid ${existing.lastPid} is not running here; starting`);
1052
+ console.log(`runner ${id}: recorded pid ${existing.lastPid} is not running here; starting`);
1053
1053
  }
1054
1054
  else if (recordOnline) {
1055
1055
  if (!force) {
1056
1056
  const age = heartbeatAgeSeconds(existing);
1057
- console.log(`conductor ${id} already running (pid ${existing.lastPid ?? 'unknown'}, ` +
1057
+ console.log(`runner ${id} already running (pid ${existing.lastPid ?? 'unknown'}, ` +
1058
1058
  `heartbeat ${age === undefined ? 'age unknown' : `${age}s old`})`);
1059
1059
  return;
1060
1060
  }
@@ -1066,7 +1066,7 @@ async function cmdStartBody(deps, log, force = false, choice = {}) {
1066
1066
  probe,
1067
1067
  });
1068
1068
  if (!stopOutcome.ok) {
1069
- console.log(`failed to restart conductor ${id}: could not stop the running conductor — ${stopOutcome.message}`);
1069
+ console.log(`failed to restart runner ${id}: could not stop the running runner — ${stopOutcome.message}`);
1070
1070
  process.exitCode = 1;
1071
1071
  return;
1072
1072
  }
@@ -1079,17 +1079,17 @@ async function cmdStartBody(deps, log, force = false, choice = {}) {
1079
1079
  probe,
1080
1080
  });
1081
1081
  if (!killOutcome.ok) {
1082
- console.log(`failed to restart conductor ${id}: still running after the grace period, and could not force-stop it — ${killOutcome.message}`);
1082
+ console.log(`failed to restart runner ${id}: still running after the grace period, and could not force-stop it — ${killOutcome.message}`);
1083
1083
  process.exitCode = 1;
1084
1084
  return;
1085
1085
  }
1086
1086
  if (!(await waitForNotRunning(probe, killOutcome.pid, deps))) {
1087
- console.log(`failed to restart conductor ${id}: sent SIGKILL but it is still reported running — refusing a second spawn`);
1087
+ console.log(`failed to restart runner ${id}: sent SIGKILL but it is still reported running — refusing a second spawn`);
1088
1088
  process.exitCode = 1;
1089
1089
  return;
1090
1090
  }
1091
1091
  }
1092
- console.log(`stopped conductor ${id} for restart (--force)`);
1092
+ console.log(`stopped runner ${id} for restart (--force)`);
1093
1093
  }
1094
1094
  // The detached child has no terminal, so a takeover is settled here first.
1095
1095
  if (!existing &&
@@ -1102,8 +1102,8 @@ async function cmdStartBody(deps, log, force = false, choice = {}) {
1102
1102
  const argv = [
1103
1103
  process.execPath,
1104
1104
  process.argv[1], // the running bakers entry script
1105
- ...(stem && stem !== 'conductor' ? ['--conductor', stem] : []),
1106
- 'conductor',
1105
+ ...(stem && stem !== 'conductor' ? ['--runner', stem] : []),
1106
+ 'runner',
1107
1107
  ...(log.level ? ['--log-level', log.level] : []),
1108
1108
  // No --log-sink: the child's stdout is the log file, pinned by BAKERS_CONDUCTOR_LOG=file.
1109
1109
  'start',
@@ -1119,10 +1119,10 @@ async function cmdStartBody(deps, log, force = false, choice = {}) {
1119
1119
  env: { ...process.env, BAKERS_CONDUCTOR_LOG: 'file' },
1120
1120
  logPath,
1121
1121
  });
1122
- logger.info({ id, pid: child.pid }, 'started conductor detached');
1122
+ logger.info({ id, pid: child.pid }, 'started runner detached');
1123
1123
  }
1124
1124
  catch (err) {
1125
- console.log(`failed to start conductor ${id}: could not spawn — ${err.message} — see ${logPath}`);
1125
+ console.log(`failed to start runner ${id}: could not spawn — ${err.message} — see ${logPath}`);
1126
1126
  process.exitCode = 1;
1127
1127
  return;
1128
1128
  }
@@ -1135,17 +1135,17 @@ async function cmdStartBody(deps, log, force = false, choice = {}) {
1135
1135
  waitForFreshHeartbeat(remote, id, priorPid, priorLastSeen, deps, () => exited).then((row) => ({ row })),
1136
1136
  ]);
1137
1137
  if ('code' in outcome) {
1138
- console.log(`failed to start conductor ${id}: exited with code ${outcome.code} before its first heartbeat — see ${logPath}`);
1138
+ console.log(`failed to start runner ${id}: exited with code ${outcome.code} before its first heartbeat — see ${logPath}`);
1139
1139
  process.exitCode = 1;
1140
1140
  return;
1141
1141
  }
1142
1142
  const started = outcome.row;
1143
1143
  if (!started) {
1144
- console.log(`failed to start conductor ${id}: spawned, but no fresh heartbeat arrived — see ${logPath}`);
1144
+ console.log(`failed to start runner ${id}: spawned, but no fresh heartbeat arrived — see ${logPath}`);
1145
1145
  process.exitCode = 1;
1146
1146
  return;
1147
1147
  }
1148
- console.log(`started conductor ${id} (pid ${started.lastPid ?? 'unknown'}, host ${started.hostKey ?? thisHostKey})`);
1148
+ console.log(`started runner ${id} (pid ${started.lastPid ?? 'unknown'}, host ${started.hostKey ?? thisHostKey})`);
1149
1149
  }
1150
1150
  /**
1151
1151
  * Other conductor records that name the SAME checkout as `own` (BB-450 D6,
@@ -1185,12 +1185,12 @@ async function cmdStop(deps, now) {
1185
1185
  const rows = await remote.listConductors('me');
1186
1186
  const row = rows.find((c) => c.id === id);
1187
1187
  if (!row) {
1188
- console.log(`no conductor ${id} on the control plane — nothing to stop (it may never have started)`);
1188
+ console.log(`no runner ${id} on the control plane — nothing to stop (it may never have started)`);
1189
1189
  return;
1190
1190
  }
1191
1191
  // BB-450 D6: report a stray record naming this checkout, never touch it.
1192
1192
  for (const stray of strayConductorsOf(rows, row)) {
1193
- console.log(`note: conductor ${stray.id} also names this checkout (${stray.workspaceRoot}) — left untouched`);
1193
+ console.log(`note: runner ${stray.id} also names this checkout (${stray.workspaceRoot}) — left untouched`);
1194
1194
  }
1195
1195
  const signal = now ? 'SIGKILL' : 'SIGTERM';
1196
1196
  const outcome = signalVerifiedProcess({
@@ -1201,12 +1201,12 @@ async function cmdStop(deps, now) {
1201
1201
  ...(deps.procProbe ? { probe: deps.procProbe } : {}),
1202
1202
  });
1203
1203
  if (!outcome.ok) {
1204
- console.log(`could not stop conductor ${id}: ${outcome.message}`);
1204
+ console.log(`could not stop runner ${id}: ${outcome.message}`);
1205
1205
  return;
1206
1206
  }
1207
1207
  console.log(now
1208
- ? `hard-stopped conductor ${id} (SIGKILL to pid ${outcome.pid}); a killed process writes no offline, so the status follows on lease expiry`
1209
- : `stopped conductor ${id} (SIGTERM to pid ${outcome.pid}); it writes its own offline as it exits`);
1208
+ ? `hard-stopped runner ${id} (SIGKILL to pid ${outcome.pid}); a killed process writes no offline, so the status follows on lease expiry`
1209
+ : `stopped runner ${id} (SIGTERM to pid ${outcome.pid}); it writes its own offline as it exits`);
1210
1210
  }
1211
1211
  async function cmdLs(deps) {
1212
1212
  const config = deps.config ?? (await tryConfig(deps));
@@ -1235,9 +1235,9 @@ async function tryConfig(deps) {
1235
1235
  }
1236
1236
  /** Prompt for the developer Kürzel / user id on an interactive terminal. */
1237
1237
  // --- the conductor command tree --------------------------------------------
1238
- /** Build the `oven` subcommand tree (lifecycle + registry). */
1238
+ /** Build the `runner` subcommand tree (lifecycle + registry). */
1239
1239
  export function createConductorCommand(deps) {
1240
- const conductor = new Command('conductor')
1240
+ const conductor = new Command('runner')
1241
1241
  .description('node-agent lifecycle + local registry')
1242
1242
  .option('--log-level <level>', 'log verbosity: debug | info | warn | error (overrides BAKERS_LOG_LEVEL)')
1243
1243
  .option('--log-sink <sink>', 'log sink: stdout | file | both (overrides BAKERS_CONDUCTOR_LOG)')
@@ -1252,19 +1252,19 @@ Logging (precedence: CLI flag > env var > default):
1252
1252
  BAKERS_CONDUCTOR_LOG env fallback for --log-sink.
1253
1253
 
1254
1254
  Examples:
1255
- bakers conductor --log-level debug start --foreground
1256
- bakers conductor --log-level debug once
1257
- BAKERS_LOG_LEVEL=debug bakers conductor once`);
1255
+ bakers runner --log-level debug start --foreground
1256
+ bakers runner --log-level debug once
1257
+ BAKERS_LOG_LEVEL=debug bakers runner once`);
1258
1258
  conductor
1259
1259
  .command('start')
1260
- .description('start the conductor loop (a detached background process by default)')
1260
+ .description('start the runner loop (a detached background process by default)')
1261
1261
  .option('--foreground', 'run the loop in this process', false)
1262
1262
  .option('--no-update-check', 'skip the daily CLI update check')
1263
- .option('--force', 'restart: verify-stop the already-running conductor (SIGTERM, a grace ' +
1263
+ .option('--force', 'restart: verify-stop the already-running runner (SIGTERM, a grace ' +
1264
1264
  'period, then SIGKILL) and start a new one. Fails rather than starting ' +
1265
- 'a second conductor if the running one cannot be verified or stopped.', false)
1266
- .option('--adopt <uuid>', 'take over the conductor this machine, project and variant already have')
1267
- .option('--new', 'register a new conductor instead of taking one over')
1265
+ 'a second runner if the running one cannot be verified or stopped.', false)
1266
+ .option('--adopt <uuid>', 'take over the runner this machine, project and variant already have')
1267
+ .option('--new', 'register a new runner instead of taking one over')
1268
1268
  .option('--dry-run', 'load the config, executor, workspace and agents, then exit (0 when they load, 1 with the error)', false)
1269
1269
  .action(async function (opts) {
1270
1270
  if (opts.dryRun) {
@@ -1285,7 +1285,7 @@ Examples:
1285
1285
  });
1286
1286
  conductor
1287
1287
  .command('once')
1288
- .description('run one conductor cycle then exit')
1288
+ .description('run one runner cycle then exit')
1289
1289
  .action(async function () {
1290
1290
  await cmdPoll(deps, logOptsOf(this));
1291
1291
  });
@@ -1297,32 +1297,32 @@ Examples:
1297
1297
  });
1298
1298
  conductor
1299
1299
  .command('clean')
1300
- .description('tear down herdr worktrees of finished-but-uncleaned tickets (recovers orphans a live tick missed: conductor was down at done, restarted, or reassigned)')
1300
+ .description('tear down herdr worktrees of finished-but-uncleaned tickets (recovers orphans a live tick missed: runner was down at done, restarted, or reassigned)')
1301
1301
  .action(async function () {
1302
1302
  await cmdReap(deps, logOptsOf(this));
1303
1303
  });
1304
1304
  conductor
1305
1305
  .command('stop')
1306
- .description('stop the conductor: graceful offline (default) or hard kill (--now)')
1306
+ .description('stop the runner: graceful offline (default) or hard kill (--now)')
1307
1307
  .option('--now', 'hard-kill via host and let the cron reaper mark it offline', false)
1308
1308
  .action(async (opts) => {
1309
1309
  await cmdStop(deps, opts.now);
1310
1310
  });
1311
1311
  conductor
1312
1312
  .command('ls')
1313
- .description('list conductors on this machine + status')
1313
+ .description('list runners on this machine + status')
1314
1314
  .action(async () => {
1315
1315
  await cmdLs(deps);
1316
1316
  });
1317
1317
  conductor
1318
1318
  .command('status')
1319
- .description('status of the conductor for this checkout')
1319
+ .description('status of the runner for this checkout')
1320
1320
  .action(async () => {
1321
1321
  await cmdStatus(deps);
1322
1322
  });
1323
1323
  conductor
1324
1324
  .command('tools')
1325
- .description("list or call the conductor's addon tools from inside a run (exit 4 outside one)")
1325
+ .description("list or call the runner's addon tools from inside a run (exit 4 outside one)")
1326
1326
  .argument('[name]', 'the tool to call; omitted, list the tools')
1327
1327
  .option('--data <json>', 'arguments as a JSON object, or @<file>')
1328
1328
  .option('--schema', "print the tool's input schema instead of calling it")
@@ -1340,8 +1340,8 @@ Examples:
1340
1340
  * it is its own command addon, `@bakers-build/addon-deployment`. */
1341
1341
  const conductorCommandPlugin = {
1342
1342
  kind: 'command',
1343
- name: 'conductor',
1344
- describe: 'conductor lifecycle + local registry',
1343
+ name: 'runner',
1344
+ describe: 'runner lifecycle + local registry',
1345
1345
  register(program, host) {
1346
1346
  program.addCommand(createConductorCommand({ host }));
1347
1347
  },
@@ -1353,7 +1353,7 @@ export default conductorCommandPlugin;
1353
1353
  */
1354
1354
  export function buildConductorProgram(deps = {}) {
1355
1355
  const program = new Command();
1356
- program.name('bakers').description('bakers.build conductor + client CLI');
1356
+ program.name('bakers').description('bakers.build runner + client CLI');
1357
1357
  program.addCommand(createConductorCommand(deps));
1358
1358
  return program;
1359
1359
  }
@@ -38,7 +38,7 @@ export async function ovenTools(name, opts, env = process.env, io = processIo) {
38
38
  const url = env[CONDUCTOR_URL_ENV];
39
39
  const token = env[CONDUCTOR_TOKEN_ENV];
40
40
  if (!url || !token) {
41
- io.err(`no conductor tools in this shell: ${CONDUCTOR_URL_ENV} and ${CONDUCTOR_TOKEN_ENV} are set only inside a conductor run with a tool server`);
41
+ io.err(`no runner tools in this shell: ${CONDUCTOR_URL_ENV} and ${CONDUCTOR_TOKEN_ENV} are set only inside a runner run with a tool server`);
42
42
  return EXIT.invalid;
43
43
  }
44
44
  if (!URL.canParse(url)) {
@@ -65,7 +65,7 @@ export async function ovenTools(name, opts, env = process.env, io = processIo) {
65
65
  }
66
66
  const tool = tools.find((t) => t.name === name);
67
67
  if (!tool) {
68
- io.err(`unknown conductor tool ${name}; available: ${tools.map((t) => t.name).join(', ') || '(none)'}`);
68
+ io.err(`unknown runner tool ${name}; available: ${tools.map((t) => t.name).join(', ') || '(none)'}`);
69
69
  return EXIT.invalid;
70
70
  }
71
71
  if (opts.schema) {
@@ -95,7 +95,7 @@ export async function ovenTools(name, opts, env = process.env, io = processIo) {
95
95
  io.err(`run token rejected by ${url}: ${err.message}`);
96
96
  return EXIT.rejected;
97
97
  }
98
- io.err(`conductor tool server ${url}: ${err instanceof Error ? err.message : String(err)}`);
98
+ io.err(`runner tool server ${url}: ${err instanceof Error ? err.message : String(err)}`);
99
99
  return EXIT.transport;
100
100
  }
101
101
  finally {
@@ -230,7 +230,7 @@ async function loadInboxAddons(found, toolNames) {
230
230
  */
231
231
  function validateHookListeners(value) {
232
232
  if (!Array.isArray(value))
233
- throw new Error('conductor addons[] hooks must accumulate an array');
233
+ throw new Error('runner addons[] hooks must accumulate an array');
234
234
  for (const [index, listener] of value.entries()) {
235
235
  if (!isRecord(listener))
236
236
  throw new Error(`hooks[${index}] must be a listener object`);
@@ -245,7 +245,7 @@ function validateHookListeners(value) {
245
245
  }
246
246
  function requirePlugin(value, kind) {
247
247
  if (!isRecord(value) || value.kind !== kind) {
248
- throw new Error(`conductor config requires a ${kind} plugin in the "${kind}" slot`);
248
+ throw new Error(`runner config requires a ${kind} plugin in the "${kind}" slot`);
249
249
  }
250
250
  return value;
251
251
  }
@@ -21,7 +21,7 @@ export declare function resolveRunEnv(effectiveEnvVars: string | undefined, core
21
21
  }): Record<string, string>;
22
22
  /**
23
23
  * A conductor's registration payload, built from its config: what the engine
24
- * heartbeats with, and what `oven start` registers before it spawns one.
24
+ * heartbeats with, and what `runner start` registers before it spawns one.
25
25
  * `conductor_name` is the variant (the config stem, derived through core's
26
26
  * own mapping), which the control plane matches a takeover on.
27
27
  */
@@ -68,6 +68,12 @@ export declare class Conductor {
68
68
  private readonly slots;
69
69
  /** The runtime alias of each run this process dispatched. */
70
70
  private readonly runRuntimes;
71
+ /**
72
+ * Tickets whose dispatch failed for a reason that cannot heal by itself, by
73
+ * ticket uuid; the server does not claim them until the recheck passes.
74
+ * shortcut: in memory, so a restart costs one more failed run before the hold returns; persist beside the frozen-state file if that matters.
75
+ */
76
+ private readonly heldTickets;
71
77
  /** Serializes git worktree add/remove: parallel ones fight over git locks. */
72
78
  private gitLock;
73
79
  /** The last good machine `tunnel` policy, re-read for each run's env. */
@@ -278,6 +284,8 @@ export declare class Conductor {
278
284
  * (missing or broken) or a failed read keeps the last good value.
279
285
  */
280
286
  private currentTunnel;
287
+ /** Releases every held ticket whose cause is gone; a failing recheck keeps the hold. */
288
+ private releaseHeals;
281
289
  /** Dispatches one claimed run; a failure terminalises it (BB-149). */
282
290
  private dispatchOrFail;
283
291
  /**
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
2
  import { basename, dirname, join } from 'node:path';
3
- import { killRunProcesses, layeredEnv, loadRunClone, pickSecrets, protectedProjectPaths, saveRunClone, secretsFilePath, shellQuote, stemForConfigFile, transferIsolatedCommit, } from '@bakers-build/core';
3
+ import { DispatchBlocked, isDispatchBlocked, killRunProcesses, layeredEnv, loadRunClone, pickSecrets, protectedProjectPaths, saveRunClone, secretsFilePath, shellQuote, stemForConfigFile, transferIsolatedCommit, } from '@bakers-build/core';
4
4
  import { HttpError } from 'dropsh/plugin';
5
5
  import { CONDUCTOR_TOKEN_ENV, CONDUCTOR_URL_ENV, DEFAULT_ENV_DENY, matchesEnvDeny, } from '../plugins/agent.js';
6
6
  import { homeKey, homePath } from '../plugins/agent-home.js';
@@ -173,7 +173,7 @@ function renderPrompt(template, values) {
173
173
  }
174
174
  /**
175
175
  * A conductor's registration payload, built from its config: what the engine
176
- * heartbeats with, and what `oven start` registers before it spawns one.
176
+ * heartbeats with, and what `runner start` registers before it spawns one.
177
177
  * `conductor_name` is the variant (the config stem, derived through core's
178
178
  * own mapping), which the control plane matches a takeover on.
179
179
  */
@@ -233,6 +233,12 @@ export class Conductor {
233
233
  slots = new SlotResolver();
234
234
  /** The runtime alias of each run this process dispatched. */
235
235
  runRuntimes = new Map();
236
+ /**
237
+ * Tickets whose dispatch failed for a reason that cannot heal by itself, by
238
+ * ticket uuid; the server does not claim them until the recheck passes.
239
+ * shortcut: in memory, so a restart costs one more failed run before the hold returns; persist beside the frozen-state file if that matters.
240
+ */
241
+ heldTickets = new Map();
236
242
  /** Serializes git worktree add/remove: parallel ones fight over git locks. */
237
243
  gitLock = Promise.resolve();
238
244
  /** The last good machine `tunnel` policy, re-read for each run's env. */
@@ -336,7 +342,7 @@ export class Conductor {
336
342
  ...new Set((await Promise.all(runtimes.map((r) => r.toolServerHosts?.() ?? []))).flat()),
337
343
  ];
338
344
  const registry = this.config.tools ?? (await loadTools([]));
339
- // Runs closed while no server ran (`oven once`, a crash) lose their grant here.
345
+ // Runs closed while no server ran (`runner once`, a crash) lose their grant here.
340
346
  const openRuns = await this.remote.fetchActiveRuns(this.id).then((runs) => runs.map((r) => r.runUuid), (err) => {
341
347
  this.logger.warn({ err: String(err) }, 'active runs unreadable, keeping every persisted run grant');
342
348
  return undefined;
@@ -462,7 +468,7 @@ export class Conductor {
462
468
  ...rest,
463
469
  });
464
470
  }
465
- this.logger.info({ conductorId: this.id, uuid: this.uuid, project: this.config.project }, 'conductor started');
471
+ this.logger.info({ conductorId: this.id, uuid: this.uuid, project: this.config.project }, 'runner started');
466
472
  try {
467
473
  await this.inboxAddons.register(this.id);
468
474
  }
@@ -549,7 +555,7 @@ export class Conductor {
549
555
  active: count,
550
556
  machineLoad,
551
557
  capacity: maxParallel,
552
- }, 'conductor tick');
558
+ }, 'runner tick');
553
559
  if (capacity && machineLoad > maxParallel) {
554
560
  // BB-464 D4: a breach is its own signal, not merely the reason no
555
561
  // further claim was made — this server-side ceiling (TicketClaimService)
@@ -568,6 +574,7 @@ export class Conductor {
568
574
  for (const line of unavailable) {
569
575
  this.logger.warn({ conductorId: this.id }, `claims withheld: ${line}`);
570
576
  }
577
+ await this.releaseHeals();
571
578
  let claimed = 0;
572
579
  // A refusal backs off silently: counted as withheld, so no idle line.
573
580
  let withheld = this.claimsPaused ||
@@ -579,6 +586,9 @@ export class Conductor {
579
586
  run = await this.remote.claimNext({
580
587
  leaseSeconds: this.config.lease_seconds,
581
588
  conductorId: this.id,
589
+ ...(this.heldTickets.size
590
+ ? { excludeTickets: [...this.heldTickets.keys()] }
591
+ : {}),
582
592
  });
583
593
  }
584
594
  catch (err) {
@@ -1363,6 +1373,17 @@ export class Conductor {
1363
1373
  }
1364
1374
  return this.tunnel;
1365
1375
  }
1376
+ /** Releases every held ticket whose cause is gone; a failing recheck keeps the hold. */
1377
+ async releaseHeals() {
1378
+ for (const [ticket, blocked] of this.heldTickets) {
1379
+ if (!(await Promise.resolve()
1380
+ .then(() => blocked.recheck())
1381
+ .catch(() => false)))
1382
+ continue;
1383
+ this.heldTickets.delete(ticket);
1384
+ this.logger.info({ ticket }, 'dispatch unblocked');
1385
+ }
1386
+ }
1366
1387
  /** Dispatches one claimed run; a failure terminalises it (BB-149). */
1367
1388
  async dispatchOrFail(run) {
1368
1389
  const at = {};
@@ -1386,6 +1407,10 @@ export class Conductor {
1386
1407
  this.runRuntimes.delete(run.runUuid);
1387
1408
  if (at.worktree)
1388
1409
  this.config.runtime_isolation?.delete(at.worktree);
1410
+ if (isDispatchBlocked(err)) {
1411
+ this.heldTickets.set(run.ticketUuid, err);
1412
+ this.logger.warn({ run: run.runUuid, ticket: run.ticketUuid, err: err.message }, 'dispatch blocked');
1413
+ }
1389
1414
  try {
1390
1415
  await this.remote.markFailed(run.runUuid, String(err));
1391
1416
  this.signalUi(at.worktree);
@@ -1445,7 +1470,11 @@ export class Conductor {
1445
1470
  catch (err) {
1446
1471
  entry.failure = err instanceof Error ? err.message : String(err);
1447
1472
  log();
1448
- throw new Error(`plugins: ${harness} install failed: ${entry.failure}`);
1473
+ const message = `plugins: ${harness} install failed: ${entry.failure}`;
1474
+ // A block (e.g. a missing login) keeps its recheck, so the ticket is held.
1475
+ if (isDispatchBlocked(err))
1476
+ throw new DispatchBlocked(message, err.recheck);
1477
+ throw new Error(message);
1449
1478
  }
1450
1479
  log();
1451
1480
  return { env: launch.env, args: launch.args };
@@ -1852,8 +1881,8 @@ export class Conductor {
1852
1881
  /** The run's slot choices as a run note, and a ticket comment when a label put it on a runtime that does not isolate. Never fails the run. */
1853
1882
  async recordChoices(runUuid, t, agent, agentWhy, runtime, isolates) {
1854
1883
  const owner = t.conductorOwner
1855
- ? `conductor owner ${t.conductorOwner}`
1856
- : 'conductor owner unknown';
1884
+ ? `runner owner ${t.conductorOwner}`
1885
+ : 'runner owner unknown';
1857
1886
  try {
1858
1887
  await this.remote.appendRunNote(runUuid, `agent ${agent} (${agentWhy}); runtime ${runtime.alias} (${runtime.reason}); ${owner}`);
1859
1888
  }
@@ -1923,7 +1952,7 @@ export class Conductor {
1923
1952
  // reaper flips status to offline on lease expiry, same as any crash.
1924
1953
  // Deliberately NOT an offline write from here: the loop never owns that
1925
1954
  // transition (see the note at the end of this method).
1926
- this.logger.error({ conductorId: this.id, workspace: this.checkoutRoot }, 'checkout is gone — stopping conductor instead of claiming runs it cannot dispatch');
1955
+ this.logger.error({ conductorId: this.id, workspace: this.checkoutRoot }, 'checkout is gone — stopping runner instead of claiming runs it cannot dispatch');
1927
1956
  await this.queue.drain();
1928
1957
  return;
1929
1958
  }
@@ -133,7 +133,7 @@ export async function startToolServer(options) {
133
133
  if (!options.workspaceRoot ||
134
134
  !isInside(options.workspaceRoot, body.worktree))
135
135
  return send(res, 403, {
136
- error: `${body.worktree} is not under the conductor's workspace root ${options.workspaceRoot ?? '(none)'}`,
136
+ error: `${body.worktree} is not under the runner's workspace root ${options.workspaceRoot ?? '(none)'}`,
137
137
  });
138
138
  try {
139
139
  const result = await registry.call(body.tool, body.args, {
@@ -157,7 +157,7 @@ export async function startToolServer(options) {
157
157
  const binding = bindingOf(bearer(req));
158
158
  if (!binding)
159
159
  return send(res, 401, {
160
- error: 'unknown run token — conductor restarted?',
160
+ error: 'unknown run token — runner restarted?',
161
161
  });
162
162
  // Stateless (no session id generator): one server and transport per request.
163
163
  const server = mcpServer(binding);
@@ -59,6 +59,8 @@ export declare class ConductorTakeoverRequired extends Error {
59
59
  export interface ClaimOptions {
60
60
  leaseSeconds: number;
61
61
  conductorId: string;
62
+ /** Tickets the server must not claim: held after a dispatch that cannot heal by itself. */
63
+ excludeTickets?: string[];
62
64
  }
63
65
  export interface ClaimedRun {
64
66
  runUuid: string;
@@ -1,9 +1,9 @@
1
1
  export const commands = (acc) => [
2
2
  ...acc,
3
3
  {
4
- name: 'conductor',
5
- aliases: ['oven'],
4
+ name: 'runner',
5
+ aliases: ['conductor'],
6
6
  plugin: '@bakers-build/conductor/commands/conductor',
7
- describe: 'conductor lifecycle + local registry',
7
+ describe: 'runner lifecycle + local registry',
8
8
  },
9
9
  ];
@@ -12,7 +12,7 @@ export interface DetachedChild {
12
12
  exited: Promise<number | null>;
13
13
  }
14
14
  /**
15
- * Starts `oven start --foreground` as a detached conductor: its own session
15
+ * Starts `runner start --foreground` as a detached conductor: its own session
16
16
  * (no controlling terminal, untouched by the starting shell's SIGHUP), stdin
17
17
  * closed, stdout and stderr appended to the conductor log, and unref'd so the
18
18
  * starting process can exit while it runs.
@@ -2,7 +2,7 @@ import { spawn } from 'node:child_process';
2
2
  import { closeSync, mkdirSync, openSync } from 'node:fs';
3
3
  import { dirname } from 'node:path';
4
4
  /**
5
- * Starts `oven start --foreground` as a detached conductor: its own session
5
+ * Starts `runner start --foreground` as a detached conductor: its own session
6
6
  * (no controlling terminal, untouched by the starting shell's SIGHUP), stdin
7
7
  * closed, stdout and stderr appended to the conductor log, and unref'd so the
8
8
  * starting process can exit while it runs.
@@ -82,7 +82,7 @@ export interface ConductorSettings {
82
82
  /** Absolute path of the loaded config. */
83
83
  config_path: string;
84
84
  /**
85
- * `oven start --foreground` restarts itself when a file in `watch_paths`
85
+ * `runner start --foreground` restarts itself when a file in `watch_paths`
86
86
  * changes. Default true.
87
87
  */
88
88
  restart_on_change?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/conductor",
3
- "version": "0.21.0",
3
+ "version": "0.21.1-next.2",
4
4
  "description": "bakers.build, the open source AI software factory: conductor engine + CLI: registers, claims tickets via JSON:API, dispatches agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,14 +43,14 @@
43
43
  "dependencies": {
44
44
  "@dropsh/plugin-jsonapi-schema": "^0.8.2",
45
45
  "@dropsh/plugin-oauth2": "^0.8.2",
46
- "@bakers-build/core": "^0.21.0",
47
- "@bakers-build/message": "^0.21.0",
46
+ "@bakers-build/core": "^0.21.1-next.2",
47
+ "@bakers-build/message": "^0.21.1-next.2",
48
48
  "@modelcontextprotocol/sdk": "1.32.1",
49
49
  "commander": "^12.1.0",
50
50
  "dropsh": "^0.8.2"
51
51
  },
52
52
  "bakersBuild": {
53
- "commit": "a3a7417bfbbd14a550213883dbaea762909095ae",
54
- "channel": "latest"
53
+ "commit": "a87e7555360eb6a9ec167dc172c66d8e98293e34",
54
+ "channel": "next"
55
55
  }
56
56
  }