Repository navigation
fix(managed): report ExportedType rows in managed member inspection - #1828
Conversation
Facade assemblies such as System.Runtime.dll provide their types only through ExportedType rows (type forwarders), which member inspection never read, so they reported complete coverage with no types. Report each row as declared with its flags, forwarder bit, TypeDefId hint, and implementation token, and record invalid or null implementation coded indexes as partial coverage. Comparisons now state that exported types are not compared when either side has them. Fixes #1812 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 585369e4e8
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| requires_mvid: cliMetadataGuidSchema.nullable(), | ||
| }), | ||
| types: z.array(managedTypeSchema), | ||
| exported_types: z.array(managedExportedTypeSchema), |
There was a problem hiding this comment.
Preserve compatibility with existing member Evidence
Make this new field default to an empty array when parsing historical results. inspect_managed_members Evidence captured before this change has no exported_types, but the comparison, reconstruction, and graph workflows all reparse those records with managedMemberInspectionSchema; they will now reject otherwise valid authenticated local evidence before running.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ac3eaf0. exported_types is now nullable().default(null). Member Evidence recorded before this change parses as null, meaning the table was not examined; I used null rather than [] so old Evidence doesn't claim the assembly exports nothing. The producer always emits an array. compare_managed_members adds a limitation when either side is null. A new test parses Evidence with the field stripped and checks that limitation.
Member Evidence recorded before ExportedType rows were read omits the field. Parse it as null (not examined) instead of rejecting it, and state in comparisons that such an observation's exported types are unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac3eaf0672
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| requires_mvid: null, | ||
| }, | ||
| types: [], | ||
| exported_types: [], |
There was a problem hiding this comment.
Mark unexamined exported types as unknown
When the input is native, has malformed metadata, or exhausts the representation budget, unavailable is returned before parseExportedTypes runs, but this initializes the new field to []. That contradicts the new null meaning (“table was not examined”) and lets consumers interpret unavailable evidence as an observed empty ExportedType table; set it to null in this branch so forwarders remain unknown.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ddc837d. The unavailable branch (native PE, malformed metadata, exhausted budget) now reports exported_types: null, because that path never reads the table. A new test checks this on a native PE.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verification follow-up for #1812: the official Microsoft .NET 7.0.20 |
Summary
Fixes #1812.
inspect-managed-membersand MCPinspect_managed_membersnever read the ExportedType table (table 39). As a result, facade assemblies came back ascoverage: completewith only<Module>, whileinspect-managed-artifactreported hundreds of ExportedType rows for the same file. Examples areSystem.Runtime.dll(861 forwarders) andSystem.Web.Routing.dll(15).Change
exported_typesarray in the managed member inspection output. Each row is reported as declared:tokenandrow_offsetnamespaceandnameflags, withforwardertaken fromIsTypeForwarder(0x00200000)type_def_id(the hint column)implementation_token, which points at the AssemblyRef, File, or enclosing ExportedType rowImplementationcoded index keeps the row withimplementation_token: nulland marks coveragepartialwith aninvalid-rowissue. This matches how MemberRef parents and ManifestResource implementations are handled.compare_managed_membersstill 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.mddocuments 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:generateproduced no tracked changes because the generated catalogs are ignored outputs.Validation
ManagedPe.fixture.tscan now emit ExportedType rows. New tests insrc/dotnet/ManagedMemberInspector.test.tscover a forwarder to AssemblyRef 1, a nested exported type, and an out-of-range implementation index.npm run test:focusedpasses on all managed source, boundary, and MCP tests: 26 files, 200 passed, 3 skipped.toolOutputReferences,localToolContracts,productCatalog,contractPresentation, andoutputSchemaSemanticConstraints.npm run check:fastandnpm run docs:checkpass.System.Runtime.dll; this macOS host has no .NET runtime installed.🤖 Generated with Claude Code