Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 199 additions & 119 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ tree-sitter-typescript = "0.23"
tree-sitter-python = "0.25"
tree-sitter-rust = "0.24"
tree-sitter-java = "0.23"
tree-sitter-c-sharp = "0.23"
tree-sitter-bash = "0.25"
tree-sitter-ruby = "0.23"
tree-sitter-php = "0.24"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ graph LR
- **MCP Server** -- Expose graph via MCP protocol for AI tool integration (40 tools)
- **Orchestration** -- Smart context routing with caching via natural language intent
- **Community Detection** -- Auto-detect functional clusters in your codebase
- **Multi-Language** -- Index Go, TypeScript, Python, Rust, Java, Kotlin, Ruby, PHP, Perl, R, Elixir, Bash with tree-sitter
- **Multi-Language** -- Default source discovery currently covers Go, TypeScript, Python, Rust, Java, Kotlin, and C#; additional parser modules also exist for Bash, Ruby, PHP, Perl, R, and Elixir
- **Android** -- Extract XML layouts, resources, manifest relationships, and navigation graphs
- **Service Topology** -- Microservice call graph visualization
- **Annotation Search** -- Search code by `@Entity`, `@HiltViewModel`, and other annotations
Expand Down
16 changes: 12 additions & 4 deletions docs/design/hld-leankg.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# LeanKG High Level Design

**Phien ban:** 1.22
**Phien ban:** 1.22.1
**Ngay:** 2026-04-24
**Dua tren:** PRD v1.22
**Dua tren:** PRD v1.22.1
**Trang thai:** Ban nhap
**Changelog:**
- v1.22.1 - C# Source Indexing MVP:
- Add parser support for `.cs` files via tree-sitter-c-sharp
- Use shared language registration across bulk and single-file indexing paths
- Add C# entity, import, inheritance, and basic call extraction
- Parse tests with the normal C# parser and classify them heuristically
- v1.23 - Knowns-Inspired Enhancements (FUTURE):
- Hybrid search with Reciprocal Rank Fusion (semantic + keyword)
- Reference system (`@doc/`, `@task-` syntax) for traversable links
Expand Down Expand Up @@ -463,6 +468,7 @@ graph TB
| Go Parser | Parse Go source files |
| TS/JS Parser | Parse TypeScript/JavaScript files |
| Python Parser | Parse Python files |
| C# Parser | Parse C# source files |
| Ruby Parser | Parse Ruby files |
| PHP Parser | Parse PHP files |
| Perl Parser | Parse Perl files |
Expand Down Expand Up @@ -1220,6 +1226,7 @@ project:
- go
- typescript
- python
- csharp

indexer:
exclude:
Expand All @@ -1230,6 +1237,7 @@ indexer:
- "*.go"
- "*.ts"
- "*.py"
- "*.cs"

pipeline:
enabled: true
Expand Down Expand Up @@ -1420,7 +1428,7 @@ Knowns MCP tools: tasks, docs, search, code, memory, validation
- postinstall script handles binary extraction and PATH setup
- Works without Rust toolchain on developer machine
- Web UI improvements
- Additional language support (Rust, Java, C#)
- Additional language support (Rust, Java)
- Incremental indexing optimization

### 11.2 Phase 3 Features
Expand Down Expand Up @@ -1496,4 +1504,4 @@ Knowns MCP tools: tasks, docs, search, code, memory, validation
- CozoDB: https://github.com/cozodb/cozo (Embedded relational-graph database with Datalog queries)
- tree-sitter: https://tree-sitter.github.io/tree-sitter/
- MCP Protocol: https://modelcontextprotocol.io/
- code-review-graph: https://github.com/tirth8205/code-review-graph (inspiration for impact analysis)
- code-review-graph: https://github.com/tirth8205/code-review-graph (inspiration for impact analysis)
38 changes: 22 additions & 16 deletions docs/requirement/prd-leankg.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,27 @@
- Source 2: `prd-leankg-v2.0-enhancements.md` (v2.0, 2026-03-27)
- Source 3: `prd-leankg-gitnexus-enhancements.md` (v1.0, 2026-03-27)

<<<<<<< HEAD
### v1.22.1 (IN PROGRESS) - C# Source Indexing MVP
- Add `.cs` source indexing via tree-sitter-c-sharp
- Parse both production and test `.cs` files with the same parser
- Add heuristic test classification for `*Test.cs` and `*Tests.cs`
- Reuse existing element and relationship types
- Non-goals: `.csproj`, `.sln`, namespace-qualified symbol identities, framework-aware test semantics

### v1.22 (IN PROGRESS) - MCP HTTP Transport (Remote MCP Server)
- **US-22.1:** Add `mcp-http` CLI command for HTTP-based MCP server
- **US-22.2:** Implement Streamable HTTP transport per MCP spec (HTTP POST + SSE)
- **US-22.3:** Support multiple concurrent MCP clients (vs stdio's single client)
- **US-22.4:** Bearer token authentication for HTTP endpoint
- **US-22.5:** CORS headers for browser-based MCP clients
- **Worktree:** `.worktrees/feat/mcp-http`

**MCP Transport Modes:**
| Mode | Transport | Use Case | Max Clients |
|------|-----------|----------|-------------|
| `mcp-stdio` | stdin/stdout | Local AI tools (Cursor, Claude Code) | 1 |
| `mcp-http` | HTTP + SSE | Remote access, browser clients | Many |

### v1.21 (IN PROGRESS) - CPU Optimization
- **US-21.1:** Reduce idle CPU from 61% to <5%
- **US-21.2:** Cache TTL tuning (300s→60s, max entries 1000→100) - COMPLETED
Expand All @@ -37,20 +57,6 @@
- **Analysis Document:** `docs/design/cpu-optimization.md`
- **Worktree:** `.worktrees/feat/cpu-optimization`

### v1.22 (IN PROGRESS) - MCP HTTP Transport (Remote MCP Server)
- **US-22.1:** Add `mcp-http` CLI command for HTTP-based MCP server
- **US-22.2:** Implement Streamable HTTP transport per MCP spec (HTTP POST + SSE)
- **US-22.3:** Support multiple concurrent MCP clients (vs stdio's single client)
- **US-22.4:** Bearer token authentication for HTTP endpoint
- **US-22.5:** CORS headers for browser-based MCP clients
- **Worktree:** `.worktrees/feat/mcp-http`

**MCP Transport Modes:**
| Mode | Transport | Use Case | Max Clients |
|------|-----------|----------|-------------|
| `mcp-stdio` | stdin/stdout | Local AI tools (Cursor, Claude Code) | 1 |
| `mcp-http` | HTTP + SSE | Remote access, browser clients | Many |

### v1.20 (PENDING) - MCP Server Watch Mode
- **US-20.1:** Add `--watch` flag to MCP server for auto-indexing on file changes
- **US-20.2:** Port 8081→9699 consolidation
Expand Down Expand Up @@ -485,7 +491,7 @@ The following features are explicitly out of scope:
4. **Advanced authentication** - Local token only
5. **Plugin system** - Future consideration
6. **Enterprise integrations** - Future consideration
7. **14 language support** - MVP focused: Go, TS/JS, Python, Rust
7. **Broad language-parity expansion** - Full multi-language parity beyond the MVP is out of scope; the approved MVP remains focused on Go, TS/JS, Python, Rust, plus `.cs` source indexing
8. **Browser-based WebAssembly UI** - LeanKG targets CLI + MCP use case
9. **Symbol rename tool** - High complexity; better handled by AI agent
10. **Raw Datalog query passthrough** - Security risk
Expand Down
Loading