Repository navigation
Publish bounded semantic MethodDef identity from Method Query Source #9830
Description
Goal
Add one bounded Method Query Source capability that publishes detached semantic
identity for an owner-issued exact MethodDef target. This is a prerequisite for
moving exact-member consumers off LibraryBodyAnalysis* without treating
display identity as the current rich MethodIdentity.
The normative source contract belongs in
docs/design/method-query-source.md. This issue is a focused prerequisite
beneath #8577 and the Library Body Analysis drain in #8965.
Exact claim
For one operation-subject-associated MethodDef handle, the source can publish
the structural identity needed to construct the current MethodIdentity:
- assembly identity and module MVID;
- declaring
TypeRef; - method name, token, static and extension flags;
- parameter and return
TypeRefvalues; - generic arity and parameter names;
- signature header and vararg required-parameter count;
- invalid-generic-declaration and virtual-dispatch facts; and
- typed malformed, unsupported, and budget-exhausted outcomes.
This is semantic metadata, not inert display text. The existing Identity layer
continues to own budgeted MethodRowIdentity text and anchors. The focused
design decides whether semantic identity is a distinct layer or an
owner-declared provision, but it must not silently reinterpret Identity text.
CallerUnsafeMode is not decoded by this capability. A producer that publishes
the current MethodIdentity composes semantic identity with the separately
owned memory-safety contract result. That dependency remains visible in the
plan and receipts.
Boundaries
- The target is associated with the operation subject and source receipt; a
naked token is not cross-module identity. - Exact-target admission validates token kind and row without table traversal.
- A valid bodiless method still has semantic identity.
- Decoding is bounded under the source gate and charges all signature, type,
generic, string, and association work it performs. - No method body is acquired.
- No display text is used as a join key.
- No
LibraryBodyAnalysisBuilder.Buildor compatibility aggregate is called.
Adoption
- Lock the semantic-identity layer/provision and detached result shape.
- Implement it over the Method source's retained reader and source gate.
- Publish exact source and producer participation receipts.
- Adopt it in the exact-target declaration producer used by the focused
AssemblyContextMethodAnalysisQuerymigration.
Required evidence
- Valid, generic, nested-type, extension, vararg, bodiless, malformed, and
invalid-token fixtures compare the detached semantic fields with the current
MethodIdentityprojection. - Invalid-token admission examines no MethodDef row.
- Bodiless identity acquires no body.
- Identity-text demand remains absent unless separately requested.
- Every semantic decode unit and exhausted bound is visible in the receipt and
typed outcome.
Non-goals
- Replacing
MethodRowIdentityor its anchor. - Resolving call targets or building a call graph.
- Computing caller-unsafe contracts.
- Whole-assembly identity materialization.
- C# spelling or host presentation.
Activity
Design the unsafe member census on Assembly Analysis Operation (#9866)
Publish semantic MethodDef identity from Method Query Source (#9970)
richlander commentedon Oct 12, 2026
Implemented by #9970 (merged as
15d49e8fb). TheSemanticIdentitylayer serves every breadth, andMethodSemanticIdentityReaderis now the single decoder Library Body Analysis also uses. Closing at the operator's direction.🤖 Generated with Claude Code