mirror of
https://github.com/morluto/rea.git
synced 2026-11-08 07:46:28 +00:00
fix(javascript): bound symbolic property and member queries (#8876)
Fixes #8838. Admit all symbolic query entry points through the existing resolver budget, preserve cache-hit depth and restore entered frames in finally. Retain independent facts with partial source coverage instead of losing entire scripts to recursive spreads. Validated 273 focused tests, check:fast/docs:check, real CLI/stdio-MCP projections and complete parent reads, independent public-source oracle, and unchanged full results for the official Electron control and Bitwarden selected preload. Full technical CI 42308068679 passes, including all eight shards and required aggregates. Greptile reviews this head at 5/5; no completed Codex review of this head is available. The Author readiness-only exception is explicitly authorized; no human-review attestation is added. Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
This commit is contained in:
1 parent
48f5f30fd5
commit
abfccc0683
4 files changed
+244
-71
No files matched your search
+53
@@ -555,3 +555,56 @@ describe("JavaScript application cleanup diagnostics", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("JavaScript application symbolic coverage", () => {
|
||||
it("analyzes sources spreading recursive call results while preserving coverage limits and independent endpoints", async () => {
|
||||
const root = await createTestTempDirectory("rea-js-recursive-spread-");
|
||||
await writeFile(
|
||||
join(root, "self.js"),
|
||||
'function f(o) { const stay = f(o); return { ...stay, c: stay.sc.startsWith("k") }; }\nfetch("/kept-self");\n',
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "mutual.js"),
|
||||
'function a(o) { const stay = b(o); return { ...stay, c: stay.sc.startsWith("k") }; }\nfunction b(o) { const stay = a(o); return { ...stay, c: stay.sc.startsWith("k") }; }\nfetch("/kept-mutual");\n',
|
||||
);
|
||||
const result = await analyzeJavaScriptApplication({
|
||||
input_path: root,
|
||||
format: "directory",
|
||||
source_paths: ["self.js", "mutual.js"],
|
||||
});
|
||||
expect(result.ok).toBe(true);
|
||||
if (!result.ok) throw result.error;
|
||||
const normalized = javascriptApplicationAnalysisResultSchema.parse(
|
||||
result.value.normalized_result,
|
||||
);
|
||||
expect(normalized.statistics).toMatchObject({
|
||||
parsed_javascript_files: 2,
|
||||
parse_failures: 0,
|
||||
});
|
||||
const endpoints = normalized.graph.nodes
|
||||
.filter(({ kind }) => kind === "endpoint")
|
||||
.flatMap(({ observations }) =>
|
||||
observations.map(({ properties }) => properties.value),
|
||||
)
|
||||
.sort();
|
||||
expect(endpoints).toEqual(["/kept-mutual", "/kept-self"]);
|
||||
|
||||
const assetObservations = normalized.graph.nodes
|
||||
.filter(({ kind }) => kind === "javascript-asset")
|
||||
.flatMap(({ observations }) => observations);
|
||||
for (const path of ["self.js", "mutual.js"]) {
|
||||
const observation = assetObservations.find(
|
||||
({ properties }) => properties.path === path,
|
||||
);
|
||||
expect(observation?.properties).toMatchObject({
|
||||
parse_status: "partial",
|
||||
analysis_coverage: {
|
||||
examination: {
|
||||
status: "limited",
|
||||
electron_call_paths_limited: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user