[PR #1828] [MERGED] fix(managed): report ExportedType rows in managed member inspection #4844

Closed
opened 2026-10-31 00:55:53 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1828
Author: @kaoru0822-kitauji
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/managed-exported-types


📝 Commits (3)

  • 585369e fix(managed): report ExportedType rows in managed member inspection
  • ac3eaf0 fix(managed): read earlier member Evidence without exported types
  • ddc837d fix(managed): leave exported types unknown when metadata is unavailable

📊 Changes

9 files changed (+283 additions, -0 deletions)

View changed files

📝 docs/managed-code-analysis.md (+9 -0)
📝 src/contracts/managed/managedWorkflowExamples.ts (+1 -0)
📝 src/domain/managed/managedArtifact.ts (+15 -0)
📝 src/domain/managed/managedMemberComparisonCoverage.ts (+11 -0)
📝 src/dotnet/ManagedMemberInspector.test.ts (+109 -0)
📝 src/dotnet/ManagedMemberInspector.ts (+6 -0)
📝 src/dotnet/ManagedMemberInspectorCore.ts (+3 -0)
📝 src/dotnet/ManagedMemberRows.ts (+72 -0)
📝 src/dotnet/ManagedPe.fixture.ts (+57 -0)

📄 Description

Summary

Fixes #1812.

inspect-managed-members and MCP inspect_managed_members never read the ExportedType table (table 39). As a result, facade assemblies came back as coverage: complete with only <Module>, while inspect-managed-artifact reported hundreds of ExportedType rows for the same file. Examples are System.Runtime.dll (861 forwarders) and System.Web.Routing.dll (15).

Change

  • New exported_types array in the managed member inspection output. Each row is reported as declared:
    • token and row_offset
    • namespace and name
    • flags, with forwarder taken from IsTypeForwarder (0x00200000)
    • type_def_id (the hint column)
    • implementation_token, which points at the AssemblyRef, File, or enclosing ExportedType row
  • An out-of-range or null Implementation coded index keeps the row with implementation_token: null and marks coverage partial with an invalid-row issue. This matches how MemberRef parents and ManifestResource implementations are handled.
  • A new limitation states that forwarded types are not resolved in their implementing assemblies, since nothing is loaded.
  • compare_managed_members still pairs only methods and fields. When either side has exported types, it now adds a limitation saying they were not compared, so an empty diff of two facades is no longer silently misleading. Actually comparing forwarded sets is left for a follow-up.
  • docs/managed-code-analysis.md documents the new field.

This adds a field to an advertised output schema. Member Evidence recorded before this change has no such field; it parses as exported_types: null (table not examined) instead of being rejected, and comparisons add a limitation saying that side's exported types are unknown. npm run docs:generate produced no tracked changes because the generated catalogs are ignored outputs.

Validation

  • ManagedPe.fixture.ts can now emit ExportedType rows. New tests in src/dotnet/ManagedMemberInspector.test.ts cover a forwarder to AssemblyRef 1, a nested exported type, and an out-of-range implementation index.
  • npm run test:focused passes on all managed source, boundary, and MCP tests: 26 files, 200 passed, 3 skipped.
  • The contract and catalog tests also pass: toolOutputReferences, localToolContracts, productCatalog, contractPresentation, and outputSchemaSemanticConstraints.
  • npm run check:fast and npm run docs:check pass.
  • Not run against a real Microsoft facade such as System.Runtime.dll; this macOS host has no .NET runtime installed.

🤖 Generated with Claude Code


🔄 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/1828 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/managed-exported-types` --- ### 📝 Commits (3) - [`585369e`](https://github.com/morluto/rea/commit/585369e4e86a391f3a5ab009cf2c34a60e4aeaee) fix(managed): report ExportedType rows in managed member inspection - [`ac3eaf0`](https://github.com/morluto/rea/commit/ac3eaf0672e4ac22c1776cdc0c9216470808be26) fix(managed): read earlier member Evidence without exported types - [`ddc837d`](https://github.com/morluto/rea/commit/ddc837d197a70cf0e25c2a37e4e45ff365edc56e) fix(managed): leave exported types unknown when metadata is unavailable ### 📊 Changes **9 files changed** (+283 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/managed-code-analysis.md` (+9 -0) 📝 `src/contracts/managed/managedWorkflowExamples.ts` (+1 -0) 📝 `src/domain/managed/managedArtifact.ts` (+15 -0) 📝 `src/domain/managed/managedMemberComparisonCoverage.ts` (+11 -0) 📝 `src/dotnet/ManagedMemberInspector.test.ts` (+109 -0) 📝 `src/dotnet/ManagedMemberInspector.ts` (+6 -0) 📝 `src/dotnet/ManagedMemberInspectorCore.ts` (+3 -0) 📝 `src/dotnet/ManagedMemberRows.ts` (+72 -0) 📝 `src/dotnet/ManagedPe.fixture.ts` (+57 -0) </details> ### 📄 Description ## Summary Fixes #1812. `inspect-managed-members` and MCP `inspect_managed_members` never read the ExportedType table (table 39). As a result, facade assemblies came back as `coverage: complete` with only `<Module>`, while `inspect-managed-artifact` reported hundreds of ExportedType rows for the same file. Examples are `System.Runtime.dll` (861 forwarders) and `System.Web.Routing.dll` (15). ## Change - New `exported_types` array in the managed member inspection output. Each row is reported as declared: - `token` and `row_offset` - `namespace` and `name` - `flags`, with `forwarder` taken from `IsTypeForwarder` (0x00200000) - `type_def_id` (the hint column) - `implementation_token`, which points at the AssemblyRef, File, or enclosing ExportedType row - An out-of-range or null `Implementation` coded index keeps the row with `implementation_token: null` and marks coverage `partial` with an `invalid-row` issue. This matches how MemberRef parents and ManifestResource implementations are handled. - A new limitation states that forwarded types are not resolved in their implementing assemblies, since nothing is loaded. - `compare_managed_members` still pairs only methods and fields. When either side has exported types, it now adds a limitation saying they were not compared, so an empty diff of two facades is no longer silently misleading. Actually comparing forwarded sets is left for a follow-up. - `docs/managed-code-analysis.md` documents the new field. This adds a field to an advertised output schema. Member Evidence recorded before this change has no such field; it parses as `exported_types: null` (table not examined) instead of being rejected, and comparisons add a limitation saying that side's exported types are unknown. `npm run docs:generate` produced no tracked changes because the generated catalogs are ignored outputs. ## Validation - `ManagedPe.fixture.ts` can now emit ExportedType rows. New tests in `src/dotnet/ManagedMemberInspector.test.ts` cover a forwarder to AssemblyRef 1, a nested exported type, and an out-of-range implementation index. - `npm run test:focused` passes on all managed source, boundary, and MCP tests: 26 files, 200 passed, 3 skipped. - The contract and catalog tests also pass: `toolOutputReferences`, `localToolContracts`, `productCatalog`, `contractPresentation`, and `outputSchemaSemanticConstraints`. - `npm run check:fast` and `npm run docs:check` pass. - Not run against a real Microsoft facade such as `System.Runtime.dll`; this macOS host has no .NET runtime installed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:55:53 +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#4844
No description provided.