Repository navigation
feat(managed): name the declaring type of call and field targets - #2163
Conversation
Call edges named external targets by member name alone (Join, ToJson, WriteAllText), and method-spec edges had no name at all, so an analyst could not tell which library a method calls or find every use of a type without a decompiler. Field accesses through MemberRefs had no name either. Name each TypeDef, TypeRef, and generic-instantiation TypeSpec once, in the namespace-qualified form TypeDef full_name uses, and add member_refs parent_name, call_edges target_declaring_type, and field_accesses field_declaring_type. A method-spec target reports the generic method it instantiates. Fields, member references, methods, and method specs now resolve through one token-keyed MemberCore lookup instead of three maps. Evidence recorded before these fields reads them as null. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: 8c1cc9055b
ℹ️ 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".
Address review findings on declaring-type naming: - A generic instantiation must name a TypeDef or TypeRef, so a TypeSpec base is reported as malformed instead of followed. Naming no longer recurses. - TypeSpec and MethodSpec instantiation blobs are decoded with the member-signature grammar. Malformed blobs and out-of-range TypeDef rows are reported against their owning row and make coverage partial. - A MethodSpec reads both columns. An invalid Method coded index is reported; a readable Method keeps its name beside a malformed instantiation. - MemberCore carries its signature kind, so a field operand is named only by a field or field-signature MemberRef. This replaces the token-table guard. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Note 🤖 Claude Opus 5.5 responding on behalf of Nick Review findings are addressed in the latest commit, with replies on each thread. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ace5cd00be
ℹ️ 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".
…lobs - A MethodSpec now checks that its method signature is generic and that the instantiation supplies as many type arguments as it declares. A non-generic target, a field reference, or a count mismatch is reported as invalid-row; the readable method keeps its name. - Unsupported TypeSpec and MethodSpec forms raise an owner-scoped unsupported-signature issue instead of reading as an intentional unknown. - MethodSpec reading moves to ManagedMethodSpecs.ts, and its tests get their own describe block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02bad95bee
ℹ️ 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".
… scopes The method signature header reader now owns the calling-convention rule that only FNPTR applied: FIELD, LOCAL_SIG, PROPERTY, and GENERICINST headers, the reserved bit, and EXPLICITTHIS without HASTHIS are malformed. A MethodSpec whose method has a PROPERTY header is no longer accepted as a generic method, and member signatures with such headers no longer decode as methods. The type-name lookup validates a TypeRef's ResolutionScope coded index and reports an out-of-range scope as invalid-row, keeping the readable name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6fef3eaabe
ℹ️ 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".
Method signature headers are now checked in context. MethodDef and MemberRef rows accept only the MethodDefSig/MethodRefSig headers: DEFAULT, VARARG, or GENERIC with DEFAULT. FNPTR keeps the unmanaged conventions compilers emit for function pointers. A field signature must be exactly FIELD, so a flagged FIELD header is malformed and never names a field. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35eaa3062d
ℹ️ 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".
|
@greptileai review |
|
…ture The arity check read only the target's signature header, so a truncated generic method signature passed. Under type selection a MethodDef target outside the selection is never decoded elsewhere, so coverage stayed complete. The arity now comes from a transient full decode, and only a decoded method signature supplies it. signature() keeps its raw length and digest around the shared decodeSignature. Co-Authored-By: Claude Opus 5.5 <[email protected]>
edgeTargets caches the generic arity, including a failed decode, by target method token, so many instantiations of one generic method share a single signature decode. Unity.InputSystem has 472 distinct MethodSpecs over about 133 target methods. Co-Authored-By: Claude Opus 5.5 <[email protected]>
e59217c validates spec type operands inside specSignature, so a malformed generic TypeSpec base is now invalid-row under its owning TypeSpec row; the three stale expectations follow that. New cases cover a TypeSpec argument and a MethodSpec argument that name a missing TypeRef, and a TypeRef whose ResolutionScope names itself. The scope cases move to their own describe block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Note 🤖 Claude Opus 5.5 responding on behalf of Nick Thanks for e59217c and a78f3b4. They supersede my earlier replies on the operand and scope-chain threads. They changed three existing expectations in
All of them fail on 9b76dd0 and pass on a78f3b4. On a78f3b4 with these tests, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2cc6feeddb
ℹ️ 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".
| }); | ||
| const generic = metadataCodedToken(methodRaw, 1, [6, 10], layout.rowCounts); | ||
| const target = generic === null ? undefined : members.get(generic); | ||
| if (target !== undefined) members.set(token, { ...target, token }); |
There was a problem hiding this comment.
Keep field-like MethodSpecs out of field target maps
Fresh evidence after the prior member-kind fix is an ldsfld whose operand is a MethodSpec targeting a field-signature MemberRef: this assignment installs the MethodSpec with inherited kind: "field" before the later arity check reports invalid-row, and namedTarget therefore emits its field_name and declaring type. A MethodSpec is not a valid field operand (and the documented guard permits only FieldDefs or field MemberRefs), so malformed IL now receives positive field evidence instead of unknown; retain any readable method fact without inserting a field-kind MethodSpec.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Note
🤖 Claude Opus 5.5 responding on behalf of Nick
Fixed in c0f0bdd. A MethodSpec now borrows its target's name and declaring type only when the target is not a field (kind is method, or unknown for a MemberRef whose signature does not decode). A MethodSpec over a field-signature MemberRef is no longer in the target map. An ldsfld or call on it stays unnamed, and the arity check still reports invalid-row. The docs now say a readable MethodSpec method column keeps its name only when it names a method.
Test: "never names a field through a MethodSpec" puts an ldsfld and a call on a MethodSpec over a FIELD string MemberRef. It expects both to stay unnamed with partial coverage, and it fails on 2cc6fee. npm run check and the managed suite (322) pass. Real assemblies keep every method-spec edge and field access named, with complete coverage.
A MethodSpec over a field-signature MemberRef inherited kind "field", so an ldsfld on that MethodSpec published a field name and declaring type for malformed IL. A MethodSpec now borrows its target's name only when the target is not a field; the arity check still reports it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0f0bdd451
ℹ️ 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".
| if (!arities.has(generic)) | ||
| arities.set( | ||
| generic, | ||
| methodGenericArity(layout, methodSignatureBlob(bytes, layout, generic)), |
There was a problem hiding this comment.
Reuse parsed signatures for MethodSpec arity
When a MethodSpec targets a MemberRef or a selected MethodDef, that row's signature has already been fully decoded and retained, but this call rereads and re-renders the same blob. With a large valid generic signature that passed its first blob.length * 256 transient admission, later retained metadata can leave less than that amount in the 64 MiB budget; this duplicate admission then raises resource-limit and makes the outer inspection unavailable even though generic_parameter_count and parse_status are already known. Carry those parsed facts into the target index and only fall back to raw decoding when no owner-parsed signature is available.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Note
🤖 Claude Opus 5.5 responding on behalf of Nick
Fixed in cbd7755. MemberCore now carries genericArity from the owner's decoded signature. parseMemberRefs sets it for every MemberRef, and parseMethods sets it for each MethodDef in the selection, both from the signature they already decode. One signatureGenericArity rule (a decoded method signature's generic count, else null) serves both and the raw path. readMethodSpec uses that value and reads the raw signature only when no owner decoded it, as for a MethodDef outside the type selection. The per-token cache still covers that fallback.
Behavior is unchanged. The existing MethodSpec arity tests (MemberRef and in-selection MethodDef targets) now go through the owner facts, and the managed suite passes at 322. Real assemblies keep complete coverage with every method-spec edge named, including Mono mscorlib with List`1 and Array selected. That run uses the raw fallback for at least 16 targets outside the selection.
MemberRef signatures, and MethodDef signatures in the type selection, are already fully decoded, but the MethodSpec arity check decoded them again and admitted a second transient allocation, which could exhaust the budget. MemberCore now carries the owner's genericArity, and only a target nothing decoded, such as an unselected MethodDef, falls back to the raw signature. signatureGenericArity is the one rule for both paths. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Addressed / current-source confirmation in a78f3b4. The current producer no longer recursively resolves TypeSpec bases. specSignature uses an iterative type grammar, and generic bases are limited to TypeDef/TypeRef coordinates. Referenced TypeRef scopes now also use a separately bounded iterative traversal with cycle detection and cached examination. This removes the stack-depth failure instead of adding a recursion threshold. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. The shared MemberCore retains parsed signature kind, and field-edge resolution requires kind field. A method-signature MemberRef can therefore no longer be presented as an accessed field; malformed signatures remain unknown and partial. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. TypeSpec naming calls specSignature before interpreting its generic base. The owning iterative grammar consumes all type arguments and rejects missing counts, truncation and trailing data. The new owner-aware pass also validates every encoded type coordinate in nested arguments and modifiers. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. readMethodSpec reads both columns, maps any readable Method fact, and validates the complete Instantiation through specSignature. Failures remain associated with metadata.MethodSpec:, so a readable name survives as partial evidence rather than silently making unread metadata complete. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. TypeDef naming checks the row through metadataRowOffset before indexing ranges. In addition, the owner-aware spec parser now rejects null, reserved and out-of-range coded type operands before naming their base. Missing rows therefore retain an explicit failure rather than collapsing into ordinary unknown. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. readMethodSpec validates its target through methodGenericArity and compares that parsed arity with the complete instantiation argument count. Non-method targets, undecodable/non-generic signatures and mismatched counts report invalid-row while preserving any readable method fact. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. specSignature propagates unsupported-signature under its owning TypeSpec/MethodSpec scope instead of returning an ordinary null. Its owner-scoped catch now also preserves coded-operand invalid-row failures. Well-formed unsupported naming shapes stay distinguishable from unvalidated blobs. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. The shared readMethodSignatureHeader validates the header for its grammar context before reading counts. Metadata member headers cannot use FIELD, PROPERTY, LOCAL_SIG or GENERICINST, reserved bits or EXPLICITTHIS without HASTHIS, so MethodSpec arity cannot authenticate those forms. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. TypeRef ResolutionScope validation now follows reachable TypeRef scopes iteratively, validates each coded coordinate against the layout, and detects cycles. Null scopes remain legal. Failures are retained against the offending TypeRef row while readable type names are kept as partial evidence. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. The producer separates metadata-member header rules from function-pointer conventions. MethodDef/MemberRef signatures accept only DEFAULT, VARARG or GENERIC-with-DEFAULT (plus valid instance flags); FNPTR retains its separate unmanaged conventions. Invalid member headers cannot pass generic method eligibility. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. FieldSig decoding requires the exact 0x06 FIELD byte. Flag-bearing FIELD headers flow into header validation and become malformed/unknown, so MemberCore never marks them as field targets and field-edge names remain unknown with partial coverage. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. The gap was at the shared grammar operand boundary: syntax decoding rendered coded coordinates without validating referenced rows. readTypeOperand now receives layout during the spec pass and validates class/value-type operands, generic bases and custom modifiers against row counts, including nested arguments. Generic parameter indexes remain indexes rather than metadata tokens. specSignature re-scopes invalid-row failures to the owning TypeSpec/MethodSpec. Rendering and public member contracts remain unchanged. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. Addressed / current-source confirmation in a78f3b4. The immediate-row check missed malformed reachable identities. validateScopeChain now walks TypeRef scopes without recursion, records the offending parent row for missing/reserved coordinates or cycles, and caches examined scopes for this lookup. Its visited/cache bookkeeping is admitted to the layout-owned decode budget. Null and terminal local scopes stop traversal, and readable names survive even an unreadable reachable scope row as partial evidence; this does not introduce cross-assembly resolution or nested-name rewriting. Validation: inspected the producing boundary and affected consumers. Tests, builds, checks and CI approvals were skipped at the maintainer's explicit request; no real-assembly verification was rerun. No directly related code cleanup remains outstanding. |
Brings in morluto#2163 (declaring types on call and field targets) and later main commits. Conflicts in ManagedMemberInspector.ts, ManagedMemberRows.ts and docs/managed-code-analysis.md keep both features: user strings and edge-target naming run side by side, and every issue list, including edge-target issues, is appended with appendManagedParseIssues. parseUserStrings moves to ManagedUserStrings.ts so ManagedMemberRows.ts stays under the max-lines limit with both features. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbd77550c4
ℹ️ 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".
| token, | ||
| name, | ||
| declaringType: parentName, | ||
| kind: decoded.kind, |
There was a problem hiding this comment.
Reject field MemberRefs parented by MethodDefs
Fresh evidence beyond the prior signature-kind fix is an ldsfld operand naming a MemberRef whose Class selects an existing MethodDef and whose blob is a valid FIELD signature: the parent range check succeeds and this assignment advertises kind: "field", so namedTarget emits the member name with complete coverage. MethodDef parents are reserved for vararg method call-site MemberRefs and cannot parent field references; validate the parent/signature combination and leave the malformed target unknown/partial.
AGENTS.md reference: AGENTS.md:L25-L25
Useful? React with 👍 / 👎.
| return ranges[row - 1]?.fullName ?? null; | ||
| } | ||
| const cursor = metadataRowCursor(bytes, layout, 1, row); | ||
| cursor.readIndex(layout.codedIndexSize("ResolutionScope")); |
There was a problem hiding this comment.
Validate namespaces on nested TypeRefs
Fresh evidence beyond the scope-chain checks is a used TypeRef whose in-range ResolutionScope selects another TypeRef while TypeNamespace is non-empty: this discards the scope and returns namespace.name, so parent_name and target declaring types carry a qualified name with complete coverage. Nested TypeRefs require a null namespace, so validate that relation and record invalid-row while retaining readable text only as partial evidence.
AGENTS.md reference: AGENTS.md:L25-L25
Useful? React with 👍 / 👎.
Note
🤖 Claude Opus 5.5 responding on behalf of Nick
Summary
Fixes #2160.
Call edges named external targets by member name alone, method-spec edges had no name, and field accesses through MemberRefs had no name either. This names the declaring type of every edge target and of each MemberRef parent. Callers can now tell
UnityEngine.JsonUtility.ToJsonfromNewtonsoft.Json.JsonConvert.ToJson, and find every use of a type, without a decompiler.Problem and expected behavior
Smallest trigger: any
callto a MemberRef.target_nameisJoin, andmember_refs[].parent_tokenpoints at a TypeRef that no output names. Acallto a MethodSpec reportstarget_name: null. Anldsfldof a MemberRef field reportsfield_name: null, because the field path only consulted FieldDef rows.Expected:
full_namealready uses.null.Change and scope
src/dotnet/ManagedTypeNames.ts.typeNameLookupnames a TypeDef from the existing ranges, a TypeRef from its row, and a GENERICINST TypeSpec by its generic type, once per token. TypeSpec blobs are decoded whole with the existing signature grammar through a newspecSignature. A GENERICINST base must be a TypeDef or TypeRef (ECMA-335 II.23.2.12), so naming never recurses. Malformed or unsupported blobs and out-of-range rows are reported against their row. TypeRef ResolutionScope chains are checked transitively with cycle detection (morluto, e59217c and a78f3b4). An invalid or cyclic scope is reported asinvalid-rowand the readable name is kept. A null scope is valid. Type operands inside spec blobs, including nested arguments and custom modifiers, are validated against the metadata tables, and a failure is reported under the owning TypeSpec or MethodSpec row. Other well-formed TypeSpec forms staynullwithout an issue.parseMemberRefsrecordsparent_nameand uses it as the MemberRef's declaring type, with its decoded signature kind.MethodCore,FieldCoreandMemberRefCorewere three shapes of the same fact. They merge into oneMemberCorewith a declaring type and a kind.edgeTargetsindexes fields, member refs and methods by token, then adds each MethodSpec an inspected body calls under the generic method it instantiates. MethodSpec reading lives insrc/dotnet/ManagedMethodSpecs.ts. It validates the Method column and the Instantiation blob, and checks that the method's signature decodes completely as a generic method with as many parameters as the instantiation supplies. The arity comes from the signature the target's owner already decoded (MemberCore.genericArityfor MemberRefs and selected MethodDefs). Only a target nothing decoded, such as a MethodDef outside a--typeselection, falls back to a transient raw decode, cached per target method. A readable Method keeps its name beside a malformed instantiation or an arity mismatch, with partial coverage.edgesresolves every target through that single map instead ofmethodCore ?? refCoreand a separate field map.readMethodSignatureHeader, which now checks the header against its context. MethodDef and MemberRef rows accept only MethodDefSig/MethodRefSig headers (ECMA-335 II.23.2.1-2): DEFAULT, VARARG, or GENERIC with DEFAULT, plus HASTHIS/EXPLICITTHIS. FNPTR keeps the unmanaged C, STDCALL, THISCALL, FASTCALL and UNMANAGED conventions that compilers emit. A field signature must be exactly FIELD (II.23.2.4). Any other header is malformed. That includes PROPERTY, LOCAL_SIG, GENERICINST, a flagged FIELD, the reserved bit, and EXPLICITTHIS without HASTHIS. Such a member never passes the MethodSpec arity check and never names a field.ldsfldon a method MemberRef stay unnamed.member_refs[].parent_name,call_edges[].target_declaring_typeandfield_accesses[].field_declaring_typeare added asnullable().default(null), so older Evidence reads them as unknown.Not included:
full_name.Contract and boundary impact
src/dotnet. Type naming has one owner,typeNameLookup, and edge target resolution has one owner,edgeTargets.inspect_managed_members. Formethod-specedges,target_namechanges from alwaysnullto the generic method's name when the MethodSpec row resolves. A member signature whose header is neither an exact FIELD nor a MethodDefSig/MethodRefSig header, such as PROPERTY, C, or a flagged FIELD, now reportskind: unknownandparse_status: malformedinstead of decoding as a method or field.null. Tokens, anchors and digests are unchanged.Evidence and regression coverage
Tests added or updated, all in
src/dotnet/ManagedMemberInspector.test.ts:parent_name,target_declaring_typeandfield_declaring_type.nullwith complete coverage.nullname: a TypeSpec base, a missing argument count, and out-of-range TypeRef and TypeDef rows.invalid-row.unsupported-signatureinstead of reading as unknown.invalid-row. Member signatures with a PROPERTY, C, or GENERIC|VARARG header, or with EXPLICITTHIS but no HASTHIS, are malformed.ldsfld, with partial coverage.invalid-rowissue and partial coverage.ldsfldandcall.ldsfld. A method-signature MemberRef underldsfld, and a call with a FieldDef operand, stay unnamed.null.Base reproduction: on
main, PEAK'sPeak.Quicksave(Unity MonoAssembly-CSharp.dll,--type Peak.Quicksave) showsSaveNow -> ToJson,WriteAllTextandLoadSaveData -> ReadAllText, plusmethod-spec 0x2b0002a5 null.User-visible CLI output, same command on this branch, with complete coverage:
3,830 of 3,841 member refs get a
parent_name, and every field access in the class is named, for exampleZorro.Core.BuildVersion.MinorVersion. The other 11 have multidimensional-array TypeSpec parents, which staynullby design.Remaining proof gaps: no real-provider lane applies. Fixtures are source-built. The PEAK assembly is a third-party game binary and is not committed.
For evidence-bearing changes:
Validation performed
All runs used Node 24.18.0 and npm 11.16.0, per
.nvmrcandpackageManager.npm run check: passed, including architecture guards. Lint has no new warnings againstmain. Existing size and complexity warnings in touched files moved by a few lines, andManagedMemberInspectorCore.tsgot shorter.npm run docs:check: passed.npm run verify:test-discovery: passed.npm run test:focused --on the same 26 managed test files as the sibling PR: 322 passed.Assembly-CSharp.dll, PEAK and Valheim type selections, Monomscorlib.dllList1,Unity.InputSystem.dll): complete coverage, with all 247method-spec` edges named and arity-checked.Assembly-CSharp.dllwith--type Peak.Quicksave: complete coverage, output above.method-specedge is named. MonomscorlibwithList`1andArrayselected has at least 16 such edges out of 56. Valheim withPlayerandZNethas at least 22 of 137. PEAKPeak.Quicksavehas 1 of 2.mscorlib,System.Xml,UnityEngine.CoreModule,Unity.InputSystem, and three game assemblies). That is 170,725 signatures: 61,620 fields and 109,105 methods and member references. The header checks reject none of them, and every one still decodes. Member headers seen were only 0x00, 0x05, 0x10, 0x20, 0x30 and exactly 0x06.Compatibility, safety, and release
method-spectarget_namegoes fromnullto a value when resolvable.metadataRowCursorare charged to the existing budget, and each type is named once.Review checklist
type(scope): outcome.#2162 is a sibling PR that touches the same schema, fixture and docs section. Whichever merges second will need a small rebase.
🤖 Generated with Claude Code