Skip to content

fix(artifacts): preserve archive entry types and host paths - #581

Merged
morluto merged 1 commit into
mainfrom
fix/javascript-archive-boundaries
Oct 5, 2026
Merged

morluto merged 1 commit into
mainfrom
fix/javascript-archive-boundaries

Conversation

@morluto

@morluto morluto commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Summary

Fix JavaScript analysis of archives containing directories such as node_modules/@zip.js, and fix ASAR inventory/extraction on Windows. Directory and unknown-file inventory remains complete; these changes correct entry-type classification and provider path translation without adding filesystem permissions or scopes.

Fixes #571
Fixes #570

Problem and expected behavior

Directory graph nodes have artifact IDs, so the JavaScript file projection previously treated any .js, .json, or similar path as content to read. Opening a directory then aborted the whole analysis. Only regular-file occurrences now become parsing candidates or nested ASAR containers; directory nodes and their children remain evidence.

Electron's ASAR library lists paths with the host separator and a leading separator, and requires host-relative lookup keys. REA stripped only /, which left Windows lookup keys rooted and unreadable. The adapter now retains a host-relative key for statFile and extractFile and exposes slash-separated logical paths. Literal backslashes in POSIX filenames are preserved.

Change and scope

  • Gate JavaScript content projection on inventory entry type after validating referenced graph nodes.
  • Separate graph-facing ASAR paths from the library's host-facing lookup keys.
  • Add actual packed-ASAR regressions for nested file reads, directory inventory, symlink metadata, literal POSIX backslashes, and the @zip.js directory with an analyzable entry.js child.
  • Run ASAR inventory and JavaScript reconstruction tests in the native Windows capability lane. POSIX symlink/backslash cases are separate and skipped on Windows; the core Windows regression does not require symlink authority.

Contract and boundary impact

  • Semantic owner and earliest changed stage: artifact inventory projection and the Electron ASAR provider adapter.
  • CLI and MCP/tool-catalog contract: input/output schemas and catalog are unchanged; both surfaces use the corrected shared workflows.
  • Provider, bridge, target-format, or platform compatibility: Windows ASAR lookup keys now match the official library's host-path contract. POSIX literal filename characters remain intact.
  • Evidence, artifact, provenance, or reconstruction contract: directories remain materialized graph nodes but no longer masquerade as file contents.
  • Process execution, authorization, cleanup, or containment impact: none; archive contents are parsed without execution and no filesystem access restrictions are added.
  • Generated metadata, package, or installation impact: none; no dependencies added.

Evidence and regression coverage

The regression builds an archive containing node_modules/@zip.js/entry.js, proves the scope directory still has a graph node, and verifies that the child appears in the JavaScript asset graph. Reader tests pack real archives with the installed official @electron/asar implementation and read their nested contents through REA.

The path change was checked against the installed library's listFiles, getFile, statFile, and extractFile implementation. No module mocks replace the provider boundary.

Validation performed

  • npm run check:pr — passed, 347 files and 1,957 tests passed with 1 skipped; static checks and generated-document checks passed.
  • After rebasing onto the latest main, npm run check:fast and five focused files — passed, 42 tests covering ASAR inventory, JavaScript reconstruction, client dialect/lifecycle, and curated Windows lane registration.
  • Formatting and staged diff checks — passed.
  • Native Windows execution is delegated to the updated CI lane; local verification ran on macOS arm64.
  • Real Hopper/Ghidra/browser verification was not performed; their providers are unchanged.

Compatibility, safety, and release

No breaking schema changes or added permissions. Non-file entries remain inventoried and regular files inside suffix-named directories remain analyzable. The separate doctor subprocess observation in #570 is outside this ASAR fix; the named RuntimeExecutableDiagnostics implementation is absent from current source.

Review checklist

  • Conventional Commit title and linked issues.
  • Production ASAR boundary and meaningful analysis regressions covered.
  • No generated contracts or installation changes required.
  • Native Windows coverage added; local platform limitation stated.
  • Diff checked for unrelated changes and secrets.

@morluto
morluto merged commit 28e0f4e into main Oct 5, 2026
@morluto
morluto deleted the fix/javascript-archive-boundaries branch October 5, 2026 15:19
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the area: evidence Evidence, artifacts, and reconstruction label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

1 participant