fix(javascript): bound semantic expansion and resolve lexical receivers

This commit is contained in:
morluto
2026-10-09 00:49:30 +08:00
parent eaf5734083
commit 16f4609d68
26 changed files with 868 additions and 78 deletions
@@ -104,6 +104,42 @@ it("preserves graph commitments and export shapes when consuming file-local IR",
}
});
it("reports semantic value resource limits in application graph coverage", async () => {
const root = await createTestTempDirectory("rea-javascript-semantic-limit-");
const expression = Array.from(
{ length: 20 },
() => '(true ? "a" : "b")',
).join(" + ");
await writeFile(
join(root, "app.js"),
`const answer = { nested: ${expression} };`,
);
const snapshot = await scanCanonicalArtifactInventory(root, {});
const reader = createJavaScriptArtifactReader(root, "directory");
try {
const files = await readJavaScriptArtifactFiles(reader, snapshot);
const analysis = analyzeJavaScriptArtifactFiles(files);
const graph = buildJavaScriptArtifactGraph(snapshot, files, analysis);
expect(graph.coverage).toMatchObject({
status: "partial",
omitted_count: null,
limits: [
{
name: "javascript_semantic_primitive_candidates",
value: 256,
unit: "items",
},
],
});
expect(graph.limitations).toContain(
"Primitive candidate budget exceeded (maximum 256 alternatives).",
);
} finally {
await reader.close();
}
});
it("reconstructs package, Electron roles, Webpack/Rspack modules, and cross-layer facts without execution", async () => {
const root = await fixtureDirectory();
Reflect.deleteProperty(globalThis, "__rea_bundle_executed");