@miraland-labs/conduit-bridge 0.16.200 → 0.16.203

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.
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { redactSecrets, redactSecretsDeep } from "./secret-redaction.js";
9
9
  import { z } from "zod";
10
- import { boundedTail, runBoundedVerificationCommand } from "./ensure-test-evidence.js";
10
+ import { boundedTail, runBoundedVerificationCommand, VERIFICATION_TIMEOUT_MS } from "./ensure-test-evidence.js";
11
11
  import { markAttemptActive } from "./preflight.js";
12
12
  import { createAttemptWorktree, removeAttemptWorktree } from "./attempt-worktree.js";
13
13
  import { buildWorkspaceBrief, ensureCommitAvailable, normalizeRepositoryUrl } from "./brief.js";
@@ -418,6 +418,10 @@ export const BRIDGE_PACKAGE_NAME = "@miraland-labs/conduit-bridge";
418
418
  export const BRIDGE_SRC_PREFIX = "packages/conduit-bridge/src/";
419
419
  export const PROBE_RUN_ENTRY = "packages/conduit-bridge/src/probe-run.ts";
420
420
  export const DELIVERED_PROBE_SELF_CHECK_TAIL = "delivered probe instrument failed its self-check";
421
+ export const DELIVERED_PROBE_RUN_FAILED_TAIL = "delivered probe instrument failed its real run";
422
+ export function deliveredProbeTimeoutMs(probes) {
423
+ return probes.slice(0, PROBE_MAX).reduce((bound, probe) => bound + (probe.test?.trim() ? VERIFICATION_TIMEOUT_MS : PROBE_TIMEOUT_MS), PROBE_TIMEOUT_MS);
424
+ }
421
425
  export const KNOWN_ANSWER_PROBES = [
422
426
  { key: "[known-holds]", lang: "sh", source: "echo 'PROBE HOLDS'\nexit 0", checks: "known answer: holds" },
423
427
  { key: "[known-fails]", lang: "sh", source: "echo 'PROBE FAILS'\nexit 1", checks: "known answer: fails" },
@@ -640,8 +644,8 @@ const deliveredWitnessSchema = z.object({
640
644
  function stampInstrument(witnesses, instrument) {
641
645
  return witnesses.map((witness) => ({ ...witness, instrument }));
642
646
  }
643
- function markSelfCheckBroken(witnesses, reason) {
644
- const tail = boundedTail(`${DELIVERED_PROBE_SELF_CHECK_TAIL}: ${reason}`, PROBE_TAIL_CHARS);
647
+ function markDeliveredProbeBroken(witnesses, label, reason) {
648
+ const tail = `${label}: ${boundedTail(reason, PROBE_TAIL_CHARS - label.length - 2)}`;
645
649
  return stampInstrument(witnesses.map((witness) => ({
646
650
  ...witness,
647
651
  verdict: "broken",
@@ -683,7 +687,7 @@ async function execDeliveredProbeRun(argv, stdin, workspace, timeoutMs) {
683
687
  }
684
688
  export async function runDeliveredProbeInstrument(input) {
685
689
  const entry = join(input.workspace, PROBE_RUN_ENTRY);
686
- const timeoutMs = PROBE_TIMEOUT_MS * (input.probes.length + 1);
690
+ const timeoutMs = deliveredProbeTimeoutMs(input.probes);
687
691
  const stdin = JSON.stringify({ probes: input.probes });
688
692
  const argv = ["node", ...probeNodeFlags(), "--import", tsxLoader, entry];
689
693
  const result = await (input.exec ?? execDeliveredProbeRun)(argv, stdin, input.workspace, timeoutMs);
@@ -710,15 +714,23 @@ export async function runDeliveryVerificationProbesForAttempt(input) {
710
714
  let selfCheckDetail = null;
711
715
  try {
712
716
  const check = await runDelivered({ workspace: input.workspace, probes: KNOWN_ANSWER_PROBES });
713
- if (knownAnswerProbesPassed(check)) {
714
- return stampInstrument(await runDelivered({ workspace: input.workspace, probes: input.probes }), "delivered");
717
+ if (!knownAnswerProbesPassed(check)) {
718
+ selfCheckDetail = `gave ${check.map((witness) => witness.verdict).join(", ")}`;
715
719
  }
716
- selfCheckDetail = `gave ${check.map((witness) => witness.verdict).join(", ")}`;
717
720
  }
718
721
  catch (error) {
719
722
  selfCheckDetail = redactSecrets(error instanceof Error ? error.message : String(error));
720
723
  }
721
- return markSelfCheckBroken(await runRunning(), selfCheckDetail ?? "");
724
+ if (selfCheckDetail !== null) {
725
+ return markDeliveredProbeBroken(await runRunning(), DELIVERED_PROBE_SELF_CHECK_TAIL, selfCheckDetail);
726
+ }
727
+ try {
728
+ return stampInstrument(await runDelivered({ workspace: input.workspace, probes: input.probes }), "delivered");
729
+ }
730
+ catch (error) {
731
+ const detail = redactSecrets(error instanceof Error ? error.message : String(error));
732
+ return markDeliveredProbeBroken(await runRunning(), DELIVERED_PROBE_RUN_FAILED_TAIL, detail);
733
+ }
722
734
  }
723
735
  async function settle(client, investigationId, body) {
724
736
  await client.request(`/runner/v1/investigations/${investigationId}/settle`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miraland-labs/conduit-bridge",
3
- "version": "0.16.200",
3
+ "version": "0.16.203",
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": {