diff --git a/nemoclaw/src/blueprint/runner.test.ts b/nemoclaw/src/blueprint/runner.test.ts index 46249c181..02b3eafa2 100644 --- a/nemoclaw/src/blueprint/runner.test.ts +++ b/nemoclaw/src/blueprint/runner.test.ts @@ -624,12 +624,6 @@ describe("runner", () => { expect(stdoutText()).toContain("PROGRESS:100:Apply complete"); }); - it("rejects --plan flag (not yet implemented)", async () => { - await expect( - main(["apply", "--profile", "default", "--plan", "/tmp/saved-plan.json"]), - ).rejects.toThrow(/--plan is not yet implemented/); - }); - it("parses --dry-run and --endpoint-url for plan", async () => { await main([ "plan", diff --git a/nemoclaw/src/blueprint/runner.ts b/nemoclaw/src/blueprint/runner.ts index 9322b0e03..6e3355751 100644 --- a/nemoclaw/src/blueprint/runner.ts +++ b/nemoclaw/src/blueprint/runner.ts @@ -212,14 +212,8 @@ export async function actionPlan( export async function actionApply( profile: string, blueprint: Blueprint, - options?: { planPath?: string; endpointUrl?: string }, + options?: { endpointUrl?: string }, ): Promise { - if (options?.planPath) { - throw new Error( - "--plan is not yet implemented. Run apply without --plan to use the live blueprint.", - ); - } - const rid = emitRunId(); const { inferenceCfg, sandboxCfg } = await resolveRunConfig( @@ -395,7 +389,6 @@ export async function actionRollback(rid: string): Promise { export async function main(argv: string[] = process.argv.slice(2)): Promise { const action = argv[0] as Action | undefined; let profile = "default"; - let planPath: string | undefined; let runId: string | undefined; let dryRun = false; let endpointUrl: string | undefined; @@ -410,9 +403,7 @@ export async function main(argv: string[] = process.argv.slice(2)): Promise { }); it("debug --quick exits 0 and produces diagnostic output", () => { - const r = run("debug --quick"); + const r = runWithEnv("debug --quick", {}, 30000); expect(r.code).toBe(0); expect(r.out.includes("Collecting diagnostics")).toBeTruthy(); expect(r.out.includes("System")).toBeTruthy(); expect(r.out.includes("Onboard Session")).toBeTruthy(); expect(r.out.includes("Done")).toBeTruthy(); - }); + }, 30000); it("debug exits 1 on unknown option", () => { const r = run("debug --quik"); @@ -608,7 +608,7 @@ describe("CLI dispatch", () => { const connectResult = runWithEnv("alpha connect", { HOME: home, PATH: `${localBin}:${process.env.PATH || ""}`, - }); + }, 30000); expect(connectResult.code).toBe(1); expect(connectResult.out.includes("gateway trust material rotated after restart")).toBeTruthy(); expect(connectResult.out.includes("Recreate this sandbox")).toBeTruthy(); @@ -681,11 +681,11 @@ describe("CLI dispatch", () => { const connectResult = runWithEnv("alpha connect", { HOME: home, PATH: `${localBin}:${process.env.PATH || ""}`, - }); + }, 30000); expect(connectResult.code).toBe(1); expect(connectResult.out.includes("gateway is still refusing connections after restart")).toBeTruthy(); expect(connectResult.out.includes("If the gateway never becomes healthy")).toBeTruthy(); - }, 25000); + }, 30000); it("explains when the named gateway is no longer configured after restart or rebuild", () => { const home = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-cli-gateway-missing-")); diff --git a/test/credential-exposure.test.js b/test/credential-exposure.test.js index 08f880a9d..f6e84ac98 100644 --- a/test/credential-exposure.test.js +++ b/test/credential-exposure.test.js @@ -18,14 +18,6 @@ const ONBOARD_JS = path.join( "lib", "onboard.js", ); -const RUNNER_TS = path.join( - import.meta.dirname, - "..", - "nemoclaw", - "src", - "blueprint", - "runner.ts", -); // Matches --credential followed by a value containing "=" (i.e. KEY=VALUE). // Catches quoted KEY=VALUE patterns in JS and Python f-string interpolation. @@ -33,8 +25,6 @@ const RUNNER_TS = path.join( // NOTE: unquoted forms like `--credential KEY=VALUE` would not be detected. const JS_EXPOSURE_RE = /--credential\s+[^"]*"[A-Z_]+=/; const JS_CREDENTIAL_CONCAT_RE = /--credential.*=.*process\.env\./; -// TS pattern: --credential with template literal interpolation containing "=" -const TS_EXPOSURE_RE = /--credential.*=.*\$\{/; describe("credential exposure in process arguments", () => { it("onboard.js must not pass KEY=VALUE to --credential", () => { @@ -51,20 +41,6 @@ describe("credential exposure in process arguments", () => { expect(violations).toEqual([]); }); - it("runner.ts must not pass KEY=VALUE to --credential", () => { - const src = fs.readFileSync(RUNNER_TS, "utf-8"); - const lines = src.split("\n"); - - const violations = lines.filter( - (line) => - TS_EXPOSURE_RE.test(line) && - line.includes("--credential") && - !line.trimStart().startsWith("//"), - ); - - expect(violations).toEqual([]); - }); - it("onboard.js --credential flags pass env var names only", () => { const src = fs.readFileSync(ONBOARD_JS, "utf-8"); diff --git a/test/uninstall.test.js b/test/uninstall.test.js index cd0178638..16385a712 100644 --- a/test/uninstall.test.js +++ b/test/uninstall.test.js @@ -76,7 +76,7 @@ describe("uninstall helpers", () => { it("returns the expected gateway volume candidate", () => { const result = spawnSync( "bash", - ["-lc", `source "${UNINSTALL_SCRIPT}"; gateway_volume_candidates nemoclaw`], + ["-c", `source "${UNINSTALL_SCRIPT}"; gateway_volume_candidates nemoclaw`], { cwd: path.join(import.meta.dirname, ".."), encoding: "utf-8", @@ -99,7 +99,7 @@ describe("uninstall helpers", () => { const result = spawnSync( "bash", - ["-lc", `HOME="${tmp}" source "${UNINSTALL_SCRIPT}"; remove_nemoclaw_cli`], + ["-c", `HOME="${tmp}" source "${UNINSTALL_SCRIPT}"; remove_nemoclaw_cli`], { cwd: path.join(import.meta.dirname, ".."), encoding: "utf-8", @@ -120,7 +120,7 @@ describe("uninstall helpers", () => { const result = spawnSync( "bash", - ["-lc", `HOME="${tmp}" source "${UNINSTALL_SCRIPT}"; remove_nemoclaw_cli`], + ["-c", `HOME="${tmp}" source "${UNINSTALL_SCRIPT}"; remove_nemoclaw_cli`], { cwd: path.join(import.meta.dirname, ".."), encoding: "utf-8", @@ -142,7 +142,7 @@ describe("uninstall helpers", () => { const result = spawnSync( "bash", - ["-lc", `HOME="${tmp}" source "${UNINSTALL_SCRIPT}"; remove_nemoclaw_state`], + ["-c", `HOME="${tmp}" source "${UNINSTALL_SCRIPT}"; remove_nemoclaw_state`], { cwd: path.join(import.meta.dirname, ".."), encoding: "utf-8",