Skip to content

Commit edaf80d

Browse files
committed
feat: integrate tools, CLI, visualization, and infrastructure
1 parent 5555cda commit edaf80d

21 files changed

+2607
-308
lines changed

CHANGELOG.md

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,6 @@
22

33
## [Unreleased]
44

5-
## [2.3.2] - 2026-04-14
6-
7-
Major feature release — 15 new capabilities, 6 community PRs merged, 6 new MCP tools, 4 new languages, multi-format export, and graph analysis suite.
8-
9-
### Added
10-
11-
- **Hub node detection** (`get_hub_nodes_tool`): find the most-connected nodes in the codebase (architectural hotspots) by in+out degree, excluding File nodes.
12-
- **Bridge node detection** (`get_bridge_nodes_tool`): find architectural chokepoints via betweenness centrality with sampling approximation for graphs >5000 nodes.
13-
- **Knowledge gap analysis** (`get_knowledge_gaps_tool`): identify structural weaknesses — isolated nodes, thin communities (<3 members), untested hotspots, and single-file communities.
14-
- **Surprise scoring** (`get_surprising_connections_tool`): composite scoring for unexpected architectural coupling (cross-community, cross-language, peripheral-to-hub, cross-test-boundary).
15-
- **Suggested questions** (`get_suggested_questions_tool`): auto-generate prioritized review questions from graph analysis (bridge nodes, untested hubs, surprising connections, thin communities).
16-
- **BFS/DFS traversal** (`traverse_graph_tool`): free-form graph exploration from any node with configurable depth (1-6) and token budget.
17-
- **Edge confidence scoring**: three-tier system (EXTRACTED/INFERRED/AMBIGUOUS) with float confidence scores on all edges. Schema migration v9.
18-
- **Export formats**: GraphML (Gephi/yEd/Cytoscape), Neo4j Cypher statements, Obsidian vault (wikilinks + YAML frontmatter + community pages), SVG static graph. CLI: `visualize --format graphml|cypher|obsidian|svg`.
19-
- **Graph diff**: snapshot/compare graph state over time — new/removed nodes, edges, community membership changes.
20-
- **Token reduction benchmark**: measure naive full-corpus tokens vs graph query tokens with per-question reduction ratios.
21-
- **Memory/feedback loop**: persist Q&A results as markdown for re-ingestion via `save_result` / `list_memories` / `clear_memories`.
22-
- **Oversized community auto-splitting**: communities exceeding 25% of graph are recursively split via Leiden algorithm.
23-
- **4 new languages**: Zig, PowerShell, Julia, Svelte SFC (23 total).
24-
- **Visualization enhancements**: node size scaled by degree, community legend with toggle visibility, improved interactivity.
25-
- **README translations**: Simplified Chinese, Japanese, Korean, Hindi.
26-
27-
### Merged community PRs
28-
29-
- **#127** (xtfer): SQLite compound edge indexes for query performance.
30-
- **#184** (realkotob): batch `_compute_summaries` — fixes build hangs on large repos.
31-
- **#202** (lngyeen): Swift extension detection, inheritance edges, type kind metadata.
32-
- **#249** (gzenz): community detection resolution scaling (21x speedup), expanded framework patterns, framework-aware dead code detection (56 new tests).
33-
- **#253** (cwoolum): automatic graph build for new worktrees in Claude Code.
34-
- **#267** (jindalarpit): Kiro platform support with 9 tests.
35-
36-
### Changed
37-
38-
- MCP tool count: 22 → 28.
39-
- Schema version: 8 → 9 (edge confidence columns).
40-
- Community detection uses resolution scaling for large graphs.
41-
- Risk scoring uses weighted flow criticality and graduated test coverage.
42-
- Dead code detection is framework-aware (ORM models, Pydantic, CDK constructs filtered).
43-
- Flow entry points expanded with 30+ framework decorator patterns.
44-
455
## [2.3.1] - 2026-04-11
466

477
Hotfix for the Windows long-running-MCP-tool hang that v2.2.4 only partially fixed.
@@ -150,14 +110,50 @@ Hotfix on top of 2.2.3 for two bugs surfaced by a full first-time-user smoke tes
150110

151111
### Added
152112
- **Codex platform install support** (PR #177): `code-review-graph install --platform codex` appends a `mcp_servers.code-review-graph` section to `~/.codex/config.toml` without overwriting existing Codex settings.
153-
- **Luau language support** (PR #165, closes #153): Roblox Luau (`.luau`) parsing functions, classes, local functions, requires, tests.
113+
- **Luau language support** (PR #165, closes #153): Roblox Luau (`.luau`) parsing -- functions, classes, local functions, requires, tests.
154114
- **REFERENCES edge type** (PR #217): New edge kind for symbol references that aren't direct calls (map/dispatch lookups, string-keyed handlers), including Python and TypeScript patterns.
155115
- **`recurse_submodules` build option** (PR #215): Build/update can now optionally recurse into git submodules.
156116
- **`.gitignore` default for `.code-review-graph/`** (PR #185): Fresh installs automatically add the SQLite DB directory to `.gitignore` so the database isn't accidentally committed.
157117
- **Clearer gitignore docs** (PR #171, closes #157): Documentation now spells out that `code-review-graph` already respects `.gitignore` via `git ls-files`.
118+
- **Parser refactoring**: Extracted 16 per-language handler modules into `code_review_graph/lang/` package using a strategy pattern, replacing monolithic conditionals in `parser.py`
119+
- **Jedi-based call resolution**: New `jedi_resolver.py` module resolves Python method calls at build time via Jedi static analysis, with pre-scan filtering by project function names (36s to 3s on large repos)
120+
- **PreToolUse search enrichment**: New `enrich.py` module and `code-review-graph enrich` CLI command inject graph context (callers, callees, flows, community, tests) into agent search results passively
121+
- **Typed variable call enrichment**: Track constructor-based type inference and instance method calls for Python, JS/TS, and Kotlin/Java
122+
- **Star import resolution**: Resolve `from module import *` by scanning target module's exported names
123+
- **Namespace imports**: Track `import * as X from 'module'` and CommonJS `require()` patterns
124+
- **Angular template parsing**: Extract call targets from Angular component templates
125+
- **JSX handler tracking**: Detect function/class references passed as JSX event handler props
126+
- **Framework decorator recognition**: Identify entry points decorated with `@app.route`, `@router.get`, `@cli.command`, etc., reducing dead code false positives
127+
- **Module-level import tracking**: Track module-qualified call resolution (`module.function()`)
128+
- **Thread safety**: Double-check locking on parser caches (`_type_sets`, `_get_parser`, `_resolve_module_to_file`, `_get_exported_names`)
129+
- **Batch file storage**: `store_file_batch()` groups file insertions into 50-file transactions for faster builds
130+
- **Bulk node loading**: `get_all_nodes()` replaces per-file SQL queries for community detection
131+
- **Adjacency-indexed cohesion**: Community cohesion computed in O(community-edges) instead of O(all-edges), yielding 21x speedup (48.6s to 2.3s on 41k-node repos)
132+
- **Phase timing instrumentation**: `time.perf_counter()` timing at INFO level for all build phases
133+
- **Batch risk_index**: 2 GROUP BY queries replace per-node COUNT loops in risk scoring
134+
- **Weighted flow risk scoring**: Risk scores weighted by flow criticality instead of flat edge counts
135+
- **Transitive TESTED_BY lookup**: `tests_for` and risk scoring follow transitive test relationships
136+
- **DB schema v8**: Composite edge index for upsert performance (v7 reserved by upstream PR #127)
137+
- **`--quiet` and `--json` CLI flags**: Machine-readable output for `build`, `update`, `status`
138+
- **829+ tests** across 26 test files (up from 615), including `test_pain_points.py` (1,587 lines TDD suite), `test_hardened.py` (467 lines), `test_enrich.py` (237 lines)
139+
- **14 new test fixtures**: Kotlin, Java, TypeScript, JSX, Python resolution scenarios
158140

159141
### Changed
160-
- Community detection is now bounded — large repos complete in reasonable time instead of hanging indefinitely.
142+
- Community detection is now bounded -- large repos complete in reasonable time instead of hanging indefinitely.
143+
- New `[enrichment]` optional dependency group for Jedi-based Python call resolution
144+
- Leiden community detection scales resolution parameter with graph size
145+
- Adaptive directory-based fallback for community detection when Leiden produces poor clusters
146+
- Search query deduplication and test function deprioritization
147+
148+
### Fixed
149+
- **Dead code false positives**: Decorators, CDK construct methods, abstract overrides, and overriding methods with called parents no longer flagged as dead
150+
- **E2e test exclusion**: Playwright/Cypress e2e test directories excluded from dead code detection
151+
- **Unique-name plausible caller optimization**: Faster dead code analysis via pre-filtered candidate sets
152+
- **Store cache liveness check**: Cached SQLite connections verified as alive before reuse
153+
154+
### Performance
155+
- **Community detection**: 48.6s to 2.3s (21x) on Gadgetbridge (41k nodes, 280k edges)
156+
- **Jedi enrichment**: 36s to 3s (12x) via pre-scan filtering by project function names
161157

162158
## [2.2.2] - 2026-04-08
163159

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ When using code-review-graph MCP tools, follow these rules:
4646

4747
```bash
4848
# Development
49-
uv run pytest tests/ --tb=short -q # Run tests (572 tests)
49+
uv run pytest tests/ --tb=short -q # Run tests (609 tests)
5050
uv run ruff check code_review_graph/ # Lint
5151
uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optional
5252

0 commit comments

Comments
 (0)