[PR #675] [CLOSED] fix(dotnet): keep non-CIL method implementations unknown #2157

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/675
Author: @rudycelekli
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/rea-managed-non-cil-methods-20261006


📝 Commits (2)

  • 5b8cd0a fix(dotnet): keep non-CIL method implementations unknown
  • d0af4df test(package): separate CIL reconstruction from native imports

📊 Changes

5 files changed (+108 additions, -3 deletions)

View changed files

📝 scripts/verify-package-managed.mjs (+6 -1)
📝 src/dotnet/ManagedMemberInspector.test.ts (+36 -0)
📝 src/dotnet/ManagedMemberRows.ts (+1 -1)
📝 src/dotnet/ManagedMethodBodyReader.ts (+15 -1)
📝 tests/boundary/providers/managed/managedStaticProvider.test.ts (+50 -0)

📄 Description

Summary

Honor MethodDef implementation metadata before interpreting a nonzero RVA as managed CIL. Native, runtime, unmanaged, and P/Invoke implementations do not establish that the bytes at that address have an admitted CIL representation.

The current reader can produce managed instructions, IL hashes and call/field edges from unrelated implementation bytes that happen to resemble a tiny IL header. This change retains the original RVA and reports partial body coverage with an explicit CIL-unavailable reason. It emits no invented managed anchors. Zero-RVA bodies remain proven absent, and ordinary managed IL decoding is unchanged.

Verification

  • Before: all four added implementation-flag cases failed because inspection reported a complete CIL body.
  • npm run test:focused -- src/dotnet/ManagedMemberInspector.test.ts src/dotnet/ManagedCilDecoding.test.ts src/dotnet/ManagedNativeBoundaryInspector.test.ts tests/boundary/providers/managed/managedStaticProvider.test.ts — 24 tests passed.
  • The filesystem regression writes a source-owned PE/CLI fixture, resolves its target, and invokes the actual ManagedStaticProvider/result schemas. It checks managed CIL, non-CIL bytes at a retained RVA, and a zero-RVA absence control.
  • npm run check — all five required tasks passed.
  • npm run verify:managed — 11 static source-owned conformance scenarios passed; optional operator manifest and ILSpy oracle were not configured.
  • No real native method execution, CLR execution, Hopper or Ghidra verification is claimed. No advertised contract or generated metadata is changed.

AI assistance was used for investigation, implementation and testing. The patch was independently reviewed before publication.

CI follow-up

The package consumer fixture previously combined a P/Invoke flag with a CIL body on its only Main method, then reused that impossible combination as a reconstruction input. Both package integration lanes correctly exposed this fixture drift once this fix stopped fabricating CIL hashes. The fixture now has an ordinary CIL Main and a separate zero-RVA P/Invoke declaration, with its ImplMap pointing at the second method. All existing managed reconstruction, native boundary, native verification and application graph checks remain exercised.

On repair head d0af4df69bf3d6c67defbe16fae616067969091f, npm run verify:package completed the installed-tarball CLI/MCP consumer roundtrip successfully on this macOS host, and all five npm run check tasks passed. The repaired head subsequently completed all 18 hosted checks successfully, including both Ubuntu and macOS package integration lanes.


🔄 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/675 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rea-managed-non-cil-methods-20261006` --- ### 📝 Commits (2) - [`5b8cd0a`](https://github.com/morluto/rea/commit/5b8cd0a68d12ae0b7f8d865e24daace30defc921) fix(dotnet): keep non-CIL method implementations unknown - [`d0af4df`](https://github.com/morluto/rea/commit/d0af4df69bf3d6c67defbe16fae616067969091f) test(package): separate CIL reconstruction from native imports ### 📊 Changes **5 files changed** (+108 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `scripts/verify-package-managed.mjs` (+6 -1) 📝 `src/dotnet/ManagedMemberInspector.test.ts` (+36 -0) 📝 `src/dotnet/ManagedMemberRows.ts` (+1 -1) 📝 `src/dotnet/ManagedMethodBodyReader.ts` (+15 -1) 📝 `tests/boundary/providers/managed/managedStaticProvider.test.ts` (+50 -0) </details> ### 📄 Description ## Summary Honor MethodDef implementation metadata before interpreting a nonzero RVA as managed CIL. Native, runtime, unmanaged, and P/Invoke implementations do not establish that the bytes at that address have an admitted CIL representation. The current reader can produce managed instructions, IL hashes and call/field edges from unrelated implementation bytes that happen to resemble a tiny IL header. This change retains the original RVA and reports partial body coverage with an explicit CIL-unavailable reason. It emits no invented managed anchors. Zero-RVA bodies remain proven absent, and ordinary managed IL decoding is unchanged. ## Verification - Before: all four added implementation-flag cases failed because inspection reported a complete CIL body. - `npm run test:focused -- src/dotnet/ManagedMemberInspector.test.ts src/dotnet/ManagedCilDecoding.test.ts src/dotnet/ManagedNativeBoundaryInspector.test.ts tests/boundary/providers/managed/managedStaticProvider.test.ts` — 24 tests passed. - The filesystem regression writes a source-owned PE/CLI fixture, resolves its target, and invokes the actual ManagedStaticProvider/result schemas. It checks managed CIL, non-CIL bytes at a retained RVA, and a zero-RVA absence control. - `npm run check` — all five required tasks passed. - `npm run verify:managed` — 11 static source-owned conformance scenarios passed; optional operator manifest and ILSpy oracle were not configured. - No real native method execution, CLR execution, Hopper or Ghidra verification is claimed. No advertised contract or generated metadata is changed. AI assistance was used for investigation, implementation and testing. The patch was independently reviewed before publication. ### CI follow-up The package consumer fixture previously combined a P/Invoke flag with a CIL body on its only `Main` method, then reused that impossible combination as a reconstruction input. Both package integration lanes correctly exposed this fixture drift once this fix stopped fabricating CIL hashes. The fixture now has an ordinary CIL `Main` and a separate zero-RVA P/Invoke declaration, with its ImplMap pointing at the second method. All existing managed reconstruction, native boundary, native verification and application graph checks remain exercised. On repair head `d0af4df69bf3d6c67defbe16fae616067969091f`, `npm run verify:package` completed the installed-tarball CLI/MCP consumer roundtrip successfully on this macOS host, and all five `npm run check` tasks passed. The repaired head subsequently completed all 18 hosted checks successfully, including both Ubuntu and macOS package integration lanes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:01 +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#2157
No description provided.