✨ Stack-graphs-based language analyzers#281
Conversation
📝 WalkthroughWalkthroughAdds a new enhancement proposal documenting a Rust-based stack-graphs analyzers architecture: per-language parsing (tree-sitter → TSG), per-file graph persistence to SQLite, full-project reverse-reference resolution, a Querier query API, a gRPC provider spec, open design questions, test plan, and risks. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant gRPC_Provider as "gRPC Provider"
participant Query_API as "Query API"
participant SQLite as "SQLite Store"
participant ReverseIdx as "Reverse Reference Index"
participant Indexer
Note over Indexer, SQLite: Offline/background indexing
Indexer->>SQLite: persist per-file stack-graphs + SourceInfo
Indexer->>ReverseIdx: build reverse references (project-wide)
Client->>gRPC_Provider: request(definition/reference/query)
gRPC_Provider->>Query_API: forward request
Query_API->>ReverseIdx: lookup reverse references (if required)
Query_API->>SQLite: fetch graphs & node metadata
SQLite-->>Query_API: graph & SourceInfo
ReverseIdx-->>Query_API: reference results
Query_API-->>gRPC_Provider: assemble response
gRPC_Provider-->>Client: reply(results)
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
enhancements/stack-graphs-analyzers/README.md (1)
102-102: Consider adding language specifiers to fenced code blocks.Three code blocks lack language specifiers (lines 102, 427, 520). While these appear to be ASCII diagrams rather than executable code, adding a language specifier (e.g.,
text) would improve markdown consistency and silence linter warnings.📝 Example fix for line 102
-``` +```text ↑title ↑Bar <-- pop nodes (definitions in this scope)Also applies to: 427-427, 520-520
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@enhancements/stack-graphs-analyzers/README.md` at line 102, Three fenced code blocks that contain ASCII diagrams (e.g., the block starting with "↑title ↑Bar <-- pop nodes (definitions in this scope)" and the similar blocks near the other two diagrams) lack language specifiers; add a language tag (preferably text) to each opening fence (```text) so the blocks become ```text ... ``` to satisfy the linter and keep markdown consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@enhancements/stack-graphs-analyzers/README.md`:
- Line 102: Three fenced code blocks that contain ASCII diagrams (e.g., the
block starting with "↑title ↑Bar <-- pop nodes (definitions in
this scope)" and the similar blocks near the other two diagrams) lack language
specifiers; add a language tag (preferably text) to each opening fence (```text)
so the blocks become ```text ... ``` to satisfy the linter and keep markdown
consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f923a83f-5bfb-4e1e-baec-c621c22fa391
📒 Files selected for processing (1)
enhancements/stack-graphs-analyzers/README.md
Proposes building Konveyor's language analysis on a maintained fork of GitHub's stack-graphs library, replacing heavyweight Go-based providers that depend on language servers (JDTLS, csharp-ls). Includes narrative of discoveries (serde gap, schema standardization needs, FQDN computation), open design questions, and proposed architecture. Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
- Link to c-sharp-analyzer-provider for context on current C# provider - Rewrite worked example: start with simplest intra-file case, build up to cross-file and member access, show push/pop clearly at each step - Fix FQDN section: TSG has string concat but it was fragile in practice - Fix TSG/Lua discussion: frame as real language vs custom DSL - Connect forward-only resolution to incrementality discussion - Add incremental resolution via partial path pre/postconditions as an alternative to full resolution pass - Remove "we likely need both" assertion from type info section Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
Vertical diagram shows directed edges from push node (reference) through scope nodes to pop nodes (definitions), making the breadth-first search and gate-check mechanism concrete. Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
- Fix FQDN expansion: "fully qualified name" not "domain name"
- Standardize on CST terminology with explanatory aside
- Clarify cross-file example: show how using directive creates
push nodes that build the namespace on the stack
- Clarify member access example: show push chain traversal
step-by-step before resolution begins
- Add Open Question 8: external dependencies (ILSpy approach)
- Add Open Question 9: resolution failure and diagnostics
- Remove import from syntax_type vocabulary (it's a reference)
- Soften "proof" claim for Java analyzer (81% pass rate)
- Add leaning to graduation criteria (rule pass rate)
- Fix jmle date to 2026-04-16, soften "platform" claim
- Align pop(":") between schema section and open question 4
- Add FQDN format note to find_definitions docstring
Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
- Rename FQDN to FQN (fully qualified name) throughout - Fix jmle timeline and chronological ordering - Standardize CST terminology in Alternatives and Implementation History - Add push/pop intuition, naming convention note, sketch type annotations - Restore reviewers list, fix YAML frontmatter - Tighten duplicate explanations, fix orphaned reference Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
ffc7b90 to
a07fb02
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@enhancements/stack-graphs-analyzers/README.md`:
- Around line 558-564: The fenced code block showing the integration diagram for
analyzer-lsp and stack-graphs-provider is missing a language label; update the
fence around the diagram to use a language tag (e.g., text) so the block is
labeled and MD040 is fixed—locate the fenced block containing "analyzer-lsp
--gRPC--> stack-graphs-provider (Rust binary)" and change the opening fence
from ``` to ```text (preserve the exact diagram content and closing backticks).
- Around line 104-115: The fenced ASCII diagram block starting with the triple
backticks in the README should include a language hint to satisfy markdownlint
MD040; change the opening fence from ``` to ```text (or another appropriate info
string) so the block becomes a fenced "text" code block and keep the closing ```
unchanged; locate the fenced diagram block that contains the ASCII lines like
"↑title ↑Bar" to apply this change.
- Around line 461-502: The fenced code block starting with the triple backticks
that contains the diagram beginning with "Source files (.cs, .java, ...)" is
unlabeled; update the opening fence to include a language label (use "text") so
the block becomes ```text ... ``` to satisfy MD040 and improve rendering,
leaving the block content and closing fence unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bc463a6f-7ff0-4527-80b0-0fee34fe7894
📒 Files selected for processing (1)
enhancements/stack-graphs-analyzers/README.md
|
|
||
| Each provider is built independently with its own architecture, query capabilities, and rule format. There is no way to write a query that works across languages. Adding a new language means building a new provider from scratch — new Go code, new language server dependency, new containerization, new bugs. | ||
|
|
||
| A migration rule like "find all references to `com.example.OldClass`" should be expressible the same way regardless of whether the codebase is Java, C#, or Python. Today, it can't be. |
There was a problem hiding this comment.
I don't know if I am fully on board with this because a language like Rust doesn't have "class", so at the very least, each language will need to have its own set of locations.
Just some food for thought
Rewrite d.Title member access example to show the full type-dependent resolution trace using ":" pop edges as gate symbols. Each step now shows exactly which node is encountered and what happens to the stack, with no hand-waving. Also restructure sections, rename "Serde Gap" to "SQLite Gap", and miscellaneous editorial improvements. Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
enhancements/stack-graphs-analyzers/README.md (1)
162-173:⚠️ Potential issue | 🟡 MinorAdd language hints to unlabeled fenced diagram blocks (MD040).
Line 162, Line 532, and Line 629 open fenced blocks without an info string. This can fail strict markdownlint runs; use
textfor these ASCII diagrams.Suggested fix
-``` +```text ↑title ↑Bar <-- pop nodes (definitions in this scope) ^ ^ | | [Foo's member scope] <-- "Bar is nested in Foo, so Foo's members are visible" @@ ↓title <-- push node (reference to title)-
+text
Source files (.cs, .java, ...)
|
v
tree-sitter (parsing)
@@
gRPC Provider Service
(replaces java-external-provider,
dotnet-external-provider)-``` +```text analyzer-lsp --gRPC--> stack-graphs-provider (Rust binary) | +-- C# grammar +-- Java grammar +-- SQLite database</details> Also applies to: 532-573, 629-635 <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@enhancements/stack-graphs-analyzers/README.mdaround lines 162 - 173, The
markdown contains unlabeled fenced diagram blocks (plain ASCII diagrams) that
trigger MD040; locate the three fenced code blocks shown by the ASCII diagrams
(the block starting with the arrow diagram that includes "↑title ↑Bar" and
the other two blocks with "Source files (.cs, .java, ...)" and "analyzer-lsp
--gRPC--> stack-graphs-provider") and add the info string text to each opening
fence (changetotext) so the diagrams are explicitly marked as plain
text.</details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In@enhancements/stack-graphs-analyzers/README.md:
- Around line 162-173: The markdown contains unlabeled fenced diagram blocks
(plain ASCII diagrams) that trigger MD040; locate the three fenced code blocks
shown by the ASCII diagrams (the block starting with the arrow diagram that
includes "↑title ↑Bar" and the other two blocks with "Source files (.cs,
.java, ...)" and "analyzer-lsp --gRPC--> stack-graphs-provider") and add the
info string text to each opening fence (changetotext) so the diagrams
are explicitly marked as plain text.</details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: defaults **Review profile**: CHILL **Plan**: Pro **Run ID**: `115c716d-c406-40f1-afd2-7b6c3d7d6e1b` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between a07fb0278a2aba4df27cf9f3bf0e0890bbb494c6 and 22edd6b81b837c33d51d625c1871ab3e2e6b4d53. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `enhancements/stack-graphs-analyzers/README.md` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. |
|
@JonahSussman I guess we don't want to keep this anymore after the latest changes to the c-sharp provider? |
Summary
Proposes building Konveyor's language analysis on a maintained fork of GitHub's stack-graphs library, replacing the current approach of separate Go-based providers depending on heavyweight language servers (JDTLS for Java) and broken grammars (the current C# provider uses stack-graphs but the grammar has correctness issues).
This enhancement is still in flux — putting it out there early to get feedback on the direction and open questions. The document is intentionally narrative rather than rigidly following the template, since the problem space spans multiple providers, a forked upstream library, and design questions that need community input.
Key points
Open questions that need discussion
🤖 Generated with Claude Code
Summary by CodeRabbit