test(applications): pass Evidence requests to the CLI through files (#3049)

Use existing test-owned request files for the remaining full Evidence CLI inputs. Preserve complete inputs, semantic assertions and inline transport coverage. Verified the full Linux file and native Windows baseline failures plus corrected public CLI cases.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
This commit is contained in:
Guilherme Dias FusariandKaoru0822 authored and GitHub committed 2026-10-15 15:51:03 +00:00
1 parent 9f8659e053
commit 5b16f24310
1 file changed
+26 -10
@@ -850,18 +850,18 @@ describe("application workflow CLI parity", () => {
if (seed === undefined)
throw new TypeError("Expected at least one semantic relation");
const traced = await runCli([
const traced = await runCliWithRequestFile(
root,
"trace-javascript-semantics",
JSON.stringify({
{
application: analyzed.value,
query: {
seed: { kind: "semantic-node", node_id: seed },
direction: "forward-influence",
include_ambiguous_dynamic_edges: true,
},
}),
"--json",
]);
},
);
expect(traced).toMatchObject({
operation: "trace_javascript_semantics",
predicate_type: "rea.javascript-semantic-trace",
@@ -1300,18 +1300,18 @@ describe("application workflow CLI export Evidence", () => {
'export default async function make() { return { kind: "record", extra: 1 }; }',
];
const [left, right] = await analyzeComparisonSources(root, sources);
const compared = await runCli([
const compared = await runCliWithRequestFile(
root,
"compare-javascript-export-shapes",
JSON.stringify({
{
left,
right,
left_module_path: "parser.mjs",
left_export_name: "default",
right_module_path: "parser.mjs",
right_export_name: "default",
}),
"--json",
]);
},
);
expect(compared).toMatchObject({
operation: "compare_javascript_export_shapes",
normalized_result: {
@@ -1640,3 +1640,19 @@ const runCli = async (
throw cause;
}
};
/**
* Pass a request carrying complete Evidence through the CLI's file-backed JSON
* input. Serialized Evidence exceeds the Windows command-line limit when it is
* passed as one argument, so spawn fails with ENAMETOOLONG before the workflow
* starts. Inline JSON transport keeps its own coverage in the parity tests.
*/
const runCliWithRequestFile = async (
root: string,
command: string,
request: unknown,
): Promise<unknown> => {
const requestPath = join(root, "request.json");
await writeFile(requestPath, JSON.stringify(request));
return runCli([command, requestPath, "--json"]);
};