@miraland-labs/conduit-bridge 0.16.195 → 0.16.196

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/dist/cli.js CHANGED
@@ -20,7 +20,7 @@ import { BOOTSTRAP_RESULTS, buildSovereignExecutionFacts, workspaceIsClean } fro
20
20
  import { ensureCheckout } from "./checkout.js";
21
21
  import { buildOnShiftIntentProof, managedWorkspacePath, maybeApplyOnShiftIntent } from "./on-shift-apply.js";
22
22
  import { expandOpsValue, loadOpsEnv, OPS_VERBS, runOps } from "./ops.js";
23
- import { assignmentsPending, pumpExecutionSlots, renewLeases } from "./execution.js";
23
+ import { pumpExecutionSlots, renewLeases } from "./execution.js";
24
24
  import { createRehearsalWorktree, rehearsalWorktreePath, removeAttemptWorktree } from "./attempt-worktree.js";
25
25
  import { applyRunnerToolPath, installRunnerService, uninstallRunnerService } from "./service.js";
26
26
  import { attemptsActiveOnComputer, BRIDGE_PROTOCOL_VERSION, cachedBridgePreflight, gateRehearsalLockHeld, planGateRehearsals, PREFLIGHT_CACHE_TTL_MS, runGateRehearsal, unavailableWorkspacePreflight } from "./preflight.js";
@@ -667,24 +667,21 @@ async function runner() {
667
667
  await heartbeat(client, config, workspace, currentBrief, preflight, intentProof, bootstrapResult);
668
668
  }
669
669
  await renewLeases(client, config);
670
- // Dispatched work outranks a rehearsal already running, and so does an attempt on this
671
- // computer (this runner or another). Stop it with nothing recorded, release the lock, and
672
- // claim on this same cycle. The rehearsal stays due.
673
- if (gateRehearsalRunning && (attemptsActiveOnComputer() || await assignmentsPending(client))) {
670
+ // Only an active attempt interrupts a rehearsal. Waiting work takes the next cycle.
671
+ if (gateRehearsalRunning && attemptsActiveOnComputer()) {
674
672
  gateRehearsalAbort?.abort();
675
673
  await gateRehearsalDone;
676
674
  }
677
- // Another runner on this computer rehearsing its gate, or any runner with an attempt in
678
- // flight: claim as usual, rehearse on a later cycle. An assignment already waiting is
679
- // claimed below; this cycle does not start a rehearsal.
675
+ // Another runner with an attempt in flight takes precedence over a new rehearsal.
680
676
  if (workspace && onlineDriverIds(config).length && !gateRehearsalRunning && rehearsalPlan?.due
681
677
  && running.size === 0 && Object.keys(config.activeAttempts).length === 0 && !gateRehearsalLockHeld()
682
- && !attemptsActiveOnComputer()
683
- && !await assignmentsPending(client)) {
678
+ && !attemptsActiveOnComputer()) {
679
+ console.log(`Claim deferred for gate rehearsal in ${rehearsalPlan.due.workspace}`);
684
680
  startGateRehearsal(rehearsalPlan.due.workspace, rehearsalPlan.due.plan);
685
681
  }
686
- // No claim while the gate rehearses: the rehearsal measures the gate alone, never beside an attempt.
687
- if (workspace && onlineDriverIds(config).length && !gateRehearsalRunning) {
682
+ // Idle computers rehearse before claiming. Active attempts keep their execution slots pumping.
683
+ if (workspace && onlineDriverIds(config).length && !gateRehearsalRunning
684
+ && (!rehearsalPlan?.due || running.size > 0 || Object.keys(config.activeAttempts).length > 0 || attemptsActiveOnComputer())) {
688
685
  // Read the workspace again, then publish it. The last brief stands if the read fails.
689
686
  const publishWorkspaceState = async (options = {}) => {
690
687
  // Not while an investigation runs: its observation-only check compares the source checkout
@@ -740,7 +737,7 @@ async function runner() {
740
737
  await new Promise((resolveSleep) => setTimeout(resolveSleep, intervalMs));
741
738
  }
742
739
  }
743
- /** True while the gate rehearsal runs in the background. A dispatched assignment aborts it, then this cycle claims. */
740
+ /** True while the gate rehearsal runs in the background. Waiting assignments do not interrupt it. */
744
741
  let gateRehearsalRunning = false;
745
742
  let gateRehearsalAbort = null;
746
743
  let gateRehearsalDone = Promise.resolve();
@@ -809,7 +806,7 @@ function startGateRehearsal(workspace, plan) {
809
806
  else if (rehearsal === null && attemptsActiveOnComputer())
810
807
  console.log("Gate rehearsal stopped: an attempt is in flight on this computer");
811
808
  else if (abort.signal.aborted)
812
- console.log("Gate rehearsal stopped: an assignment is waiting");
809
+ console.log("Gate rehearsal stopped: an attempt is in flight on this computer");
813
810
  })
814
811
  .catch((error) => console.error(`Gate rehearsal failed: ${redactSecrets(error instanceof Error ? error.message : "unknown error")}`))
815
812
  .finally(async () => {
package/dist/preflight.js CHANGED
@@ -611,6 +611,8 @@ async function rehearseGate(workspace, plan, options) {
611
611
  const seconds = Math.round(elapsed / 1_000);
612
612
  if (result.code !== 0 || result.timedOut === true || elapsed <= VERIFICATION_TIMEOUT_MS) {
613
613
  commands.push({ command, seconds, exit_code: result.code, timed_out: result.timedOut === true });
614
+ if (result.code !== 0 || result.timedOut === true)
615
+ break;
614
616
  continue;
615
617
  }
616
618
  // The pass fit only the rehearsal's limit: it was a warm-up. Measure once more, in a fresh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miraland-labs/conduit-bridge",
3
- "version": "0.16.195",
3
+ "version": "0.16.196",
4
4
  "description": "Conduit Bridge CLI — join, connect, disconnect, multi-driver lanes, and run Claude Code / Codex / Cursor / OpenCode / Pi / Kiro / Antigravity / Grok Build agents for a Conduit organization",
5
5
  "type": "module",
6
6
  "bin": {