Skip to content

feat(native): support ReFS filesystem authority - #10086

Merged
morluto merged 12 commits into
morluto:mainfrom
QianNangong:feat/windows-refs-support
Nov 12, 2026
Merged

morluto merged 12 commits into
morluto:mainfrom
QianNangong:feat/windows-refs-support

Conversation

@QianNangong

@QianNangong QianNangong commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add fixed local ReFS support to REA's Windows native filesystem authority while preserving the existing NTFS behavior and fail-closed security boundaries. This follows the additional-filesystem direction in #289.

Problem and expected behavior

A ReFS target was rejected before Ghidra started with:

Backing volume must be NTFS with persistent ACLs [...] (Win32 50)

The rejection occurred even when ReFS reported FILE_PERSISTENT_ACLS and the target DACL was readable. The combined condition made an NTFS-only allowlist look like an ACL capability failure.

Expected behavior: fixed local NTFS and ReFS volumes are admitted only when they report persistent ACL support and satisfy the existing handle, DACL, identity, snapshot and cleanup requirements. Every other filesystem continues to fail closed.

Change and scope

  • Extend openFile to accept NTFS or ReFS with FILE_PERSISTENT_ACLS, with distinct errors for an unsupported filesystem and missing persistent ACL support.
  • Record the observed filesystem on native File/Runtime owners and propagate it through open, native inspection, runtime creation/open, Cutter verification, and snapshot source/destination identities.
  • Accept exactly NTFS and ReFS in windowsFileIdentitySchema; unknown values remain invalid.
  • Keep the existing shared backend, native ABI version 1, and all path, reparse, sharing, DACL, snapshot, cancellation, ownership and cleanup rules. No bypass or second backend is added.
  • Extend the independent Windows boundary fixture to report volume semantics and add explicit cross-volume snapshot identity checks.
  • Update capability declarations, doctor guidance and owning documentation to say fixed local NTFS/ReFS only.

Contract and boundary impact

  • Semantic owner and earliest changed stage: native openFile and the File/Runtime owners now preserve the observed filesystem. TypeScript identity validation, native inspection, runtime snapshots and Ghidra diagnostics consume that value. No producer is superseded.
  • Contribution scope fit and linked maintainer decision: Use handle-based reparse-safe filesystem authority on Windows #289 explicitly calls for fail-closed handling of unsupported ReFS semantics and real Windows tests for each claimed additional filesystem. This PR implements that existing direction without expanding execution authority.
  • CLI and MCP/tool-catalog contract: no operation, input or output shape changes. Only the accepted filesystem value domain and related limitation/recovery text change.
  • Provider, bridge, target-format, or platform compatibility: Windows native authority gains fixed local ReFS support; NTFS and non-Windows behavior are unchanged. Native ABI version and observation structure remain at version 1. Older NTFS-only consumers continue to fail closed on ReFS identities.
  • Evidence, artifact, provenance, or reconstruction contract: existing filesystem observations now report their actual NTFS or ReFS value, with snapshot source and destination evaluated separately. No new Evidence field is introduced.
  • Target selection, authority, upstream behavior, and cleanup details: fixed local path, reparse, DACL, stable file identity, immutable snapshot and owned cleanup behavior is retained. No reparse component, UNC/SUBST alias or mutable-path authority is admitted.
  • Generated metadata, package, or installation impact: no authored generated metadata changes. The WSL/MinGW-built native artifact and manifest remain uncommitted; normal release builds regenerate them for the package.

Expected effects:

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

Process launches are the existing verifier/Ghidra/Java workers. Native verification creates and removes private files and DACLs. Network contact is limited to the existing authenticated IPv4 loopback bridge; no external service is introduced.

Evidence and regression coverage

  • Tests added or updated: ReFS and unsupported-filesystem schema cases, P0 capability wording, doctor readiness, independent volume semantics, and cross-volume source/destination identity checks.
  • Base reproduction: the unmodified native artifact failed the ReFS verifier at native self-test with the original Win32 50 constraint. Schema wording tests also failed before their respective changes.
  • User-visible CLI output: source-built node scripts/rea.mjs analyze D:\项目\逆向分析\魔塔\TSW.exe completed on ReFS with 9 segments, 2079 procedures and 1413 strings, rather than failing snapshot admission.
  • Remaining proof gaps: validation covers the current Windows 11 host only. ACL-less volumes, other filesystems and other Windows versions were not exercised and remain outside the admitted boundary. No new hosted ReFS CI lane is added; the ReFS evidence is from a real local ReFS volume.

For boundary fixes, identify the applicable boundary and lifecycle regressions covered by the evidence above, and explain relevant gaps.

The evidence covers path-admission, stable identity, snapshot digest, source replacement, reparse conversion, cancellation, failed-close retention/retry and cleanup containment on both filesystems and in both cross-volume directions.

  • 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

  • CI repair (41c1c8a5bb): merged main at 047d75a498 to include the lifecycle ownership/fixture repair from fix(ci): restore lifecycle ownership coverage #10147 and corrected the ReFS plan link to the repository-owned Windows native guide. On macOS with Node 24.22.1, all 149 tests in the four previously failing lifecycle files and three Windows loader/Ghidra contract files passed; npm run docs:check (including 9 README tests), npm run verify:docs:routes, and npm run check:fast passed. Hosted Linux/Windows CI is pending; no new real Windows/ReFS verification was performed.

  • Documentation review follow-up (b6e95cdd78): website translation and full website checks passed; all 23 active catalog source messages and 19 completed translations declare NTFS/ReFS. npm run docs:check (9 README consistency tests) and pre-push check:fast passed. No new real-Windows runtime verification for this documentation-only follow-up.

  • Focused loader/provider/doctor tests — 49/49 passed.

  • npm run check on WSL — 6/6 tasks passed, including format, typecheck, lint, knip and metadata; architecture guards passed.

  • npm run docs:check — passed.

  • npm run verify:test-discovery — 3386 test files discovered exactly once.

  • npm run verify:windows-native:artifact — passed for the WSL MinGW-built Windows x64 artifact.

  • Full verify-windows-native on ReFS and NTFS — all existing controls passed, plus independent volume identities and both cross-volume snapshot directions.

  • verify-windows-native-inspection on ReFS and NTFS — controlled rollback, retained ownership, recovery and cleanup passed.

  • verify:ghidra:windows on ReFS and NTFS — all 26 non-mutating operations, byte mappings, references and complete cleanup passed with windows-x64-local-ntfs-refs-only.

  • verify:package on WSL — passed.

  • verify:package:windows — passed with 254 tools and packaged MCP/CLI checks.

  • npm pack --dry-run — completed; the generated native manifest and addon are included.

  • Source CLI analysis of the original ReFS target — completed successfully and removed owned runtime paths.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. The observation structure and native ABI version are unchanged. Older NTFS-only schema consumers fail closed on ReFS rather than misidentifying it.
  • Real Hopper/Ghidra, browser, or OS coverage: real Windows 11 NTFS and ReFS volumes, Ghidra 12.1.4, and the configured 64-bit JDK. No Hopper or browser behavior changed.
  • Package or release metadata impact: normal release builds regenerate the native artifact and manifest; generated artifacts are not committed.
  • Security, privacy, process, or containment review: no security assertion was weakened. Persistent ACLs, private DACLs, source write/replacement denial, ancestor reparse denial, immutable snapshots, cancellation, retained cleanup ownership and cleanup containment were exercised on both filesystems.

Maintainer review follow-up

Integrated main and fixed the remaining NTFS-only declarations in the authored Windows setup page, architecture admission diagram, and all 23 locale catalogs. Locale wording is unchanged apart from the filesystem name; superseded catalog entries remain available as translation memory.

Validation on macOS: 49 focused Windows loader/Ghidra doctor/capability tests passed; npm run check:fast, npm run docs:check (including 9 README consistency tests), website translation validation, and the full website check passed. The changed HTML also passes formatting. Source review found no additional native ownership or snapshot-boundary defect. These checks do not independently establish Windows or ReFS behavior; the real-provider evidence above is the author's Windows verification.

The PR remains unmerged pending the maintainer's final scope and verification decision.

Author readiness

Human owner: @QianNangong

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

@QianNangong
QianNangong marked this pull request as ready for review November 11, 2026 09:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T02:36:18.766424Z 41c1c8a New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2a4d263ae

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/getting-started/installation.md Resolved
@morluto
morluto merged commit a016743 into morluto:main Nov 12, 2026
11 of 13 checks passed
@morluto morluto mentioned this pull request Nov 12, 2026
3 tasks done
@QianNangong
QianNangong deleted the feat/windows-refs-support branch November 12, 2026 03:08
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants