@miraland-labs/conduit-bridge 0.16.207 → 0.16.208
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/ensure-test-evidence.js +20 -3
- package/dist/investigation.js +5 -1
- package/dist/probe-run.js +7 -1
- package/package.json +1 -1
|
@@ -572,6 +572,11 @@ async function missingNpmLockReason(directory) {
|
|
|
572
572
|
return "pnpm-lock.yaml is not an npm install";
|
|
573
573
|
return "no package-lock.json or npm-shrinkwrap.json";
|
|
574
574
|
}
|
|
575
|
+
/** Lock-pinned crates and npm packages, fetched outside the sandbox before a gate runs inside it. */
|
|
576
|
+
export async function prepareVerificationDependencies(workspace) {
|
|
577
|
+
await fetchLockedDependencies(workspace);
|
|
578
|
+
await installLockedPackages(workspace);
|
|
579
|
+
}
|
|
575
580
|
export async function installLockedPackages(workspace, options = {}) {
|
|
576
581
|
const installed = [];
|
|
577
582
|
const skipped = [];
|
|
@@ -612,7 +617,19 @@ export async function installLockedPackages(workspace, options = {}) {
|
|
|
612
617
|
* `output` is stdout and stderr together, in the order the lines arrived: a failure detail reads its
|
|
613
618
|
* tail from it.
|
|
614
619
|
*/
|
|
615
|
-
export
|
|
620
|
+
export function runBoundedVerificationCommand(command, workspace, timeoutMs = VERIFICATION_TIMEOUT_MS) {
|
|
621
|
+
return runVerificationCommand(command, workspace, timeoutMs, true);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* The same run without the dependency preparation, for a caller that is itself inside the sandbox
|
|
625
|
+
* (the delivered probe instrument). It has no network, so its own install would fail and leave a
|
|
626
|
+
* partial `node_modules` that hides the complete one. Bridge prepares that workspace before it
|
|
627
|
+
* starts the caller (CR31).
|
|
628
|
+
*/
|
|
629
|
+
export function runPreparedVerificationCommand(command, workspace, timeoutMs = VERIFICATION_TIMEOUT_MS) {
|
|
630
|
+
return runVerificationCommand(command, workspace, timeoutMs, false);
|
|
631
|
+
}
|
|
632
|
+
async function runVerificationCommand(command, workspace, timeoutMs, prepare) {
|
|
616
633
|
const argv = argvForBoundedCommand(command);
|
|
617
634
|
const bin = argv[0];
|
|
618
635
|
if (!bin)
|
|
@@ -670,8 +687,8 @@ export async function runBoundedVerificationCommand(command, workspace, timeoutM
|
|
|
670
687
|
partial[stream].append(parts.at(-1));
|
|
671
688
|
};
|
|
672
689
|
const output = () => [lines.text().replace(/\n$/, ""), partial.stdout.text(), partial.stderr.text()].filter(Boolean).join("\n");
|
|
673
|
-
|
|
674
|
-
|
|
690
|
+
if (prepare)
|
|
691
|
+
await prepareVerificationDependencies(workspace);
|
|
675
692
|
const tempRoot = untrustedCodeTempRoot(workspace);
|
|
676
693
|
await mkdir(tempRoot, { recursive: true });
|
|
677
694
|
const scratchHome = await mkdtemp(join(tempRoot, "gate-home-"));
|
package/dist/investigation.js
CHANGED
|
@@ -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, VERIFICATION_TIMEOUT_MS } from "./ensure-test-evidence.js";
|
|
10
|
+
import { boundedTail, prepareVerificationDependencies, 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";
|
|
@@ -690,6 +690,10 @@ async function execDeliveredProbeRun(argv, stdin, workspace, timeoutMs) {
|
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
export async function runDeliveredProbeInstrument(input) {
|
|
693
|
+
// The delivered instrument runs inside the sandbox and cannot install; its registered commands
|
|
694
|
+
// read what Bridge installs here, outside it (CR31).
|
|
695
|
+
if (input.probes.some((probe) => probe.test?.trim()))
|
|
696
|
+
await (input.prepare ?? prepareVerificationDependencies)(input.workspace);
|
|
693
697
|
const entry = join(input.workspace, PROBE_RUN_ENTRY);
|
|
694
698
|
const timeoutMs = deliveredProbeTimeoutMs(input.probes);
|
|
695
699
|
const stdin = JSON.stringify({ probes: input.probes });
|
package/dist/probe-run.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Delivered probe instrument entry. `{ "probes": [...] }` on stdin, `{ witnesses }` on stdout. */
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { runPreparedVerificationCommand } from "./ensure-test-evidence.js";
|
|
3
4
|
import { runDeliveryVerificationProbes } from "./investigation.js";
|
|
4
5
|
const probeRunInputSchema = z.object({
|
|
5
6
|
probes: z.array(z.object({
|
|
@@ -19,7 +20,12 @@ async function readStdin() {
|
|
|
19
20
|
}
|
|
20
21
|
try {
|
|
21
22
|
const parsed = probeRunInputSchema.parse(JSON.parse(await readStdin()));
|
|
22
|
-
|
|
23
|
+
// This process is inside the sandbox; Bridge prepared the workspace's dependencies before it started.
|
|
24
|
+
const witnesses = await runDeliveryVerificationProbes({
|
|
25
|
+
workspace: process.cwd(),
|
|
26
|
+
probes: parsed.probes,
|
|
27
|
+
runCommand: (command, workspace) => runPreparedVerificationCommand(command, workspace),
|
|
28
|
+
});
|
|
23
29
|
process.stdout.write(`${JSON.stringify({ witnesses })}\n`);
|
|
24
30
|
}
|
|
25
31
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miraland-labs/conduit-bridge",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.208",
|
|
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": {
|