[PR #3104] [MERGED] fix(electron): preserve selected fuse inspection paths #5619

Closed
opened 2026-10-31 01:08:01 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3104
Author: @shoyann
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/electron-fuse-cli-path


📝 Commits (3)

  • 852325e fix(electron): preserve selected fuse inspection paths
  • 447682e chore(electron): integrate selected-path fix with current main
  • 7566a8e chore(electron): synchronize verification with latest main

📊 Changes

5 files changed (+304 additions, -29 deletions)

View changed files

📝 docs/electron-fuses.md (+5 -0)
📝 src/cli/electronCommands.ts (+12 -2)
📝 src/electron/ElectronFusePath.ts (+61 -15)
📝 src/electron/ElectronFuseProvider.test.ts (+17 -0)
📝 tests/acceptance/electronFusesCli.test.ts (+209 -12)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3104 **Author:** [@shoyann](https://github.com/shoyann) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/electron-fuse-cli-path` --- ### 📝 Commits (3) - [`852325e`](https://github.com/morluto/rea/commit/852325ee11747e365409d95a79a0196d06ab3098) fix(electron): preserve selected fuse inspection paths - [`447682e`](https://github.com/morluto/rea/commit/447682e131ccc0bc85b81c9d988f67cbb07c78bf) chore(electron): integrate selected-path fix with current main - [`7566a8e`](https://github.com/morluto/rea/commit/7566a8e28ef2594e30b31d74992ddab12de40831) chore(electron): synchronize verification with latest main ### 📊 Changes **5 files changed** (+304 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `docs/electron-fuses.md` (+5 -0) 📝 `src/cli/electronCommands.ts` (+12 -2) 📝 `src/electron/ElectronFusePath.ts` (+61 -15) 📝 `src/electron/ElectronFuseProvider.test.ts` (+17 -0) 📝 `tests/acceptance/electronFusesCli.test.ts` (+209 -12) </details> ### 📄 Description ## 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](https://github.com/morluto/rea/pull/2399#discussion_r4260613048). ## 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: - [x] 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: - [x] Observations and derived fuse implications remain distinguishable. - [x] Artifact identity and source provenance remain preserved. - [x] 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 - [x] This PR addresses a concrete problem within existing scope. - [x] The PR has one focused outcome and a Conventional Commit title. - [x] The reason for not linking an issue is stated above. - [x] Regression coverage checks observable artifact selection and failure paths. - [x] Owning documentation describes path behavior; public schemas and generated metadata are unchanged. - [x] Representative CLI and filesystem evidence is included. - [x] Final diff and validation reviewed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5619
No description provided.