[PR #1692] [CLOSED] fix(windows): keep one separator when a runtime parent is a drive root #4756

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1692
Author: @moxi-2534
Created: 10/11/2026
Status: ❌ Closed

Base: main ← Head: fix/windows-drive-root-runtime-parent


📝 Commits (1)

  • a233fe3 fix(windows): keep one separator when a runtime parent is a drive root

📊 Changes

3 files changed (+41 additions, -2 deletions)

View changed files

📝 native/windows/src/filesystem.cc (+4 -1)
📝 scripts/verify-windows-native.mjs (+28 -1)
📝 src/ghidra/GhidraSessionRoot.test.ts (+9 -0)

📄 Description

Fixes #1690.

Summary

On Windows, runtime_create with a drive root as parent returned D:\\<prefix><hex> — two separators. The next runtime_snapshot then failed path admission with Ambiguous Windows path component is unsupported (Win32 50).

This shows up whenever the temp directory contains a dot-prefixed element (TEMP=D:\.Tmp here): ghidraSessionRoot relocates the session root to the nearest dot-free ancestor, which is the drive root, so every Ghidra analysis died in target-snapshot admission.

Problem and expected behavior

localPath keeps the trailing separator of a 3-character drive root, and createRuntime appended another one, so the root path contained an empty component. A drive root should behave like any other parent:

runtime_create(["D:\\", "rea-ghidra-"])   before: D:\\rea-ghidra-<hex>
                                          after:  D:\rea-ghidra-<hex>

Change

  • native/windows/src/filesystem.cc: append the separator only when the parent does not already end with one. localPath is untouched, so requested-path identity and the runtimeDirectory offset stay as they are.
  • scripts/verify-windows-native.mjs: new driveRootRuntimeParent control — creates a runtime at the drive root and snapshots a file through it.
  • src/ghidra/GhidraSessionRoot.test.ts: pins the drive-root fallback that reaches this path.

Not changed: ghidraSessionRoot semantics. The drive root is the only dot-free ancestor in that configuration, and it is a valid runtime parent.

Contract impact

  • CLI, MCP catalog, schemas: none.
  • Platform: Windows x64 only; POSIX and non-drive-root Windows parents are unaffected.
  • Private DACL, retained handles, cleanup, artifact manifest: unchanged.

Evidence

  • The new control fails against the 6.3.0 artifact (AssertionError: true !== false on the doubled-separator assertion) and passes with the fix ("driveRootRuntimeParent":true).
  • rea analyze C:/Windows/System32/where.exe fails with the error above on base and returns Ghidra 12.1.3 Evidence with the fix.
  • npx vitest run src/ghidra/GhidraSessionRoot.test.ts — 6 passed, 1 skipped. npx tsc --noEmit — clean.

Proof gap: the conformance run used a locally compiled Windows build, because the artifact lane requires Linux + MinGW-w64. CI should rebuild and rerun it.

Checklist

  • One focused outcome; title follows type(scope): outcome.
  • Related issue linked.
  • Tests cover the changed behavior and the failure path.
  • No docs or generated metadata changes needed.

🔄 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/1692 **Author:** [@moxi-2534](https://github.com/moxi-2534) **Created:** 10/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/windows-drive-root-runtime-parent` --- ### 📝 Commits (1) - [`a233fe3`](https://github.com/morluto/rea/commit/a233fe3ab0773be2708f3755ceea051bc2b4346f) fix(windows): keep one separator when a runtime parent is a drive root ### 📊 Changes **3 files changed** (+41 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `native/windows/src/filesystem.cc` (+4 -1) 📝 `scripts/verify-windows-native.mjs` (+28 -1) 📝 `src/ghidra/GhidraSessionRoot.test.ts` (+9 -0) </details> ### 📄 Description Fixes #1690. ## Summary On Windows, `runtime_create` with a drive root as parent returned `D:\\<prefix><hex>` — two separators. The next `runtime_snapshot` then failed path admission with `Ambiguous Windows path component is unsupported (Win32 50)`. This shows up whenever the temp directory contains a dot-prefixed element (`TEMP=D:\.Tmp` here): `ghidraSessionRoot` relocates the session root to the nearest dot-free ancestor, which is the drive root, so every Ghidra analysis died in target-snapshot admission. ## Problem and expected behavior `localPath` keeps the trailing separator of a 3-character drive root, and `createRuntime` appended another one, so the root path contained an empty component. A drive root should behave like any other parent: ``` runtime_create(["D:\\", "rea-ghidra-"]) before: D:\\rea-ghidra-<hex> after: D:\rea-ghidra-<hex> ``` ## Change - `native/windows/src/filesystem.cc`: append the separator only when the parent does not already end with one. `localPath` is untouched, so requested-path identity and the `runtimeDirectory` offset stay as they are. - `scripts/verify-windows-native.mjs`: new `driveRootRuntimeParent` control — creates a runtime at the drive root and snapshots a file through it. - `src/ghidra/GhidraSessionRoot.test.ts`: pins the drive-root fallback that reaches this path. Not changed: `ghidraSessionRoot` semantics. The drive root is the only dot-free ancestor in that configuration, and it is a valid runtime parent. ## Contract impact - CLI, MCP catalog, schemas: none. - Platform: Windows x64 only; POSIX and non-drive-root Windows parents are unaffected. - Private DACL, retained handles, cleanup, artifact manifest: unchanged. ## Evidence - The new control fails against the 6.3.0 artifact (`AssertionError: true !== false` on the doubled-separator assertion) and passes with the fix (`"driveRootRuntimeParent":true`). - `rea analyze C:/Windows/System32/where.exe` fails with the error above on base and returns Ghidra 12.1.3 Evidence with the fix. - `npx vitest run src/ghidra/GhidraSessionRoot.test.ts` — 6 passed, 1 skipped. `npx tsc --noEmit` — clean. Proof gap: the conformance run used a locally compiled Windows build, because the artifact lane requires Linux + MinGW-w64. CI should rebuild and rerun it. ## Checklist - [x] One focused outcome; title follows `type(scope): outcome`. - [x] Related issue linked. - [x] Tests cover the changed behavior and the failure path. - [x] No docs or generated metadata changes needed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:54:44 +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#4756
No description provided.