mirror of
https://github.com/morluto/rea.git
synced 2026-10-31 11:56:12 +00:00
* refactor(config): parse capability settings into exact states * refactor(runtime): encode replay and process outcomes exactly * refactor: make analysis states unrepresentable * refactor(mcp): register canonical schemas with SDK * fix: preserve capability and catalog invariants * fix(build): remove stale compiled modules * fix(replay): update real verifier policy dependency * fix(package): verify the complete MCP catalog * fix(test): supply complete replay reload policy * refactor(contracts): centralize output schema lookup * refactor(mcp): delegate protocol boundaries to SDK * fix(browser): approve real source capture * fix(mcp): preserve catalog guidance
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { parseConfig } from "../../../src/config.js";
|
|
|
|
describe("process capture configuration", () => {
|
|
it("parses all authority required by enabled capture", () => {
|
|
const result = parseConfig({
|
|
REA_PROCESS_CAPTURE_ENABLED: "true",
|
|
REA_PROCESS_EXECUTABLE_ROOTS_JSON: '["/opt/tools"]',
|
|
REA_PROCESS_WORKING_ROOTS_JSON: '["/tmp/work"]',
|
|
REA_PROCESS_ALLOWED_ENV_JSON: '["TOKEN"]',
|
|
REA_PROCESS_ALLOW_EXTERNAL_NETWORK: "true",
|
|
});
|
|
if (!result.ok) throw result.error;
|
|
expect(result.value.processExecutionPolicy).toEqual({
|
|
status: "enabled",
|
|
executableRoots: ["/opt/tools"],
|
|
workingRoots: ["/tmp/work"],
|
|
allowedEnvironment: ["TOKEN"],
|
|
networkAccess: "external",
|
|
});
|
|
});
|
|
|
|
it("requires both authority roots when capture is enabled", () => {
|
|
expect(parseConfig({ REA_PROCESS_CAPTURE_ENABLED: "true" })).toMatchObject({
|
|
ok: false,
|
|
});
|
|
});
|
|
|
|
it("does not retain dormant process-capture authority", () => {
|
|
const result = parseConfig({
|
|
REA_PROCESS_CAPTURE_ENABLED: "false",
|
|
REA_PROCESS_EXECUTABLE_ROOTS_JSON: '["/opt/tools"]',
|
|
REA_PROCESS_WORKING_ROOTS_JSON: '["/tmp/work"]',
|
|
REA_PROCESS_ALLOWED_ENV_JSON: '["TOKEN"]',
|
|
REA_PROCESS_ALLOW_EXTERNAL_NETWORK: "true",
|
|
});
|
|
if (!result.ok) throw result.error;
|
|
expect(result.value.processExecutionPolicy).toEqual({
|
|
status: "disabled",
|
|
});
|
|
});
|
|
});
|