mirror of
https://github.com/morluto/rea.git
synced 2026-11-22 14:35:45 +00:00
fix(javascript): retain static facts under projection pressure (#7986)
* fix(javascript): retain static facts under projection pressure * fix(javascript): scope IPC ambiguity to omitted projections * fix(javascript): preserve IPC uncertainty for omitted sources * fix(javascript): qualify IPC pairing by wrapper coverage * fix(javascript): retain provisional IPC wrapper matches
This commit is contained in:
1 parent
f60e42a9ae
commit
54f5cf7e14
13 files changed
+1174
-40
No files matched your search
@@ -98,10 +98,14 @@ function* buildJavaScriptArtifactGraphInputSteps(
|
||||
const applicationOwnershipUnknownContainers = new Set<string>();
|
||||
const applicationModuleGapSources = new Map<string, Set<string>>();
|
||||
const applicationModuleReferencesRetained = new Set<string>();
|
||||
let ipcSourceGap = false;
|
||||
const recordModuleGap = (file: {
|
||||
path: string;
|
||||
container_sha256: string;
|
||||
kind?: string;
|
||||
}) => {
|
||||
if (file.kind === "javascript" || file.kind === undefined)
|
||||
ipcSourceGap = true;
|
||||
const container = applicationContainerIdentity(fileSet, file);
|
||||
const sources =
|
||||
applicationModuleGapSources.get(container) ?? new Set<string>();
|
||||
@@ -123,11 +127,24 @@ function* buildJavaScriptArtifactGraphInputSteps(
|
||||
(!("text" in file) || !file.text.included)
|
||||
)
|
||||
recordModuleGap(file);
|
||||
// Unread HTML can conceal inline scripts with Electron IPC calls.
|
||||
if (file.kind === "html" && (!("text" in file) || !file.text.included))
|
||||
ipcSourceGap = true;
|
||||
}
|
||||
}
|
||||
// Omitted module relationships can hide another launch owner. Do not expand
|
||||
// retained facts beyond the projection guard merely to recover ownership.
|
||||
for (const analyzed of analysis.files) {
|
||||
if (
|
||||
analyzed.file.kind === "javascript" &&
|
||||
(analyzed.javascript === null ||
|
||||
analyzed.javascript.analysis_coverage === undefined ||
|
||||
analyzed.javascript.analysis_coverage.examination
|
||||
.electron_call_paths_limited ||
|
||||
analyzed.javascript.analysis_coverage.examination
|
||||
.semantic_resource_limits.length > 0)
|
||||
)
|
||||
ipcSourceGap = true;
|
||||
if (
|
||||
analyzed.application_projection_failure !== undefined ||
|
||||
analyzed.analysis_failure !== undefined ||
|
||||
@@ -198,8 +215,19 @@ function* buildJavaScriptArtifactGraphInputSteps(
|
||||
yield* addJavaScriptModuleRelationshipsSteps(projectionContext);
|
||||
const findingLimitations =
|
||||
yield* addJavaScriptStaticFindingsSteps(projectionContext);
|
||||
const ipc = createElectronIpcContext(analysis, (file) =>
|
||||
applicationRootPath(projectionContext, file),
|
||||
const coverage = graphCoverage(context);
|
||||
// Graph-wide partial coverage can describe unrelated dynamic values or
|
||||
// source maps. Qualify IPC pairing by omitted JavaScript sources instead:
|
||||
// their hidden handlers could compete with an observed match.
|
||||
const ipc = createElectronIpcContext(
|
||||
projectionContext.analysis,
|
||||
(file) => applicationRootPath(projectionContext, file),
|
||||
snapshot.coverage.status === "complete" &&
|
||||
!ipcSourceGap &&
|
||||
analysis.html_inline_scripts.length === 0 &&
|
||||
!fileSet.unavailable_relevant_files.some(
|
||||
({ kind }) => kind === undefined,
|
||||
),
|
||||
);
|
||||
addElectronBoundaries(projectionContext, ipc);
|
||||
yield;
|
||||
@@ -207,10 +235,9 @@ function* buildJavaScriptArtifactGraphInputSteps(
|
||||
yield;
|
||||
addJavaScriptSourceMapOriginals(projectionContext);
|
||||
yield;
|
||||
const coverage = graphCoverage(context);
|
||||
return {
|
||||
electronSummary: summarizeElectronBoundaries(
|
||||
analysis,
|
||||
projectionContext.analysis,
|
||||
ipc,
|
||||
context.directoryPaths,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user