[PR #6410] fix(tests): make two Windows-failing tests pass and give the Ghidra transport one owner #7339

Open
opened 2026-11-01 21:47:10 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6410
Author: @agnaylor
Created: 10/22/2026
Status: 🔄 Open

Base: main ← Head: pr/windows-test-fixes


📝 Commits (3)

📊 Changes

5 files changed (+156 additions, -133 deletions)

View changed files

📝 src/ghidra/GhidraClient.ts (+4 -1)
📝 src/ghidra/GhidraProviderClient.ts (+2 -4)
📝 src/ghidra/GhidraTransport.ts (+10 -0)
📝 tests/boundary/mcp/ghidraInventoryMcp.test.ts (+137 -127)
📝 tests/boundary/mcp/serverIdentity.test.ts (+3 -1)

📄 Description

Summary

Three tests failed on a Windows source checkout before any change. The first, src/config.test.ts (the Linux Hopper launcher candidate built with the host's path.join), has since been fixed upstream by #5235 and is no longer part of this branch. The two that remain:

  1. tests/boundary/mcp/serverIdentity.test.ts: the "aligned" case compared a raw /packaged/rea.mjs against resolve() of the same string, which differ on Windows. The test now passes its command path through normalizeEntrypointPath, as production does.
  2. tests/boundary/mcp/ghidraInventoryMcp.test.ts: the fake Ghidra bridge publishes a Unix socket, or renames a pending TCP endpoint file into place; under the Windows temp directory the first fails with EACCES and the second with EBUSY. The test is skipped on win32 with that reason in a comment; Windows Ghidra is verified by verify:ghidra:windows against a real installation.

While fixing the third, the platform-to-transport decision that lived twice (GhidraClient defaulted to unix-socket regardless of platform; GhidraProviderClient had a win32 ternary) got one owner: defaultGhidraTransport in GhidraTransport.ts.

Problem and expected behavior

Trigger: npm run test:focused on the three files on Windows 11. Expected: the Linux and identity tests pass on every host; the fixture-bound test states why it cannot run on Windows instead of failing.

Change and scope

Files: src/ghidra/GhidraTransport.ts, src/ghidra/GhidraClient.ts, src/ghidra/GhidraProviderClient.ts, and the two tests. No behavior change on Linux or macOS: the transport owner returns the same values the two sites produced before. Not included: 15 further src/ghidra unit tests and two ghidraStartupCancellationMcp timeouts that also fail on Windows; they are recorded, not fixed here.

No issue is linked; none was found for these failures.

Contract and boundary impact

  • Semantic owner and earliest changed stage: GhidraTransport.ts now owns the transport choice; the two tests own their own fixtures.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: Ghidra bridge transport selection is unchanged in value per platform.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

  • Tests: the three files report 100 passed and 1 skipped on Windows 11 after the change, re-run after merging upstream main 4c680d099 (upstream has added tests to these files since the branch was cut); on the original base revision the same files reported three failures (backslashed Hopper path, since fixed upstream; registration_path_mismatch; and the EACCES launch failure of the fake bridge).
  • Remaining proof gaps: no Linux or macOS run of this branch; the skipped fixture test is not ported to Windows, only guarded.

Validation performed

  • npm run test:focused -- src/config.test.ts tests/boundary/mcp/serverIdentity.test.ts tests/boundary/mcp/ghidraInventoryMcp.test.ts on Windows 11 (Ales), Node 24.22.1 with a fresh npm ci — 100 passed, 1 skipped (101) on this branch after merging upstream main 4c680d099, which carries the macOS and Linux Hopper path fixes from #5235
  • npm run build:cached and npm run check:fast after merging upstream main 4c680d099 — 3 of 3 and 2 of 2 tasks successful

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Windows 11 test run; no real Ghidra involved.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @agnaylor

  • 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.

🤖 Generated with Claude Code


🔄 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/6410 **Author:** [@agnaylor](https://github.com/agnaylor) **Created:** 10/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/windows-test-fixes` --- ### 📝 Commits (3) - [`1d7ee04`](https://github.com/morluto/rea/commit/1d7ee0490f53622bec959a3df4d9bd275df79e22) fix(tests): make three Windows-failing tests pass and give the Ghidra transport one owner - [`ad91491`](https://github.com/morluto/rea/commit/ad914911e8e8234b26313dd918a655ebe4cf7d45) Merge branch 'main' of https://github.com/morluto/rea into pr/windows-test-fixes - [`4297b5e`](https://github.com/morluto/rea/commit/4297b5ebf80065315e1fe583afa5f1df151f25ac) Merge upstream main 4c680d099 into pr/windows-test-fixes ### 📊 Changes **5 files changed** (+156 additions, -133 deletions) <details> <summary>View changed files</summary> 📝 `src/ghidra/GhidraClient.ts` (+4 -1) 📝 `src/ghidra/GhidraProviderClient.ts` (+2 -4) 📝 `src/ghidra/GhidraTransport.ts` (+10 -0) 📝 `tests/boundary/mcp/ghidraInventoryMcp.test.ts` (+137 -127) 📝 `tests/boundary/mcp/serverIdentity.test.ts` (+3 -1) </details> ### 📄 Description ## Summary Three tests failed on a Windows source checkout before any change. The first, `src/config.test.ts` (the Linux Hopper launcher candidate built with the host's `path.join`), has since been fixed upstream by #5235 and is no longer part of this branch. The two that remain: 1. `tests/boundary/mcp/serverIdentity.test.ts`: the "aligned" case compared a raw `/packaged/rea.mjs` against `resolve()` of the same string, which differ on Windows. The test now passes its command path through `normalizeEntrypointPath`, as production does. 2. `tests/boundary/mcp/ghidraInventoryMcp.test.ts`: the fake Ghidra bridge publishes a Unix socket, or renames a pending TCP endpoint file into place; under the Windows temp directory the first fails with EACCES and the second with EBUSY. The test is skipped on `win32` with that reason in a comment; Windows Ghidra is verified by `verify:ghidra:windows` against a real installation. While fixing the third, the platform-to-transport decision that lived twice (`GhidraClient` defaulted to `unix-socket` regardless of platform; `GhidraProviderClient` had a `win32` ternary) got one owner: `defaultGhidraTransport` in `GhidraTransport.ts`. ## Problem and expected behavior Trigger: `npm run test:focused` on the three files on Windows 11. Expected: the Linux and identity tests pass on every host; the fixture-bound test states why it cannot run on Windows instead of failing. ## Change and scope Files: `src/ghidra/GhidraTransport.ts`, `src/ghidra/GhidraClient.ts`, `src/ghidra/GhidraProviderClient.ts`, and the two tests. No behavior change on Linux or macOS: the transport owner returns the same values the two sites produced before. Not included: 15 further `src/ghidra` unit tests and two `ghidraStartupCancellationMcp` timeouts that also fail on Windows; they are recorded, not fixed here. No issue is linked; none was found for these failures. ## Contract and boundary impact - Semantic owner and earliest changed stage: `GhidraTransport.ts` now owns the transport choice; the two tests own their own fixtures. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: Ghidra bridge transport selection is unchanged in value per platform. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata, package, or installation impact: none. Expected effects: - [x] Documentation or usability only; no target interaction. ## Evidence and regression coverage - Tests: the three files report 100 passed and 1 skipped on Windows 11 after the change, re-run after merging upstream main 4c680d099 (upstream has added tests to these files since the branch was cut); on the original base revision the same files reported three failures (backslashed Hopper path, since fixed upstream; `registration_path_mismatch`; and the EACCES launch failure of the fake bridge). - Remaining proof gaps: no Linux or macOS run of this branch; the skipped fixture test is not ported to Windows, only guarded. ## Validation performed - `npm run test:focused -- src/config.test.ts tests/boundary/mcp/serverIdentity.test.ts tests/boundary/mcp/ghidraInventoryMcp.test.ts` on Windows 11 (Ales), Node 24.22.1 with a fresh `npm ci` — 100 passed, 1 skipped (101) on this branch after merging upstream main 4c680d099, which carries the macOS and Linux Hopper path fixes from #5235 - `npm run build:cached` and `npm run check:fast` after merging upstream main 4c680d099 — 3 of 3 and 2 of 2 tasks successful ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: Windows 11 test run; no real Ghidra involved. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Author readiness Human owner: @agnaylor - [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 - [ ] 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. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7339
No description provided.