@miraland-labs/conduit-bridge 0.16.114 → 0.16.115

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
@@ -664,19 +664,18 @@ async function runner() {
664
664
  const hb = await heartbeat(client, config, workspace, currentBrief, preflight, undefined, bootstrapResult);
665
665
  return { preflight, hb };
666
666
  };
667
+ const publishHeartbeat = async () => {
668
+ await publishWorkspaceState();
669
+ };
667
670
  // Observation runs before authoring: an owner waiting on an answer should not queue behind
668
671
  // a long delivery, and the control plane already counted this slot as busy.
669
672
  progressed = await executeNextInvestigation(client, config, workspace, brief, timeoutMs, {
670
673
  managedRoot: hb.on_shift?.managed_workspace_root ?? null,
671
- heartbeat: async () => {
672
- await publishWorkspaceState();
673
- },
674
+ heartbeat: publishHeartbeat,
674
675
  heartbeatIntervalMs: intervalMs,
675
676
  }) || progressed;
676
677
  progressed = await pumpExecutionSlots(client, config, workspace, brief, timeoutMs, {
677
- heartbeat: async () => {
678
- await publishWorkspaceState();
679
- },
678
+ heartbeat: publishHeartbeat,
680
679
  beforeClaim: async (driverId) => {
681
680
  // Never let the five-minute heartbeat cache span a CLI upgrade into a certified claim.
682
681
  // Publish the fresh probe first; the Control Plane then remains the authority for the
@@ -17,9 +17,8 @@ import { pickDriverForClaim, resolveDriverFuel, supportsReadOnlyDiagnosis } from
17
17
  import { diffStatSince } from "./git-witness.js";
18
18
  import { switchManagedWorkspace } from "./on-shift-apply.js";
19
19
  import { execFile, spawn } from "node:child_process";
20
- import { mkdtemp, rm, writeFile } from "node:fs/promises";
20
+ import { rm, writeFile } from "node:fs/promises";
21
21
  import { createRequire } from "node:module";
22
- import { tmpdir } from "node:os";
23
22
  import { join } from "node:path";
24
23
  import { promisify } from "node:util";
25
24
  import { isRunnableVerificationCommand } from "./execution-class.js";
@@ -97,11 +96,11 @@ const investigationBriefSchema = z.object({
97
96
  /** T122: a delivery verification is an investigation whose question carries this header. */
98
97
  export const DELIVERY_VERIFICATION_HEADER = "DELIVERY VERIFICATION";
99
98
  /** Owner-verbatim: the lane writes probe source; Bridge executes. Shown only when BRIEF KEYS are present. */
100
- export const DELIVERY_VERIFICATION_PROBE_INSTRUCTION = 'For every BRIEF KEY that states behaviour, add one entry to probes: either {"key":"[sN]","test":"<registered command that asserts it>","checks":"<one line: what it proves>"} or {"key":"[sN]","lang":"ts|py|sh","source":"<a short script that exits 0 only when the key holds at this commit and non-zero otherwise; it may import repository modules by absolute path from the working directory>","checks":"<one line>"}. You do not run probes; Bridge runs them after you finish. Keys that state no behaviour (wording, scope, docs) get no probe.';
99
+ export const DELIVERY_VERIFICATION_PROBE_INSTRUCTION = 'For every BRIEF KEY that states behaviour, add one entry to probes: either {"key":"[sN]","test":"<registered command that asserts it>","checks":"<one line: what it proves>"} or {"key":"[sN]","lang":"ts|py|sh","source":"<a short script run from the repository root that prints PROBE HOLDS as its last line and exits 0 when the key holds at this commit and prints PROBE FAILS as its last line and exits 1 when it does not; any other ending is recorded as broken; it may import repository modules by paths relative to the repository root>","checks":"<one line>"}. You do not run probes; Bridge runs them after you finish. Keys that state no behaviour (wording, scope, docs) get no probe.';
101
100
  const BRIEF_JSON_EXAMPLE = '{"summary":"one paragraph: what the change does and whether it meets the criteria","findings":["grounded fact with file/symbol"],"verification":["command — result"],"limitations":["what you could not settle"],"criteria":[{"criterion":"c1","assessment":"supported|unsupported|unclear","reason":"what you saw"}],"command_failures":["command that exited non-zero — the decisive output line"],"files_read":0,"bytes_read":0,"commands_run":["command you actually ran"]}';
102
101
  const BRIEF_JSON_EXAMPLE_WITH_PROBES = '{"summary":"one paragraph: what the change does and whether it meets the criteria","findings":["grounded fact with file/symbol"],"verification":["command — result"],"limitations":["what you could not settle"],"criteria":[{"criterion":"c1","assessment":"supported|unsupported|unclear","reason":"what you saw"}],"command_failures":["command that exited non-zero — the decisive output line"],"probes":[],"files_read":0,"bytes_read":0,"commands_run":["command you actually ran"]}';
103
102
  /** Named in both prompts so the lane knows each list's maximum before it writes. */
104
- export const BRIEF_LIMITS_SENTENCE = "Limits: findings at most 12, verification at most 8, limitations at most 8, criteria at most 40, command_failures at most 10, commands_run at most 10, probes at most 20. Keep the most decisive entries.";
103
+ export const BRIEF_LIMITS_SENTENCE = "Limits: findings at most 12, verification at most 8, limitations at most 8, criteria at most 40, command_failures at most 10, commands_run at most 10, probes at most 20; each text entry at most 1000 characters, commands_run entries at most 200 characters. Keep the most decisive entries.";
105
104
  export function isDeliveryVerification(assignment) {
106
105
  return assignment.question.trimStart().startsWith(DELIVERY_VERIFICATION_HEADER);
107
106
  }
@@ -435,11 +434,8 @@ function probeInterpreter(language) {
435
434
  return "bash";
436
435
  }
437
436
  function probeFilename(language) {
438
- if (language === "ts")
439
- return "probe.mts";
440
- if (language === "py")
441
- return "probe.py";
442
- return "probe.sh";
437
+ const extension = language === "ts" ? "mts" : language === "py" ? "py" : "sh";
438
+ return `.conduit-probe-${crypto.randomUUID()}.${extension}`;
443
439
  }
444
440
  function probeArgv(language, file) {
445
441
  if (language === "ts")
@@ -533,13 +529,11 @@ export async function runDeliveryVerificationProbes(input) {
533
529
  continue;
534
530
  const language = probe.lang;
535
531
  const command = `${probeInterpreter(language)} ${probe.key}`;
536
- let dir = null;
532
+ const file = join(input.workspace, probeFilename(language));
537
533
  let exitCode = -1;
538
534
  let stdout = "";
539
535
  let stderr = "";
540
536
  try {
541
- dir = await mkdtemp(join(tmpdir(), "conduit-probe-"));
542
- const file = join(dir, probeFilename(language));
543
537
  await writeFile(file, source, { encoding: "utf8" });
544
538
  const result = await execProbe(probeArgv(language, file), input.workspace);
545
539
  exitCode = result.code;
@@ -551,8 +545,7 @@ export async function runDeliveryVerificationProbes(input) {
551
545
  exitCode = -1;
552
546
  }
553
547
  finally {
554
- if (dir)
555
- await rm(dir, { recursive: true, force: true }).catch(() => undefined);
548
+ await rm(file, { force: true }).catch(() => undefined);
556
549
  }
557
550
  witnesses.push(witnessRecord({
558
551
  key: probe.key, kind: "probe", command, exitCode, stdout, stderr, checks,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miraland-labs/conduit-bridge",
3
- "version": "0.16.114",
3
+ "version": "0.16.115",
4
4
  "description": "Conduit Bridge CLI \u2014 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": {