[PR #1826] [MERGED] fix(windows): retain failed native inspection ownership #4841

Closed
opened 2026-10-31 00:55:51 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/windows-native-authority-1701-20261011


📝 Commits (1)

  • 5616c6c fix(windows): retain failed native inspection ownership

📊 Changes

11 files changed (+240 additions, -19 deletions)

View changed files

📝 .github/workflows/ci.yml (+12 -0)
📝 docs/testing.md (+7 -0)
📝 native/windows/README.md (+24 -0)
📝 native/windows/src/addon.cc (+37 -3)
📝 native/windows/src/authority.hpp (+1 -1)
📝 native/windows/src/process.cc (+8 -4)
📝 scripts/build-windows-native.mjs (+9 -2)
➕ scripts/verify-windows-native-inspection.mjs (+95 -0)
📝 src/windows/WindowsNativeLoader.test.ts (+7 -6)
📝 src/windows/WindowsNativeLoader.ts (+20 -3)
➕ tests/fixtures/windows-native-inspection-failure.cc (+20 -0)

📄 Description

Native inspection discarded its probe owner when directory cleanup failed, leaving an unprotected directory and permanently caching the failed availability result. Retain that owner per Node environment, settle its cleanup before admitting another probe, and let a later availability query retry native invocation failures. Successful admission and static artifact failures remain cached.

Register cleanup ownership before exposing callbacks; environment teardown makes a final attempt and reports persistent failures with reversible path diagnostics. There is no blocking sleep or backoff.

Refs #1701. The original intermittent Win32 5 host cause remains unproven; this repairs the independently reproduced ownership/cache defect and does not close that investigation.

Validation:

  • Real Windows 11 x64, Node 24.18.0, NTFS: the old inspector loses ownership under a controlled first disposition failure; the candidate retains the rename-blocking handle, recovers on a later query, caches successful admission, and cleans the pending probe on normal environment teardown.
  • Real production-addon native conformance and small JavaScript CLI/MCP workflows, including complete Evidence validation, source digest verification, normalized-result parity, and empty private temporary directories.
  • 29 source tests; single-threaded typecheck, lint/module boundaries, touched-file format check, artifact metadata/digest/PE validation, and pack dry run.
  • CI builds the injected artifact separately under .cache, tests it on Windows, and independently verifies the production addon. Pack dry run excludes the injected fixture.

Resource scope: Flameox supervised compilation and source checks. Default check:fast exceeded the 1.81 GiB capture limit; single-threaded typecheck and the separate lint/tests passed. V8 launcher profiles do not establish child compiler CPU hotspots. Windows Ghidra/JDK and macOS/saved Hopper documents were not verified by this PR.


🔄 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/1826 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/windows-native-authority-1701-20261011` --- ### 📝 Commits (1) - [`5616c6c`](https://github.com/morluto/rea/commit/5616c6cb4862ea52a8862ebcfaf55a3c405e3007) fix(windows): retain failed native inspection ownership ### 📊 Changes **11 files changed** (+240 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+12 -0) 📝 `docs/testing.md` (+7 -0) 📝 `native/windows/README.md` (+24 -0) 📝 `native/windows/src/addon.cc` (+37 -3) 📝 `native/windows/src/authority.hpp` (+1 -1) 📝 `native/windows/src/process.cc` (+8 -4) 📝 `scripts/build-windows-native.mjs` (+9 -2) ➕ `scripts/verify-windows-native-inspection.mjs` (+95 -0) 📝 `src/windows/WindowsNativeLoader.test.ts` (+7 -6) 📝 `src/windows/WindowsNativeLoader.ts` (+20 -3) ➕ `tests/fixtures/windows-native-inspection-failure.cc` (+20 -0) </details> ### 📄 Description Native inspection discarded its probe owner when directory cleanup failed, leaving an unprotected directory and permanently caching the failed availability result. Retain that owner per Node environment, settle its cleanup before admitting another probe, and let a later availability query retry native invocation failures. Successful admission and static artifact failures remain cached. Register cleanup ownership before exposing callbacks; environment teardown makes a final attempt and reports persistent failures with reversible path diagnostics. There is no blocking sleep or backoff. Refs #1701. The original intermittent Win32 5 host cause remains unproven; this repairs the independently reproduced ownership/cache defect and does not close that investigation. Validation: - Real Windows 11 x64, Node 24.18.0, NTFS: the old inspector loses ownership under a controlled first disposition failure; the candidate retains the rename-blocking handle, recovers on a later query, caches successful admission, and cleans the pending probe on normal environment teardown. - Real production-addon native conformance and small JavaScript CLI/MCP workflows, including complete Evidence validation, source digest verification, normalized-result parity, and empty private temporary directories. - 29 source tests; single-threaded typecheck, lint/module boundaries, touched-file format check, artifact metadata/digest/PE validation, and pack dry run. - CI builds the injected artifact separately under `.cache`, tests it on Windows, and independently verifies the production addon. Pack dry run excludes the injected fixture. Resource scope: Flameox supervised compilation and source checks. Default `check:fast` exceeded the 1.81 GiB capture limit; single-threaded typecheck and the separate lint/tests passed. V8 launcher profiles do not establish child compiler CPU hotspots. Windows Ghidra/JDK and macOS/saved Hopper documents were not verified by this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:55:51 +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#4841
No description provided.