Skip to content

impact: a C# attribute applied by its short name is a user of its class - #2040

Open
sukuna-in-tech wants to merge 1 commit into
AxiomCodeAI:devfrom
sukuna-in-tech:fix/cs-attribute-users
Open

sukuna-in-tech wants to merge 1 commit into
AxiomCodeAI:devfrom
sukuna-in-tech:fix/cs-attribute-users

Conversation

@sukuna-in-tech

@sukuna-in-tech sukuna-in-tech commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1127 (the impact half: an attribute class now has users).

Problem. C# applies RouteAttribute as [Route]. The parser stores the name as written, so:

  • impact RouteAttribute found no application: "nothing the graph can see".
  • impact Route on an unrelated class named Route listed every [Route] as its user (wrong rows).

Change. An ATTRIBUTE_TYPE type reference [X] names XAttribute when the project declares that class, else X, which is how the compiler resolves it. The same mapping is applied in the rules' typeref facts (axiomcode-impact) and in the hook fast path (graph_sql.py).

Tests

before after
impact RouteAttribute 0 users Api.X, Api.Y, Api.Z
impact MarkerAttribute 0 users Api (class-level), Api.Y
impact Route (control, plain class) own users + 2 wrong [Route] rows own users only

New case tests/cases/csharp/attribute-application-names-its-class. tests/run.py: csharp 352/352, python 483/483. java 378/380 and the surfaces.py README check fail identically on dev.

Not in this PR: an edge from the application to the attribute's constructor (the other half of #1127).

…ss (AxiomCodeAI#1127)

C# applies RouteAttribute as [Route]: the compiler adds the suffix. The
parser records the name as written, so `impact RouteAttribute` found no
application at all, and `impact Route` on an unrelated class named Route
listed every [Route] as its user.

The type reference is now read the way the compiler resolves it: an
ATTRIBUTE_TYPE reference [X] names XAttribute when the project declares that
class, else X as written. Both the rules' typeref facts and the hook's fast
path (graph_sql) apply the same mapping.

Before / after on the new case:
  impact RouteAttribute   0 users -> Api.X, Api.Y, Api.Z
  impact MarkerAttribute  0 users -> Api (class-level), Api.Y
  impact Route (control)  Router.Make, Router.Use + 2 wrong [Route] rows
                          -> Router.Make, Router.Use only

tests/run.py: csharp 352/352 (64 cases), python 483/483; java 378/380 and
the surfaces README check fail the same way on dev.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant