fix(javascript): analyze first-party sources before dependencies (#9341)

* fix(javascript): analyze first-party sources before dependencies

Every source in one application analysis charges the same parent result
budget, and sources were offered in lexical inventory order. On an Electron
app.asar, node_modules/ sorts before an electron-vite out-*/ directory, so
dependency files spent the budget and every first-party main, preload, and
renderer file had its semantic analysis not started and its application
projection rejected. The summary then reported zero windows, preloads, and
bridges while electron_semantics still said "recovered".

Offer application JavaScript before JavaScript under node_modules; reported
files keep inventory order. Count Electron boundary facts only from files
whose projection was admitted, and report electron_semantics "partial" (with
a limitation naming the count) when an Electron-loading source was not fully
examined or reported.

Fixes #9321

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(javascript): treat limited Electron examination as partial coverage

A static pass can stop early at the Electron wrapper expansion budget or
another resource limit without failing the worker. Such a source carries no
analysis or projection failure, so its retained IPC or bridge facts still
reported electron_semantics "recovered". Read the owned examination status
and count a limited Electron-loading source as incomplete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-11-09 19:42:19 +08:00
1 parent 31b6db72c6
commit 512bcf5cdb
7 files changed
+418 -44

No files matched your search

@@ -61,14 +61,17 @@ const electronBoundarySummarySchema = z.strictObject({
/**
* Whether the Electron boundary surface was actually recovered. `empty` means
* an analyzed source names Electron but no boundary fact was recovered, so the
* zeroes above are missing coverage and not evidence of absence.
* zeroes above are missing coverage and not evidence of absence. `partial`
* means some boundary facts were recovered while other Electron-loading
* sources were not fully examined or reported, for example after the result
* budget ran out; counts from those sources are unknown, not zero.
*
* Absent when no retained fact names an Electron module, or in evidence
* produced before this field existed. Absence is unknown rather than proof
* that the application has no Electron surface: unread sources, failed
* analysis, and dynamic module names can hide one.
*/
electron_semantics: z.enum(["recovered", "empty"]).exactOptional(),
electron_semantics: z.enum(["recovered", "partial", "empty"]).exactOptional(),
});
const reconstructionStatisticsSchema = z.strictObject({