[PR #607] [MERGED] fix(managed): distinguish metadata handles from member accesses #2107

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/607
Author: @rudycelekli
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @morluto

Base: main ← Head: campaign/rea-metadata-handle-edges-20261005


📝 Commits (2)

  • fae198b fix(managed): distinguish metadata handles from member accesses
  • f5ac34e chore: sync upstream CI fixture correction

📊 Changes

2 files changed (+28 additions, -0 deletions)

View changed files

📝 src/dotnet/ManagedMemberRows.ts (+1 -0)
➕ src/dotnet/ManagedMetadataHandles.test.ts (+27 -0)

📄 Description

Summary

Keep metadata-handle loads out of call and field-access graphs.

No issue is linked: this is a newly reproduced correctness defect found while reviewing current upstream; the regression and affected production seam are included for review.

Problem and expected behavior

ldtoken references to a method or field were projected as a call or field access even though the instruction only loads a RuntimeHandle. Instruction evidence should remain available without creating those false semantic edges.

Change and scope

Exclude ldtoken anchors from semantic call and field-access projection while retaining instruction anchors.

Contract and boundary impact

  • Semantic owner and earliest changed stage: ManagedMemberRows.edges projection.
  • CLI and MCP/tool-catalog contract: existing operations and schemas remain compatible; call_edges contains the call; field_accesses contains ldfld; both ldtoken anchors remain in method body evidence.
  • Provider, bridge, target-format, or platform compatibility: Static PE/CLI member edge projection.
  • Evidence, artifact, provenance, or reconstruction contract: existing source identity and explicit incomplete/unsupported evidence remain preserved.
  • Process execution, authorization, cleanup, or containment impact: No new process or filesystem behavior.
  • Generated metadata (docs/product-catalog.json), package, or installation impact: no metadata or dependency changes required.

Evidence and regression coverage

  • Tests added or updated: src/dotnet/ManagedMetadataHandles.test.ts.
  • Base reproduction or other evidence: Executed synthetic PE/CLI regression containing two ldtoken anchors and real call/ldfld anchors. Upstream reports a false call edge. The corrected result retains all four anchors and emits only the real call and field access. Microsoft opcode semantics: https://learn.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.ldtoken. Affected base is ebb4c45.
  • User-visible CLI/MCP output: call_edges contains the call; field_accesses contains ldfld; both ldtoken anchors remain in method body evidence.
  • Remaining proof gaps: Static synthetic metadata/CIL verification; no CLR runtime execution or ILSpy comparison was run.

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

Latest upstream sync: f5ac34e54e4a14e9e92195b8610e23e2c0339542 incorporates current owner main, including the source-map fixture correction from #609. At this head, the original regression plus webSourceMapFetcher.test.ts, npm run check, and npm run check:fast pass. The full local suite was not repeated for this routine sync under the current contribution policy. The implementation checks below were performed before this upstream sync and do not imply a full-suite result for the new head.

  • npm run check:pr — not run; this focused correctness fix follows the current upstream routine-PR verification policy, which makes the complete local suite optional. CI owns full coverage.
  • npm run check:ci — passed
  • npm run verify:package — passed
  • npm pack --dry-run — passed
  • npm exec -- vitest run src/dotnet/ManagedMetadataHandles.test.ts --maxWorkers=1 — passed
  • npm run check:fast — passed
  • npm run check — passed
  • npm run verify:managed — passed

Focused regression and reproduction commands ran with the outcomes described above.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Static synthetic metadata/CIL verification; no CLR runtime execution or ILSpy comparison was run.
  • Package or release metadata impact: no version, dependency, generated catalog or installation changes.
  • Security, privacy, process, or containment review: No new process or filesystem behavior. Final diff contains source and regression tests; local fixtures, binaries, caches and logs are excluded.

Review checklist

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

AI assistance was used to investigate, implement, and test this change. Commits are signed and include a DCO sign-off.


🔄 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/607 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `campaign/rea-metadata-handle-edges-20261005` --- ### 📝 Commits (2) - [`fae198b`](https://github.com/morluto/rea/commit/fae198b27b6d3dcc19440004accdff06481846b8) fix(managed): distinguish metadata handles from member accesses - [`f5ac34e`](https://github.com/morluto/rea/commit/f5ac34e54e4a14e9e92195b8610e23e2c0339542) chore: sync upstream CI fixture correction ### 📊 Changes **2 files changed** (+28 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/dotnet/ManagedMemberRows.ts` (+1 -0) ➕ `src/dotnet/ManagedMetadataHandles.test.ts` (+27 -0) </details> ### 📄 Description ## Summary Keep metadata-handle loads out of call and field-access graphs. No issue is linked: this is a newly reproduced correctness defect found while reviewing current upstream; the regression and affected production seam are included for review. ## Problem and expected behavior ldtoken references to a method or field were projected as a call or field access even though the instruction only loads a RuntimeHandle. Instruction evidence should remain available without creating those false semantic edges. ## Change and scope Exclude ldtoken anchors from semantic call and field-access projection while retaining instruction anchors. ## Contract and boundary impact - Semantic owner and earliest changed stage: ManagedMemberRows.edges projection. - CLI and MCP/tool-catalog contract: existing operations and schemas remain compatible; call_edges contains the call; field_accesses contains ldfld; both ldtoken anchors remain in method body evidence. - Provider, bridge, target-format, or platform compatibility: Static PE/CLI member edge projection. - Evidence, artifact, provenance, or reconstruction contract: existing source identity and explicit incomplete/unsupported evidence remain preserved. - Process execution, authorization, cleanup, or containment impact: No new process or filesystem behavior. - Generated metadata (`docs/product-catalog.json`), package, or installation impact: no metadata or dependency changes required. ## Evidence and regression coverage - Tests added or updated: `src/dotnet/ManagedMetadataHandles.test.ts`. - Base reproduction or other evidence: Executed synthetic PE/CLI regression containing two ldtoken anchors and real call/ldfld anchors. Upstream reports a false call edge. The corrected result retains all four anchors and emits only the real call and field access. Microsoft opcode semantics: https://learn.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes.ldtoken. Affected base is ebb4c45. - User-visible CLI/MCP output: call_edges contains the call; field_accesses contains ldfld; both ldtoken anchors remain in method body evidence. - Remaining proof gaps: Static synthetic metadata/CIL verification; no CLR runtime execution or ILSpy comparison was run. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Latest upstream sync: `f5ac34e54e4a14e9e92195b8610e23e2c0339542` incorporates current owner main, including the source-map fixture correction from #609. At this head, the original regression plus `webSourceMapFetcher.test.ts`, `npm run check`, and `npm run check:fast` pass. The full local suite was not repeated for this routine sync under the current contribution policy. The implementation checks below were performed before this upstream sync and do not imply a full-suite result for the new head. - `npm run check:pr` — not run; this focused correctness fix follows the current upstream [routine-PR verification policy](https://github.com/morluto/rea/pull/599), which makes the complete local suite optional. CI owns full coverage. - `npm run check:ci` — passed - `npm run verify:package` — passed - `npm pack --dry-run` — passed - `npm exec -- vitest run src/dotnet/ManagedMetadataHandles.test.ts --maxWorkers=1` — passed - `npm run check:fast` — passed - `npm run check` — passed - `npm run verify:managed` — passed Focused regression and reproduction commands ran with the outcomes described above. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: Static synthetic metadata/CIL verification; no CLR runtime execution or ILSpy comparison was run. - Package or release metadata impact: no version, dependency, generated catalog or installation changes. - Security, privacy, process, or containment review: No new process or filesystem behavior. Final diff contains source and regression tests; local fixtures, binaries, caches and logs are excluded. ## Review checklist - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. AI assistance was used to investigate, implement, and test this change. Commits are signed and include a DCO sign-off. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:21 +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#2107
No description provided.