[GH-ISSUE #4504] [Bug] Windows snapshot disposal failure replaces the original native failure #1787

Closed
opened 2026-10-16 21:10:15 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @morluto on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4504

Before submitting

  • Searched open and closed Windows snapshot/cleanup reports; #4502 covers POSIX descriptor creation, while #1026 concerns Java sharing.
  • No credentials or sensitive target data included.

Area

Native analysis or decompilation

Observed behavior

Source-confirmed: native/windows/src/filesystem.cc completeSnapshot rejection constructs a new Failure with cleanupFailure.win32 and the destination path when disposeSnapshot fails. The original read/cancellation failure remains only in concatenated text. Native error projection therefore exposes the cleanup code/path as the primary outcome.

Reproduction

NOT_ENOUGH_INFO for native Windows reproduction. Source inspection of completeSnapshot lines639-650 and addon.cc failureValue shows the substitution. Proposed checks: original source IO failure and ERROR_OPERATION_ABORTED each combined with snapshot disposal failure.

Expected behavior

Preserve original constraint, native code and source path; attach disposal failure through the existing structured cleanupConstraint/cleanupWin32/cleanupPath fields. Keep cleanup uncertainty separate from the physical primary outcome.

Impact and scope

Windows private-runtime snapshot failure reporting. A coincident disposal failure can change primary classification and hide acknowledged cancellation. Natural incidence and leak counts unknown. No new capability or target mutation proposed.

REA version

6.5.0; source base fe2a398dd9.

Runtime and platform

Source analysis on macOS arm64; Windows native runtime not executed.

Target and artifact context

Digest-committed private snapshot used for Ghidra import; source bytes are read-only.

Interface

Shared Windows private runtime / Ghidra CLI and MCP startup.

Earliest failure stage

Cleanup, cancellation, or lifecycle

Relevant output or evidence

native/windows/src/filesystem.cc reject lambda constructs combined(failure.constraint + cleanup text, work->path, cleanupFailure.win32). authority.hpp Failure already has separate cleanup fields; addon.cc failureValue already serializes them.

Typed outcome or recovery expected

Primary native code/path remain unchanged. Structured cleanup details remain accessible. Runtime root owner retains responsibility for removal retry.

Analysis or suspected cause

Redundant concatenated representation bypasses the existing native failure algebra. Reuse the owner-defined structured fields rather than parse error messages.

Additional context

Adjacent source audit #4502; native Handle.reset ignores CloseHandle results, a separate ownership concern to track. No Windows build, native fault injection, or real-provider failure reproduction claimed.

Originally created by @morluto on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4504 ### Before submitting - [x] Searched open and closed Windows snapshot/cleanup reports; #4502 covers POSIX descriptor creation, while #1026 concerns Java sharing. - [x] No credentials or sensitive target data included. ### Area Native analysis or decompilation ### Observed behavior Source-confirmed: native/windows/src/filesystem.cc completeSnapshot rejection constructs a new Failure with cleanupFailure.win32 and the destination path when disposeSnapshot fails. The original read/cancellation failure remains only in concatenated text. Native error projection therefore exposes the cleanup code/path as the primary outcome. ### Reproduction NOT_ENOUGH_INFO for native Windows reproduction. Source inspection of completeSnapshot lines639-650 and addon.cc failureValue shows the substitution. Proposed checks: original source IO failure and ERROR_OPERATION_ABORTED each combined with snapshot disposal failure. ### Expected behavior Preserve original constraint, native code and source path; attach disposal failure through the existing structured cleanupConstraint/cleanupWin32/cleanupPath fields. Keep cleanup uncertainty separate from the physical primary outcome. ### Impact and scope Windows private-runtime snapshot failure reporting. A coincident disposal failure can change primary classification and hide acknowledged cancellation. Natural incidence and leak counts unknown. No new capability or target mutation proposed. ### REA version 6.5.0; source base fe2a398dd9ab290ba6cb3411403d319cec8d07a2. ### Runtime and platform Source analysis on macOS arm64; Windows native runtime not executed. ### Target and artifact context Digest-committed private snapshot used for Ghidra import; source bytes are read-only. ### Interface Shared Windows private runtime / Ghidra CLI and MCP startup. ### Earliest failure stage Cleanup, cancellation, or lifecycle ### Relevant output or evidence native/windows/src/filesystem.cc reject lambda constructs combined(failure.constraint + cleanup text, work->path, cleanupFailure.win32). authority.hpp Failure already has separate cleanup fields; addon.cc failureValue already serializes them. ### Typed outcome or recovery expected Primary native code/path remain unchanged. Structured cleanup details remain accessible. Runtime root owner retains responsibility for removal retry. ### Analysis or suspected cause Redundant concatenated representation bypasses the existing native failure algebra. Reuse the owner-defined structured fields rather than parse error messages. ### Additional context Adjacent source audit #4502; native Handle.reset ignores CloseHandle results, a separate ownership concern to track. No Windows build, native fault injection, or real-provider failure reproduction claimed.
Author
Owner

@kaoru0822-kitauji commented on GitHub (Oct 17, 2026):

This appears fixed on current main (2092f90b7) by 5f9ac2c98 (the commit message references this issue).

Executed on main 2092f90b7 (macOS arm64, Node 24): npm run test:focused -- … including src/windows/WindowsPrivateRuntime.test.ts (11 tests) — all passed (205/205 across the 13 files checked in this batch). The Windows runtime test ran on macOS, so it exercised the portable logic only; native Windows was not run.

I did not rerun the original fault injection from the report separately; the tests above are the regressions added with the fix. Leaving closure to a maintainer.

<!-- gh-comment-id:6232499436 --> @kaoru0822-kitauji commented on GitHub (Oct 17, 2026): This appears fixed on current main (2092f90b7) by 5f9ac2c98 (the commit message references this issue). Executed on main 2092f90b7 (macOS arm64, Node 24): `npm run test:focused -- …` including `src/windows/WindowsPrivateRuntime.test.ts` (11 tests) — all passed (205/205 across the 13 files checked in this batch). The Windows runtime test ran on macOS, so it exercised the portable logic only; native Windows was not run. I did not rerun the original fault injection from the report separately; the tests above are the regressions added with the fix. Leaving closure to a maintainer.
Author
Owner

@morluto commented on GitHub (Oct 18, 2026):

Closing as fixed on main after reconciling this report with the landed owner/consumer changes.

  • 5f9ac2c98: fix(windows): retain primary snapshot and cancellation failures. Keep the original snapshot failure alongside disposal uncertainty and retain exact cancellation reasons at the TypeScript runtime boundary.

Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.

<!-- gh-comment-id:6256012117 --> @morluto commented on GitHub (Oct 18, 2026): <!-- rea-backlog-reconciliation-2026-10-19-4504 --> Closing as fixed on `main` after reconciling this report with the landed owner/consumer changes. - [5f9ac2c98](https://github.com/morluto/rea/commit/5f9ac2c98a6fe11988c41afb737df9b6d5c3a1b3): fix(windows): retain primary snapshot and cancellation failures. Keep the original snapshot failure alongside disposal uncertainty and retain exact cancellation reasons at the TypeScript runtime boundary. Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.
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#1787
No description provided.