fix(artifacts): share bounded ASAR signature observations

Parse Pickle extents once at the ASAR boundary and carry finalized signature
facts through root and nested classification. Scan JSON whitespace within its
declared extent and decode budget without retaining the whitespace prefix.
Keep prefix storage bounded independently of stream chunk ownership.

Fill fixed ASAR prefixes and DMG trailers across short reads, preserve
cancellation through admission and stream EOF, and retain existing cleanup
ownership. Cover public CLI/MCP selection, root/nested inventory, malformed
JSON whitespace and padding, limits, native/XML consumers and descriptor faults.

Validation: 24 focused files / 170 tests; full check; docs check; test discovery.
Official inert ASAR fixtures and controlled descriptor faults were exercised;
real Electron execution, Windows and natural OS short-read frequency remain
unverified. Equivalent compact CLI tasks returned identical results and reply
token estimates; repeated timings do not establish a speedup.

Fixes #3574
Fixes #5188
This commit is contained in:
morluto committed 2026-10-19 14:32:48 +08:00
1 parent 2e5171e391
commit e8da7e1edd
22 files changed
+1129 -166

No files matched your search

+1 -1
View File
@@ -236,7 +236,7 @@ const asarFiles = async (
throwIfAborted(signal);
if (!opened.isFile() || archiveIdentity(opened) !== identity)
throw new Error("ASAR identity changed before header read");
const header = await admitAsarHeader(file);
const header = await admitAsarHeader(file, signal);
throwIfAborted(signal);
jsonBytes = header.jsonBytes;
const json = Buffer.alloc(jsonBytes);