Repository navigation
fix(windows): explain when Windows refuses to load the verified native addon - #6832
Conversation
…e addon When Smart App Control or an App Control policy refuses rea-windows-x64.node, the loader reported the failure as the artifact stage. Doctor and provider diagnostics then told the user to restore or rebuild the native files, although their version and SHA-256 had already matched the package manifest. The loader now tags a failure of the module load itself, after the manifest and digest checks pass, as the load stage. The reason keeps the Windows error text and says that restoring the file cannot help, that Ghidra and JADX need the native controls, that rea setup can still register clients, and that REA must run where policy allows the file or the maintainers can be asked about a signed build. Readiness keeps the documented runtime_missing code for unloadable artifacts. Setup does not depend on the native controls: with the addon unavailable, the published 6.7.0 CLI still planned and applied the claude_code registration, so no setup gate is changed. Fixes morluto#5723
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] This PR appears safe to merge; no actionable issue was found. SummaryThis PR separates native addon load errors from artifact validation errors on Windows.
Tests were inspected, not run. GitHub authentication was unavailable, so remote supersession status could not be confirmed; the local checkout contains no later change. Reviews (1) · Last reviewed commit: "fix(windows): explain when Windows refus..." · Reviewed by Greptile |
|
Welcome, @dark13b, and thank you for untangling Windows addon load refusals from missing or mismatched files. Preserving the OS error and explaining that a verified file will not be fixed by reinstalling helps users choose a useful next step. |
|
Thanks for the review and the warm welcome, @morluto! |
Summary
Fixes #5723
When Windows refuses to load
rea-windows-x64.node(for example Smart App Control or an App Control policy),rea doctorand the provider diagnostics told the user to restore or rebuild the native files. The file had already passed the manifest version and SHA-256 checks, so that advice cannot help. This reports the refusal as its own failure stage with accurate guidance.Problem and expected behavior
Smallest trigger: the loader's
loadArtifact()throws because the OS blocked the module load (the report quotes "An Application Control policy has blocked this file").Before:
loadWindowsNativeAuthoritycaught that in its outercatchand returnedfailureStage: "artifact".inspectWindowsNativeReadinessmaps that stage to "Use the matching Windows x64 REA package, or restore native/windows/build/manifest.json and native/windows/build/rea-windows-x64.node ...".Expected (from the issue): doctor says what the user can do without disabling Smart App Control.
Change and scope
src/windows/WindowsNativeLoader.ts: only thehost.loadArtifact()call is wrapped. A throw there returns the newfailureStage: "load"(still not retryable). The reason keeps the OS error text and adds the exportedWINDOWS_NATIVE_LOAD_REFUSED_REMEDIATION: the file matched the manifest so restoring it will not help; if Windows reports an Application Control block, Smart App Control or an App Control for Business policy refused it; Ghidra and JADX need the native controls on Windows whilerea setupcan still register clients; run REA on a host whose policy allows the file, or ask the maintainers about a signed build. It does not tell the user to disable Smart App Control.src/process/WindowsAuthority.ts: theloadstage keeps the documented coderuntime_missing(docs/windows-ghidra-p0.mdalready documents unloadable artifacts that way) and uses the new remediation.docs/windows-ghidra-p0.md(one sentence) anddocs/user-visible-errors.csv(row 93) describe the new stage and copy.Not included:
rea setupreturnedneeds_humanwith no planned actions. Nothing insrc/application/Setup*.tsuses the native controls. With the addon unavailable, the publishedrea-agents@6.7.0CLI still planned and applied theclaude_coderegistration (details below), so there is no gate to remove.ghidra-javarow ("Update JAVA_HOME") for this failure. That mapping is separate.WindowsAuthority.tssays not to guess from it, so the guidance is phrased conditionally.Contract and boundary impact
loadWindowsNativeAuthorityinsrc/windows/WindowsNativeLoader.ts, at the module load, after the manifest and digest checks.windows_native_failurestage can now beload, and the readiness remediation text changes for that case. Codes are unchanged (runtime_missing). No tool schema changes.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/windows/WindowsNativeLoader.test.ts, one case using the existing loader fixture.loadArtifactthrows "An Application Control policy has blocked this file." The test checksfailureStage: "load", the OS text kept inreason, noretryable, coderuntime_missing, a remediation that mentions Smart App Control, and no "restore native/windows/build" advice.load, receivedartifact) and passes with it. This is a simulated refusal. I could not reproduce the real block because Smart App Control is off on my machine.rea-agents@6.7.0CLI with the addon temporarily unavailable (renamed, restored afterwards) and a scratch HOME/USERPROFILE/APPDATA/LOCALAPPDATA.rea setup --client claude_code --yes --format jsonreturnedready, planned and appliedconfigure_client:claude_codeandinstall_skill:claude_code. A second run returnedreadywith nothing planned. The unscopedrea doctorshowed the native failure only in thejadxandghidra-javarows. That simulated failure was ENOENT (artifact stage), not the real OS refusal.needs_humanwith an empty plan can come from: registration already present plus a failing in-scope doctor check (Setup.tsreturns "Run rea doctor and apply each reported remediation."). I reproduced that shape onmainwith a failing Node version check, with the addon present or absent. Which in-scope check failed for the reporter is unknown; their report quotes only the out-of-scope jadx row.docs/user-visible-errors.csv, row 93).ERR_DLOPEN_FAILEDmessage format is not observed live; the test uses the text quoted in the issue.For evidence-bearing changes:
Validation performed
Windows 11 x64 (10.0.26200), Node 24.21.0.
.nvmrcpins 24.22.1 andmainrequires^24.22.1, so this ran below the pin andnpm cineeded--engine-strict=false.npm run build:cached— passednpm run test:focused -- src/windows/WindowsNativeLoader.test.ts src/ghidra/GhidraDoctor.test.ts src/ghidra/GhidraProvider.behavior.test.ts src/application/Setup.planning.test.ts src/application/Doctor.test.ts— 5 files, 282 passednpm run test:focused -- tests/boundary/process/providerProcess.test.ts— 3 failed, 18 passed, 5 skipped; the same 3 fail on cleanmain(checked with my change stashed)npm run check:fast— passednpm run check— exit 0 (lint 0 errors, warnings only; format, knip, metadata and architecture checks passed)npm run docs:check— exit 0Compatibility, safety, and release
failureStage: "artifact"for an OS load refusal now seesload.Author readiness
Human owner: @dark13b
Before merge
type(scope): outcome.