Skip to content

decorators/query_graph drops one attribute when a method has multiple separate C# attribute brackets (e.g. [HttpPost] + [Route(...)]) #1865

Description

@quockidang

Summary

When a C# method carries two separate attribute brackets on the same declaration — e.g. an HTTP-verb attribute and a [Route(...)] attribute as distinct [...] groups rather than combined in one bracket — the decorators property returned via query_graph for that Method node only contains one of the two attributes. The other is silently dropped.

[HttpPost]
[Route("orders/{id}/confirm")]
public async Task Confirm(Guid id)
{
    ...
}

We queried this via:

MATCH (m:Method)
WHERE m.decorators IS NOT NULL
RETURN m.name, m.file_path, m.decorators

For methods shaped like the example above, m.decorators came back with only the [HttpPost] entry — [Route("orders/{id}/confirm")] was missing — even though the source file on disk clearly has both attributes present. We confirmed this by diffing CBM's output against the raw source for the same file/method.

Impact

We index several ASP.NET Core / ABP-style .NET monoliths where this two-bracket style (verb attribute + route attribute as separate lines) is the dominant convention. Because of this, CBM's built-in :Route node ends up populated for only a small fraction of the routes we'd expect across our indexed repos (on the order of a handful out of tens of thousands of methods with HTTP attributes). We ended up writing a separate regex-based fallback to reconstruct API routes (merging class-level [Route] with method-level [HttpGet]/[HttpPost]) rather than relying on CBM's own decorator/route extraction, since the built-in extraction wasn't usable for this.

Version

Pinned to v0.8.1. We're stuck on this version for an unrelated reason (a separate regression where query_graph's output changed to a human-readable text table with no JSON path in later releases we tried), so we haven't been able to confirm whether this specific decorator-dropping issue still reproduces on main / the latest release. Flagging it here in case it's still present.

Expected behavior

m.decorators (or whatever the AST layer collects for a method's attributes) should include all attribute brackets attached to a method declaration, not just the first/last one found.

Activity

  1. added
    cypherCypher query language parser/executor bugs
    parsing/qualityGraph extraction bugs, false positives, missing edges
    on Aug 28, 2026
  2. added
    bugSomething isn't working
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Sep 5, 2026
  3. DeusData commented on Sep 19, 2026

    @DeusData
    Owner

    Thank you for the detailed reproduction. Current main's query_graph schema includes format: "json" and snapshot continuation through cursor. That clarifies the current interface, but does not establish which release first included it or prove the original extraction problem solved. The separate-bracket C# attribute fixture remains the relevant regression case.

  4. DeusData commented on Sep 26, 2026

    @DeusData
    Owner

    Thank you for the precise two-bracket example and for diffing CBM's output against the source. That's exactly the check that settles it!

    Verified on current main: for a method with [HttpPost] and [Route("orders/{id}/confirm")] in separate brackets, m.decorators now returns both: ["HttpPost","Route(\"orders/{id}/confirm\")"]. The fix is 6b23078 (PR #1759, thanks to @Jumaga2015), which scans every attribute group instead of only the first. It shipped in v0.11.0, together with query_graph format: "json".

    One caveat: turning those attributes into :Route nodes for ASP.NET Core is still missing and tracked in #1692. Could you confirm the decorators result on v0.11.0? If it matches, we'll close this one.

  5. added
    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then close
    on Sep 26, 2026
  6. github-actions commented on Sep 26, 2026

    @github-actions

    Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:

    • the codebase-memory-mcp --version you're on
    • the exact steps or command you ran
    • a public repo (or a small dummy snippet) that shows the problem — please don't paste proprietary code

    Once that's here we'll pick it straight back up. Heads-up: issues left awaiting-reporter are automatically closed after a few weeks of silence, but a comment reopens the door anytime.

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

    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then closebugSomething isn't workingcypherCypher query language parser/executor bugsparsing/qualityGraph extraction bugs, false positives, missing edgespriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions