[PR #3603] [CLOSED] fix(cutter): expand ~ and ignore empty REA_CUTTER_BRIDGE_DIR #5850

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3603
Author: @sathariels
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/cutter-bridge-dir-tilde


📝 Commits (2)

  • bcaf4bc fix(cutter): expand ~ and ignore empty REA_CUTTER_BRIDGE_DIR
  • 8310048 Merge remote-tracking branch 'origin/main' into sweep/3603

📊 Changes

2 files changed (+23 additions, -5 deletions)

View changed files

📝 src/cutter/CutterBridgeClient.ts (+3 -5)
📝 tests/boundary/providers/CutterBridgeClient.test.ts (+20 -0)

📄 Description

Summary

Fixes #3183. When REA_CUTTER_BRIDGE_DIR was set to ~/... or to an empty string, CutterBridgeClient used it as given (configured ?? default), so it looked in a literal ~ folder or the current directory and live Cutter sessions disappeared. The Python bridge (bridge/cutter/rea_bridge.py) already expands ~ and treats an empty value as unset, so the two sides disagreed about where the bridge directory was.

Problem and expected behavior

Smallest trigger: REA_CUTTER_BRIDGE_DIR='~/rea-bridge' (quoted, so the shell doesn't expand it) or REA_CUTTER_BRIDGE_DIR=''. The Cutter plugin writes sessions under the expanded or default directory, but the TS client reads from ~/rea-bridge relative to the working directory, or from '', and reports no sessions. Expected behavior: the client resolves the same directory as the Python bridge.

Change and scope

In src/cutter/CutterBridgeClient.ts, the configured value is resolved like this:

  • A leading ~ or ~/... expands to the home directory.
  • An empty or whitespace-only value is treated as unset, so the platform default is used.
  • Any other path is unchanged.

Not included: other environment variables, ~user expansion, and any change to the Python bridge.

Contribution scope: an ordinary fix within existing boundaries, so no maintainer scope decision is needed.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/cutter/CutterBridgeClient.ts, when it resolves the bridge directory.
  • Contribution scope fit and linked maintainer decision: ordinary bug fix; not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: the TS client now matches the Python Cutter bridge's resolution. Paths that were already valid are unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata, package, or installation 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

  • Tests added or updated: CutterBridgeClient tests for ~, ~/x, "", whitespace-only, and a normal absolute path.
  • Base reproduction or other evidence: executed. On the old resolver, the ~ case returned ~, ~/x returned ~/x, "" returned an empty string, and whitespace was kept, so all four failed. The normal path /var/tmp/rea-cutter-bridge already passed. With the fix, all five pass.
  • User-visible CLI/MCP output (if applicable): not applicable. Only directory resolution changes.
  • Remaining proof gaps: no live Cutter session was run end to end, and macOS/Windows home-directory resolution wasn't run locally.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run check:fast — passed (typecheck and lint).
  • Focused Cutter tests (CutterBridgeClient, CutterBridgeCapacity, CutterBridgeNullIdentity, cutterBridgeProducer, cutterCommands, cutterMcp) — passed, 47 tests.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Setups that used ~ or an empty value were already broken. Explicit paths behave the same.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux only, and no live Cutter run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none. No new process, network, or file authority.

Author readiness

Human owner: @sathariels

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/3603 **Author:** [@sathariels](https://github.com/sathariels) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/cutter-bridge-dir-tilde` --- ### 📝 Commits (2) - [`bcaf4bc`](https://github.com/morluto/rea/commit/bcaf4bcc953e5b6a665f9222f893cbd430c25cfe) fix(cutter): expand ~ and ignore empty REA_CUTTER_BRIDGE_DIR - [`8310048`](https://github.com/morluto/rea/commit/8310048a49435dc15b1c5023cc8d75fccc2f877b) Merge remote-tracking branch 'origin/main' into sweep/3603 ### 📊 Changes **2 files changed** (+23 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/cutter/CutterBridgeClient.ts` (+3 -5) 📝 `tests/boundary/providers/CutterBridgeClient.test.ts` (+20 -0) </details> ### 📄 Description <!-- PR title: fix(cutter): expand ~ and ignore empty REA_CUTTER_BRIDGE_DIR --> ## Summary Fixes #3183. When `REA_CUTTER_BRIDGE_DIR` was set to `~/...` or to an empty string, `CutterBridgeClient` used it as given (`configured ?? default`), so it looked in a literal `~` folder or the current directory and live Cutter sessions disappeared. The Python bridge (`bridge/cutter/rea_bridge.py`) already expands `~` and treats an empty value as unset, so the two sides disagreed about where the bridge directory was. ## Problem and expected behavior Smallest trigger: `REA_CUTTER_BRIDGE_DIR='~/rea-bridge'` (quoted, so the shell doesn't expand it) or `REA_CUTTER_BRIDGE_DIR=''`. The Cutter plugin writes sessions under the expanded or default directory, but the TS client reads from `~/rea-bridge` relative to the working directory, or from `''`, and reports no sessions. Expected behavior: the client resolves the same directory as the Python bridge. ## Change and scope In `src/cutter/CutterBridgeClient.ts`, the configured value is resolved like this: - A leading `~` or `~/...` expands to the home directory. - An empty or whitespace-only value is treated as unset, so the platform default is used. - Any other path is unchanged. Not included: other environment variables, `~user` expansion, and any change to the Python bridge. Contribution scope: an ordinary fix within existing boundaries, so no maintainer scope decision is needed. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/cutter/CutterBridgeClient.ts`, when it resolves the bridge directory. - Contribution scope fit and linked maintainer decision: ordinary bug fix; not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: the TS client now matches the Python Cutter bridge's resolution. Paths that were already valid are unchanged. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata, package, or installation 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 - Tests added or updated: `CutterBridgeClient` tests for `~`, `~/x`, `""`, whitespace-only, and a normal absolute path. - Base reproduction or other evidence: executed. On the old resolver, the `~` case returned `~`, `~/x` returned `~/x`, `""` returned an empty string, and whitespace was kept, so all four failed. The normal path `/var/tmp/rea-cutter-bridge` already passed. With the fix, all five pass. - User-visible CLI/MCP output (if applicable): not applicable. Only directory resolution changes. - Remaining proof gaps: no live Cutter session was run end to end, and macOS/Windows home-directory resolution wasn't run locally. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run check:fast` — passed (typecheck and lint). - Focused Cutter tests (`CutterBridgeClient`, `CutterBridgeCapacity`, `CutterBridgeNullIdentity`, `cutterBridgeProducer`, `cutterCommands`, `cutterMcp`) — passed, 47 tests. ## Compatibility, safety, and release - Breaking changes or migration steps: none. Setups that used `~` or an empty value were already broken. Explicit paths behave the same. - Real Hopper/Ghidra, browser, or OS coverage: Linux only, and no live Cutter run. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. No new process, network, or file authority. ## Author readiness Human owner: @sathariels - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:09:54 +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#5850
No description provided.