Repository navigation
fix(javascript): stop reading media preload attributes as Electron preloads - #1393
Conversation
The cross-format oracle requires a callee whose recovered control flow has more than one basic block, and rea_cross_branch provided it through a symmetric if/else of tail calls. Clang 21 folds that shape into a conditional negate plus one tail branch, a single basic block, so the lane rejected a correct Ghidra analysis of the fixture. Give the branch a loop whose trip count depends on a volatile global: no compiler can eliminate the backedge, and the callee stays multi-block at every optimization level on every toolchain.
The failed shard is the JavaScriptSemanticGraphBuilder short-circuit mutation test, which also failed on main run 38003459598 at the same base commit (08ec2bf) before this branch started CI, and passed on main run 38003459600 minutes later at the same commit.
b8a8190 restored the guarded-mutation uncertainty the failing test encodes, so the shard should pass against the new merge base.
Electron recognition matched callee spellings, so a bundler rename such as
esbuild's `import { ipcMain as ipcMain2 } from "electron"`, or a destructured
`const { contextBridge: bridge } = require("electron")`, hid every IPC
handler, BrowserWindow, contextBridge and utility process behind it.
Resolve each call and construction root lexically to its Electron import or
require origin, and classify the callee under that export's name. Shadowed
locals keep their own meaning.
On Hermes Desktop v0.21.6, whose main process is one esbuild ESM bundle,
recognized main IPC handlers rise from 1 to 204, BrowserWindow constructions
from 0 to 11, and paired renderer transmissions from 1 to 201.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XPY2GmufMNGQKoEgRUx1pd
…eloads
HTML audio and video elements have their own `preload` attribute ("none",
"metadata", "auto"). A React renderer compiles `<audio preload="metadata">`
to `jsx("audio", { preload: "metadata" })`, and the `property:preload`
heuristic reported it as an Electron preload script named `metadata`.
Skip `preload` properties in the props object of a call whose first
argument is the static tag `audio` or `video`. The callee is not checked,
because minified element factories have arbitrary names.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XPY2GmufMNGQKoEgRUx1pd
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
* fix(javascript): handle oversized inline source maps * fix(javascript): avoid source map directive regex overflow
…orluto#1395) Incur's `alias` map registers one-letter short flags and already accepts kebab-case spellings of camelCase options. Twenty options registered their kebab-case long name as an "alias", so help and completions advertised flags such as `-case-sensitive` and `-relative-path` that the parser reads as stacked short flags and rejects with "Unknown flag: -c". Co-authored-by: Claude Opus 5.5 <[email protected]>
…luto#1396) trace_web_module_imports and trace_web_source_location reported a missing or non-file manifest, source map or import map as artifact_operation_failed ("Artifact could not be read or written" / "unsafe or conflicting internal path"). These are caller selections: report ENOENT/ENOTDIR and non-regular files as invalid input on the selected field, and EACCES/EPERM as a host access denial. A missing manifest-derived source file stays an artifact fault. Co-authored-by: Claude Opus 5.5 <[email protected]>
morluto#1397) compare-web-captures and compare-web-screenshots parsed their arguments as inline JSON only, unlike every other JSON-input command. Screenshot artifacts and scenario captures embed base64 PNG bytes, so a typical viewport screenshot exceeds the command-line length limit (128 KiB per argument on Linux, 1 MiB total on macOS) and could not be compared from the CLI at all, while MCP accepts it. A file path was reported as malformed JSON, and screenshot schema failures returned no issues. Each argument now accepts inline JSON or a JSON file path through parseCliJsonInput; file failures keep its path diagnostics, malformed inline JSON keeps the field issue, and screenshot validation reports projected schema issues. The tests share one CLI JSON process fixture. Co-authored-by: Claude Opus 5.5 <[email protected]>
|
TL;DR: This fix works for me on Linux. Audio and video tags no longer make fake preloads. Real preloads still show up. Your test passes on Node 22, 24 and 26. I tested head Your testI ran
I also put your test file on top of Real JSX, real compilerI wrote a small JSX file with three tags. It has I compiled it with rolldown 1.2.12 twice. One build is plain ESM with
On 6.3.0, A real appI used a copy of the Beyond All Reason launcher (launcher code MIT; Flathub package GPL-2.0-or-later). It has no audio or video tags. So the bug shape is not in it. I ran it on Node 22. It has 0 preload nodes before and after. Node ids, summary and stats match 6.3.0. So there is no regression here. Edit: I ran some of these on main at 40f73f6 (#3735). Results are in my new comment. Still not run: the full test suite and Hermes Desktop. Not run
Thanks, marnixpluim. Test setup
🤖 Generated with Claude Code (Opus 5.5) 🦊 |
…uto#1402) createAnalysisExecution defaulted an omitted rawResult to a second complete copy of the result. Every caller that had no distinct provider representation therefore doubled its Evidence: decode_interface_builder, inspect_keyed_archive, inspect_asset_catalog, trace_dylib_resolution, inspect_native_dispatch_metadata, observe_native_calls, observe_native_ui/capture_native_ui_scenario (including screenshots), and small Ghidra/IDA lifecycle records. Sibling operations of the same providers already recorded null. An omitted rawResult now records null. Normalized results are unchanged. MCP responses repeat Evidence in text and structured content, so each response and its share of the 10 MiB transport budget shrink by the same half; e.g. trace_dylib_resolution on a real app bundle drops from 3,217,119 to 1,612,524 bytes per representation. Co-authored-by: Claude Opus 5.5 <[email protected]>
…luto#1404) inspect_binary_layout and inspect_recorded_crash passed the decoded report as both result and rawResult, so every Evidence record carried the whole report twice (and an MCP response four times, counting its text copy). The decoded report is the only representation, so raw_result is now null, as for other single-representation operations. The real pwntools verifiers asserted the duplicate; they now assert null. Co-authored-by: Claude Opus 5.5 <[email protected]>
HopperProvider passed the bridge reply as rawResult and, for every operation except address_to_file_offset, the same object as the result. Every Hopper Evidence record (decompilation, procedure and string listings, xrefs, ...) therefore carried its complete result twice, and an MCP response four times counting its text copy. raw_result is now null unless REA transformed the reply, which only the file-offset mapping does; that case keeps Hopper's original reply. Co-authored-by: Claude Opus 5.5 <[email protected]>
…to#1407) Commit literal values with canonical JSON SHA-256 in semantic role keys and use a type label for strings. Preserve complete values, provenance and literal queries while avoiding two payload copies in each string node. Verify real compiled CLI/default stdio MCP, typed union seeds, empty strings and trace continuation with a large source-owned fixture. Refs morluto#723 BREAKING CHANGE: Newly produced semantic literal node IDs use value-sha256 role keys, and string labels read "string literal". Read exact values from properties.value and obtain node IDs from the selected parent graph. Previously stored Evidence and its original IDs remain valid.
…1413) `--json` / `--format json` always indented its streamed result. Agents and scripts read REA through pipes and redirects, where indentation carries no information: on real application results it added 16-45% model tokens (o200k proxy) and 25-73% bytes. The skill's CLI fallback uses `--json`. Indent only when stdout is a TTY, as `gh --json` does; piped or redirected JSON is compact. The JSON value, `jsonl`, `--filter-output`, `--full-output` and the token-window paths are unchanged. `jq .` restores indentation for files. Co-authored-by: Claude Opus 5.5 <[email protected]>
Reduce repeated semantic relation and unknown family scans while preserving exact complete Evidence and coverage.
…rluto#1423) Keep exact endpoint observations and request properties while using compact display labels and collision-safe canonical value digests for long artifact-local endpoint keys. Verify real CLI/stdio MCP tracing and version comparison without truncating evidence. BREAKING CHANGE: New analyses use compact endpoint labels and digest-based IDs for long or reserved-prefix endpoint keys. Select IDs from the parent graph and read full values from endpoint properties. Previously stored graphs retain their original identities and remain valid workflow inputs.
Fixes morluto#1401. Refs morluto#1065. Preserve exact member facts and equal-depth write effects while bounding the observed reassignment-loop expansion. Validated with the JavaScript semantic/application suite, focused alias regressions, full static checks, real compiled CLI and SDK MCP Notion workflows, and all 20 checks on the final PR head. Co-Authored-By: Marnix Pluim <[email protected]> Co-Authored-By: N0zoM1z0 <[email protected]> Co-Authored-By: Claude <[email protected]>
Preserve actionable field paths and schema-declared variants for unknown or missing discriminators. Closes morluto#1421. Refs morluto#1065.
…d views Add caller-selected native dossier facets with preserved Evidence identity, provenance, unknowns and transport recovery. Refs morluto#1247 and morluto#1065. Co-authored-by: jhuang-tw <[email protected]> Co-authored-by: N0zoM1z0 <[email protected]>
…to#1427) Share the canonical string identity rule with endpoint projection, scope event keys to each emitter, and keep complete event/listener names in properties. Verify real CLI and stdio MCP with large names, registration/removal, distinct emitters, exact name seeds, reserved-prefix values, and unresolved dynamic names. BREAKING CHANGE: New analyses use digest-based IDs for long or reserved-prefix event names and shorter event/listener display labels. Select IDs from the parent graph and read exact names from event_name properties. Stored graphs and their original IDs remain accepted for semantic tracing.
Use the shared AST child enumeration with an explicit stack, preserving return order and nested callable boundaries. Refs morluto#1065. Co-authored-by: rudycelekli <[email protected]> Co-authored-by: N0zoM1z0 <[email protected]>
…orluto#1430) inspect_macho, inspect_signature, inspect_plist, list_architectures and demangle_swift already return their command provenance inside the normalized result. The provider also copied the same array into raw_result, so every response carried it twice. raw_result now stays null, as docs/mcp-contracts.md describes for results without a distinct provider representation. Co-authored-by: Claude Opus 5.5 <[email protected]>
…orluto#1429) The skill's CLI fallback printed the complete application Evidence to stdout. A real ASAR produces hundreds of megabytes (334 MB for Obsidian), which an agent then reads into its context. Save the Evidence to a file and project a summary or module page with inspect-analysis-view instead. Co-authored-by: Claude Opus 5.5 <[email protected]>
…1433) Advertise content- and dialect-bound identities for self-contained output schemas so the SDK can reuse unchanged Ajv validators after complete tools/list refreshes. Preserve explicit IDs and relative reference bases. Verify changed schemas, availability transitions, reconnects, numeric and selector constraints, explicit IDs, relative references, and advertised dialects through the pinned SDK boundaries. Refs morluto#1065, morluto#723
* docs: add Italian (it) README translation Adds README_it.md (full Italian translation of the English README) and updates the language nav bar in all existing READMEs to include the new [Italiano] link, appended at the end of the bar (after Bahasa Indonesia) to match the repository's convention for adding new languages. Rebuilt on top of current main to resolve the merge conflict caused by the recently added Bahasa Indonesia (README_id.md) translation. Closes morluto#1453 * docs: fix Italian README showcase anchors --------- Co-authored-by: morluto <[email protected]>
Signed-off-by: Rudy Celekli <[email protected]>
Inventory gave nested members a ZIP or ASAR family from their path suffix. Byte classification replaced it only for ZIP magic, so text named `.apk` or `.asar` stayed a container, and encrypted entries and symlinks kept the suffix guess. A filesystem `.asar` without an ASAR header failed the whole inventory as a malformed archive. Nested ZIP families now follow ZIP magic and ASAR follows its header pickle, shared with root classification. An unread member named like a container has an unknown format and a limitation naming the suffix. ASAR expansion requires the header. The Android projection adds a limitation when no root AndroidManifest.xml was observed, and its rejection names the observed root format. Fixes morluto#1491 Co-authored-by: Claude Opus 5.5 <[email protected]>
…ubpaths (morluto#1424) * fix(javascript): resolve exact package export subpaths Bare module specifiers with subpaths now resolve against the selected package's exports map instead of staying external. An exact subpath key selects its target through the existing condition, array, and null semantics, and the selected target resolves as one exact file with no extension or index fallback. A declared exports map encapsulates every other subpath lookup, and packages without an exports map keep legacy file and directory-index resolution. Package-private import aliases remain external pending a separate increment (morluto#1365). Verification: npm run check:fast; focused and full src/application/javascript source tests on Windows; verify:test-discovery; docs:check. Four pre-existing failures in JavaScriptFileUrlPaths and JavaScriptModuleSpecifierPaths reproduce on unmodified main on Windows because their fixtures write file names containing '?'. * fix(javascript): unify package path resolution --------- Co-authored-by: morluto <[email protected]>
…o#1422) - EVM bytecode and recorded crashes: state the Linux x64 host requirement. `EvmoleInterfaceProvider` and `PwntoolsDecoder` refuse every other host with `capability_unavailable`, but only the neighbouring offline ELF layout row said so. - Translations: Android analysis has supported Windows x64 since 6.2.0 (morluto#1276), which updated only the English table; 16 translations still said Linux/macOS. Translated cells reuse each README's own wording: the recorded-crash cell copies that file's ELF-row pwntools phrase, and the EVM and Android cells follow the construction the same table already uses for host platforms. Co-authored-by: Claude Opus 5.5 <[email protected]>
…morluto#1420) - CONTRIBUTING: CLI logs go to stderr, not stdout. `createLogger` writes every mode to fd 2 so protocol and `--json` stdout stay parseable. - Get started: Ghidra supports Linux arm64 (`GhidraInstallation` maps `linux.arm64`), as installation.md already states. - Browser guide: drop the caption claiming the hosted request path carries a `/rea/` prefix. The guide now targets rea.tools, where the example is served at `/examples/notes-web/`, as the evidence table above it shows. - JavaScript workflows: six CLI commands accept inline JSON or a JSON file, not five; `inspect-analysis-view` was added after the sentence was written. Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: morluto <[email protected]>
`HOPPER_LAUNCHER_PATH` availability was decided by an `X_OK` access check alone, which a searchable directory also passes. Pointing it at the `Hopper Disassembler.app` bundle instead of its launcher made `rea providers` report Hopper as available and `rea doctor` report it healthy, while analysis then failed with an unrelated `version_unresolved` rejection. Require a regular file in both the provider availability probe and the doctor executable probe, matching the Ghidra launcher check. A directory now reports `executable_missing`, and doctor reports `config_drift` with its existing HOPPER_LAUNCHER_PATH remediation. Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: N0zoM1z0 <[email protected]>
…rluto#1481) On macOS the default workspace root is os.tmpdir() under /var/folders, and /var is a symlink to /private/var. idalib-mcp reports the canonical input path from idb_open/idb_list, while REA compared it against the uncanonicalized private copy with normalize(), so every headless IDA analysis failed its identity check (surfacing as unreadable_output) and the spawned idalib worker was never released. Resolve the workspace root with realpath() when allocating the private workspace so the input path REA sends already matches what upstream reports. Co-authored-by: Xingchuan Ma <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: morluto <[email protected]>
|
I am reviewing this contribution against current main |
|
Merged by SHA-guarded rebase after all 20 exact-head CI checks succeeded on I freshly rebuilt merged main Full CLI reply: 69,582 -> 57,910 bytes; full MCP reply: 145,962 -> 121,490 bytes, unchanged after merging. These are this fixture's bytes, not billed-token or general throughput estimates. 65 relevant tests and all local gates passed without skips. This Linux static probe does not establish native Electron runtime or macOS/Windows behavior. Separately bound props/dynamic tags remain outside the syntax heuristic. The completed worktree and build are removed normally; source branches, inputs, complete results and proof/failure receipts remain. |
|
TL;DR: The fix is still in main. The full lint, type and format checks pass on main, and so does the media-tag test on Node 22, 24 and 26. A second real app has no preloads, and its counts match on all three Nodes. The full test suite and Hermes Desktop are still not run. This pull request merged as 649661d (#1393) on 2026-10-10. This comment is a record. It runs the items from my first comment that I had not run. I ran them on main at 40f73f6 (#3735). Checks on main
The test file has 20 tests now. It had 4 when I first tested. It still holds the audio and video case: I did not count the 1,469 oxlint warnings on any older commit. The launcher on Node 24 and 26I ran a different build than before. My first copy came from Flathub. This one is the Beyond All Reason launcher AppImage, version 1.2988.0, from 2024-03-02. The REA refused it at first. It found a symlink in
The artifact hash and the inventory graph hash are the same on every Node. The module count (90), the parsed files (1,533) and the visited AST nodes (1,344,646) are the same too. The findings count is not the same. It was 5,678, 5,682 and 5,687 on Node 22, 24 and 26. I then ran Node 24 a second time. It gave 5,679, against 5,682 on its first run. So the count moves between runs on one Node. It does not follow the Node version. The lists of limits differ in the same way. Each run reports a different set of files that "exceed the parent's remaining result budget". I did not look for the cause. This app has no audio or video tags, as before. So it shows no regression, not a fix. Not run
Thanks, marnixpluim and N0zoM1z0, for the fix and the quick merge. Commandsgit -C rea.git archive 40f73f62b | tar -x -C main
npm ci && npm run build && npm run test:prepare # Node 24
node scripts/run-development-tests.mjs focused \
src/domain/javascript/electronStaticAnalysisOptions.test.ts # Node 22, 24, 26
npm run typecheck && npm run lint:details && npm run format:check
npm run check
gh release download v1.2988.0 -R beyond-all-reason/BYAR-Chobby -p '*.AppImage' # sha256 6495b905dc71ab2accd932533b4481a78057b7720bca2efb119c7bdd7f21a891
unsquashfs -o 188392 -d root Beyond-All-Reason-1.2988.0.AppImage
rm root/resources/app.asar.unpacked/node_modules/register-scheme/build/node_gyp_bins/python3
node scripts/rea.mjs analyze-javascript-application root/resources/app.asar --format jsonI checked each test file for Test setup
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
Audio/video loading hints were reported as Electron preload scripts. For example,
jsx("audio", {preload: "metadata"})created an unresolvedelectron-preloadnode formetadata. This change excludes preload properties in the inline props object of a call with the static first argumentaudioorvideo; webview and independent preload options retain their evidence.The callee is deliberately unrestricted to cover minified element factories. This remains a syntax heuristic: separately bound props and dynamic tag expressions are outside this change. CLI/MCP schemas and the default Evidence representation are unchanged.
Validation against current main
2d426c92and integrated head19a770a7:Independent maintainer verification uses Linux and Node 24.18.0; no native Electron runtime, macOS or Windows claim is made. The contributor's original packaged-app report and the other reviewer's compiler/app checks remain separately documented in this PR's history. Related maintenance/output work: #1065 and #723. No separate duplicate issue is needed for this existing contribution.