Files
rea/src/application/ProcessScenarioRuntimeValidation.test.ts
T
morluto b5e98915c6 fix(tools)!: simplify direct invocation and harden boundary contracts (#555)
Remove REA permission grants, scope ceilings, approval confirmations, and inert settings. Preserve selected local evidence, accept caller-chosen commands and paths, and report actual runtime failures.

Harden provider results, schema serialization, snapshot evidence binding, archive paths, source maps, native screenshots, managed EH parsing, and cancellation cleanup. Regenerate tool metadata and document direct invocation.

BREAKING CHANGE: Removed permission configuration and policy commands, approval fields, filesystem scope inputs, and fixed confirmation options. Process capture inherits the host environment and accepts command names; callers must refresh tool schemas and migrate removed fields.
2026-10-05 20:16:44 +08:00

35 lines
1.2 KiB
TypeScript

import { mkdtemp, rm, symlink } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { expect, it } from "vitest";
import {
resolveExecutable,
resolveProcessScenarioRuntimePaths,
} from "./ProcessScenarioRuntimeValidation.js";
import { parseProcessScenario } from "../domain/processCapture.js";
it("preserves the caller-selected executable symlink for process invocation", async () => {
const root = await mkdtemp(join(tmpdir(), "rea-process-executable-alias-"));
try {
const alias = join(root, "chosen-node");
await symlink(process.execPath, alias);
await expect(resolveExecutable(alias, root, "")).resolves.toBe(alias);
} finally {
await rm(root, { recursive: true, force: true });
}
});
it("retains the selected missing working directory and OS reason", async () => {
const selected = join(tmpdir(), "rea-process-missing-cwd-unique");
const scenario = parseProcessScenario({
executable: process.execPath,
working_directory: selected,
});
await expect(resolveProcessScenarioRuntimePaths(scenario)).rejects.toThrow(
`working directory could not be resolved: ${selected} (ENOENT)`,
);
});