Skip to content

fix(electron): preserve selected fuse inspection paths - #3104

Merged
N0zoM1z0 merged 3 commits into
morluto:mainfrom
shoyann:fix/electron-fuse-cli-path
Oct 14, 2026
Merged

N0zoM1z0 merged 3 commits into
morluto:mainfrom
shoyann:fix/electron-fuse-cli-path

Conversation

@shoyann

@shoyann shoyann commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

inspect-electron-fuses could successfully report a digest and fuse states for the wrong executable. On POSIX, a selected path containing Current/../ follows the symlink before its parent component; the CLI's path.resolve() instead removed those components lexically. Preserve the selected filesystem target through the CLI and the Electron bundle path owner.

No separate issue: this is a directly reproduced follow-up to the accepted path-preservation correction in #2399.

Problem and expected behavior

With Versions/Current -> nested/B, selecting Versions/Current/../A/Electron Framework means Versions/nested/A/Electron Framework. The CLI inspected Versions/A/Electron Framework instead. Two synthetic files with opposing fuse states demonstrated both a different SHA-256 and opposite reported implications.

The same problem affected an application selected through Current/../Fixture.app: correcting the CLI alone was insufficient because subsequent provider join() calls collapsed the selected parent path again.

Expected: inspect the caller-selected file, keep its selection in Evidence, and preserve existing bundle admission and identity checks.

Change and scope

  • Anchor relative POSIX inputs without normalizing their components. Keep Windows CLI resolution unchanged because Win32 uses different dot-component semantics.
  • Append known child components without reinterpreting the selected parent inside the Electron path owner.
  • Preserve ordinary directory selections ending in . or .. using filesystem checks, retaining checked directory identities for readback validation. Refuse ambiguous terminal parent traversal through a symlink instead of silently selecting a lexical sibling.

This is an ordinary correctness fix in existing read-only fuse inspection; a new capability scope decision is not applicable. No target is launched and no fuse is changed.

Contract and boundary impact

  • Semantic owner: CLI input anchoring and ElectronFusePath filesystem traversal.
  • CLI/MCP contract: existing command/tool and schemas unchanged; provider correction also applies to shared-service callers.
  • Platform compatibility: POSIX link/parent semantics are preserved; Windows keeps its existing CLI resolution.
  • Evidence/provenance: selected path, inspected bytes, digest and derived fuse implications refer to the same artifact.
  • Authority/cleanup: existing filesystem admission and identity rechecks remain; no execution or mutation authority is added.
  • Generated metadata/package impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Public CLI regressions cover absolute and relative binary/application paths with a symlink before .., using distinct expected and decoy files. Assertions check selected and resolved paths, Evidence digest and fuse implications; direct-file controls verify the opposing fixture.
  • Directory selection controls cover trailing/current/parent components and preserve symlink rejection.
  • Base reproduction: all four new wrong-file cases failed on b3c5672c. A CLI-only patch fixed the binary pair but left the application pair failing, demonstrating why the owning traversal also needs correction.
  • An independent native Windows filesystem probe (Node 24.16.0, NTFS junction and two harmless marker files) confirmed that Win32 reads the lexical sibling for link/../. Repository checks use pinned Node 24.18.0 in WSL Ubuntu.
  • Remaining proof gaps: no native Windows/macOS REA run and no actual Electron application execution. Tests inspect synthetic files through the real CLI/provider; runtime behavior is not claimed.

For evidence-bearing changes:

  • Observations and derived fuse implications remain distinguishable.
  • Artifact identity and source provenance remain preserved.
  • Unsupported and unverified outcomes remain explicit.

Validation performed

  • npm run test:focused -- tests/acceptance/electronFusesCli.test.ts src/electron/ElectronFuseProvider.test.ts tests/boundary/mcp/electronFusesMcp.test.ts src/domain/electron/electronFuses.test.ts: 41 passed, one Windows-only CLI test skipped on Linux; four files passed.
  • npm run check: passed, including six static tasks and architecture guards.
  • npm run verify:test-discovery: passed, 1,242 test files.
  • npm run docs:check: passed, including five README consistency tests.
  • git diff --check: passed.

Compatibility, safety, and release

No new dependency, public schema, release metadata or target-execution capability. No binary mutation. Terminal symlink/parent directory selections that cannot be reduced while preserving admission are rejected with the existing typed input-error shape. Verification used owned synthetic files on Linux and a separate native Windows filesystem probe.

Before merge

  • This PR addresses a concrete problem within existing scope.
  • The PR has one focused outcome and a Conventional Commit title.
  • The reason for not linking an issue is stated above.
  • Regression coverage checks observable artifact selection and failure paths.
  • Owning documentation describes path behavior; public schemas and generated metadata are unchanged.
  • Representative CLI and filesystem evidence is included.
  • Final diff and validation reviewed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

Preserves the caller-selected executable when a POSIX path contains a symlink before ...

  • Fuse inspection follows the file named by the selected path.

Reviews (2) · Last reviewed commit: "chore(electron): synchronize verificatio..." · Reviewed by Greptile

N0zoM1z0 and others added 2 commits October 14, 2026 04:33
Include the merged main regression fixes for current-head CI while preserving
PR morluto#3104's focused five-file path correction.

Validation: six new acceptance failures reproduced on main 7ad75bd; 41 focused
source/CLI/MCP tests pass with one Windows-only skip. Full static and docs checks
pass. SHA-verified Electron v44.7.1 ELF, PE, and Mach-O files reproduce wrong-file
selection on main and correct selection after the fix through public CLI and
stdio MCP. CLI/MCP normalized results and subjects match; owned servers exit.
Native Windows/macOS REA execution is not claimed.

Co-authored-by: Kaoru0822 <[email protected]>
Include the new worker-cleanup and README test maintenance before current-head
CI. The Electron production correction remains the independently verified tree.

Co-authored-by: Kaoru0822 <[email protected]>
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Independent maintainer verification is complete. The branch now includes main 767fe0f0c at head 7566a8e28; its Electron production code is identical to the locally tested 104dfbf6e tree.

  • Added acceptance regressions reproduce six failures on clean main 7ad75bdc8, including all four absolute/relative binary/bundle wrong-file cases. The integrated fix passes 41 source/CLI/MCP tests across four files, with one explicitly Windows-only test skipped on Linux. Full npm run check, npm run docs:check, and the final main-sync check:fast pass.
  • Reviewed both producing boundaries: CLI anchoring and bundle child traversal. Directory suffix reduction retains the identities of removed components; readback still checks them before and after the streamed scan. Existing malformed/unknown states, contained-link admission, directory-replacement rejection, and cancellation remain covered.
  • Real artifacts: Electron v44.7.1 Linux ELF (228,506,952 bytes), Windows PE (245,487,104 bytes), and macOS arm64 framework (202,912,368 bytes). All archives were checked against a newly downloaded official release manifest; extracted executable hashes and sentinel offsets/version/length/raw bytes were independently checked against the archive and an mmap scan.
  • Using those distinct actual executables as target and decoy, the public CLI on main reads the wrong PE file for both symlink/parent selections. The fix reads the selected ELF/framework digest. Public stdio MCP independently reproduces main's wrong bundle selection; fixed CLI/MCP normalized results and subjects exactly match. Both owned server processes exited, verified by process birth identity.
  • Equivalent direct-file main/fixed cold/warm runs return identical complete output sizes: 1,027 o200k tokens (ELF), 963 (PE), 1,054 (Mach-O), about 3.5–3.9 KiB. Initial end-to-end wall times range 3.82–6.29 s, CPU 4.41–6.95 s, sampled family RSS 412–450 MiB. A PE alternating warm control took main 2.89/2.93 s versus fixed 3.02/3.16 s (CPU 3.13/2.96 versus 3.54/3.64 s). These individual trials include startup and show variability; no speedup, statistical equivalence, or whole-agent token reduction is claimed. Cold/warm refers to isolated Node compile caches, with the OS filesystem cache retained.

All heavy local work used two CPUs and an 8-GiB sampled process-family threshold; the largest measured family was about 4.2 GiB and no stop occurred. No target application was executed. Parsing PE/Mach-O bytes on Linux does not establish native Windows/macOS REA behavior. Current-head CI and review remain the merge gate.

@N0zoM1z0
N0zoM1z0 merged commit ec67aeb into morluto:main Oct 14, 2026
32 checks passed
@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 provider: electron Analysis provider / engine: electron label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working provider: electron Analysis provider / engine: electron

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants