Skip to content

Publish bounded semantic MethodDef identity from Method Query Source #9830

Closed

Description

@richlander

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 TypeRef values;
  • 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.Build or compatibility aggregate is called.

Adoption

  1. Lock the semantic-identity layer/provision and detached result shape.
  2. Implement it over the Method source's retained reader and source gate.
  3. Publish exact source and producer participation receipts.
  4. Adopt it in the exact-target declaration producer used by the focused
    AssemblyContextMethodAnalysisQuery migration.

Required evidence

  • Valid, generic, nested-type, extension, vararg, bodiless, malformed, and
    invalid-token fixtures compare the detached semantic fields with the current
    MethodIdentity projection.
  • 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 MethodRowIdentity or its anchor.
  • Resolving call targets or building a call graph.
  • Computing caller-unsafe contracts.
  • Whole-assembly identity materialization.
  • C# spelling or host presentation.

Refs #7553 #8577 #8965

Activity

  1. richlander commented on Oct 12, 2026

    @richlander
    OwnerAuthor

    Implemented by #9970 (merged as 15d49e8fb). The SemanticIdentity layer serves every breadth, and MethodSemanticIdentityReader is now the single decoder Library Body Analysis also uses. Closing at the operator's direction.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureComponent boundaries, seams, and layeringdesign

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions