Skip to content

fix(windows): explain when Windows refuses to load the verified native addon - #6832

Merged
morluto merged 1 commit into
morluto:mainfrom
dark13b:fix/windows-native-block-and-posix-hopper-paths
Oct 24, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
dark13b:fix/windows-native-block-and-posix-hopper-paths

Conversation

@dark13b

@dark13b dark13b commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #5723

When Windows refuses to load rea-windows-x64.node (for example Smart App Control or an App Control policy), rea doctor and 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: loadWindowsNativeAuthority caught that in its outer catch and returned failureStage: "artifact". inspectWindowsNativeReadiness maps 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 the host.loadArtifact() call is wrapped. A throw there returns the new failureStage: "load" (still not retryable). The reason keeps the OS error text and adds the exported WINDOWS_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 while rea setup can 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: the load stage keeps the documented code runtime_missing (docs/windows-ghidra-p0.md already documents unloadable artifacts that way) and uses the new remediation.
  • docs/windows-ghidra-p0.md (one sentence) and docs/user-visible-errors.csv (row 93) describe the new stage and copy.

Not included:

  • Signing or any release change for the addon. That is a maintainer decision.
  • A setup change. The issue says rea setup returned needs_human with no planned actions. Nothing in src/application/Setup*.ts uses the native controls. With the addon unavailable, the published rea-agents@6.7.0 CLI still planned and applied the claude_code registration (details below), so there is no gate to remove.
  • The generic JADX remediation and the Ghidra ghidra-java row ("Update JAVA_HOME") for this failure. That mapping is separate.
  • Matching on the OS error text. WindowsAuthority.ts says not to guess from it, so the guidance is phrased conditionally.

Contract and boundary impact

  • Semantic owner and earliest changed stage: loadWindowsNativeAuthority in src/windows/WindowsNativeLoader.ts, at the module load, after the manifest and digest checks.
  • Contribution scope fit and linked maintainer decision: ordinary fix within existing boundaries; not applicable.
  • CLI and MCP/tool-catalog contract: the windows_native_failure stage can now be load, and the readiness remediation text changes for that case. Codes are unchanged (runtime_missing). No tool schema changes.
  • Provider, bridge, target-format, or platform compatibility: Windows only; no provider change.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (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.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/windows/WindowsNativeLoader.test.ts, one case using the existing loader fixture. loadArtifact throws "An Application Control policy has blocked this file." The test checks failureStage: "load", the OS text kept in reason, no retryable, code runtime_missing, a remediation that mentions Smart App Control, and no "restore native/windows/build" advice.
  • Base reproduction or other evidence: the new test fails without the change (expected load, received artifact) 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.
  • Setup finding: I ran the published rea-agents@6.7.0 CLI with the addon temporarily unavailable (renamed, restored afterwards) and a scratch HOME/USERPROFILE/APPDATA/LOCALAPPDATA. rea setup --client claude_code --yes --format json returned ready, planned and applied configure_client:claude_code and install_skill:claude_code. A second run returned ready with nothing planned. The unscoped rea doctor showed the native failure only in the jadx and ghidra-java rows. That simulated failure was ENOENT (artifact stage), not the real OS refusal.
  • Where needs_human with an empty plan can come from: registration already present plus a failing in-scope doctor check (Setup.ts returns "Run rea doctor and apply each reported remediation."). I reproduced that shape on main with 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.
  • User-visible CLI/MCP output (if applicable): the new reason reads "REA Windows native controls are unavailable: Windows refused to load the verified native/windows/build/rea-windows-x64.node: The file matched the package manifest, so restoring or reinstalling it will not help. ..." (full text in docs/user-visible-errors.csv, row 93).
  • Remaining proof gaps: no real Smart App Control block, so the exact ERR_DLOPEN_FAILED message format is not observed live; the test uses the text quoted in the issue.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Windows 11 x64 (10.0.26200), Node 24.21.0. .nvmrc pins 24.22.1 and main requires ^24.22.1, so this ran below the pin and npm ci needed --engine-strict=false.

  • npm run build:cached — passed
  • npm 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 passed
  • npm run test:focused -- tests/boundary/process/providerProcess.test.ts — 3 failed, 18 passed, 5 skipped; the same 3 fail on clean main (checked with my change stashed)
  • npm run check:fast — passed
  • npm run check — exit 0 (lint 0 errors, warnings only; format, knip, metadata and architecture checks passed)
  • npm run docs:check — exit 0

Compatibility, safety, and release

  • Breaking changes or migration steps: none. A caller that matched failureStage: "artifact" for an OS load refusal now sees load.
  • Real Hopper/Ghidra, browser, or OS coverage: no real Ghidra run; the change is in the native loader diagnostics. Windows 11 x64 only; not run on Linux or macOS.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: the loader still verifies version, ABI, architecture and digest before loading and still grants no authority on failure. Only the failure classification and message change.

Author readiness

Human owner: @dark13b

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

…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
@dark13b
dark13b marked this pull request as ready for review October 23, 2026 21:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-23T21:19:23.484201Z
We couldn’t complete this review. Comment @codex review to try again.
0c03802 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no actionable issue was found.

Summary

This PR separates native addon load errors from artifact validation errors on Windows.

  • Windows reports blocked verified add-ons as load failures.

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

@morluto
morluto merged commit 39aca92 into morluto:main Oct 24, 2026
5 checks passed
@morluto morluto mentioned this pull request Oct 25, 2026
3 tasks done
@morluto

morluto commented Oct 25, 2026

Copy link
Copy Markdown
Owner

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.

@dark13b

dark13b commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review and the warm welcome, @morluto!

@morluto morluto added area: tests Test suite and verification bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Windows native module rea-windows-x64.node blocked by Smart App Control

2 participants