fix: add sqlite edge compound indexes#127
Conversation
|
Original commit made a bunch of unrelated line changes. |
|
CI failed on the |
Resolves migration numbering conflict: our composite edge index renumbered from v6 to v8 (v7 reserved by upstream PR tirth8205#127). Skills.py conflict resolved keeping our hooks structure with upstream's encoding fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
|
@tirth8205 Updated SUPPORTED_SCHEMA_VERSION to 7 as requested. |
Review: PR #127 — Branch WarningBranch conflict: This PR is from Recommendation: Please create a dedicated branch (e.g., The code itself is correct: The v7 migration adding Cannot merge as-is due to the |
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
…izations Major improvements to code-review-graph spanning parser architecture, call graph accuracy, and build performance. Parser refactoring: - Extract 16 per-language handler modules into code_review_graph/lang/ using a strategy pattern, replacing monolithic conditionals in parser.py - Thread-safe parser caches with double-check locking Call graph enrichment: - Jedi-based Python method call resolution at build time (jedi_resolver.py) - Pre-scan filtering by project function names (36s to 3s on large repos) - Typed variable call enrichment (Python, JS/TS, Kotlin/Java) - Star import resolution, namespace imports, CommonJS require() - Angular template parsing, JSX handler tracking - Module-level import tracking and module-qualified call resolution - Function/class references passed as call arguments PreToolUse search enrichment: - New enrich.py module and code-review-graph enrich CLI command - Injects graph context (callers, flows, community, tests) into agent search results passively via hook Dead code false positive reduction: - Framework decorators recognized as entry points - CDK construct methods, abstract overrides excluded - E2e test directories excluded from dead code detection Performance: - Community detection: 48.6s to 2.3s (21x speedup) via bulk node loading and adjacency-indexed cohesion computation - Jedi enrichment: 36s to 3s (12x) via pre-scan filtering - Batch file storage (50-file transactions) - Batch risk_index (2 GROUP BY queries replace per-node loops) Other: - Weighted flow risk scoring by criticality - Transitive TESTED_BY lookup for tests_for and risk scoring - DB schema v8: composite edge index (v7 reserved by PR tirth8205#127) - --quiet and --json CLI flags - Search query deduplication, test function deprioritization - New [enrichment] optional dependency group for Jedi - 829+ tests across 26 test files (up from 615) Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS, call resolution rate improved from 28% to 39.6%.
15 new features: hub/bridge node detection, knowledge gap analysis, surprise scoring, suggested questions, BFS/DFS traversal, edge confidence scoring, export formats (GraphML/Neo4j/Obsidian/SVG), graph diff, token benchmarking, memory loop, community auto-splitting, 4 new languages (Zig/PowerShell/Julia/Svelte), visualization enhancements (degree-scaled nodes, community legend toggles). 6 community PRs merged: #127, #184, #202, #249, #253, #267. 28 MCP tools (was 22). Schema v9. 788 tests pass. README translations: zh-CN, ja-JP, ko-KR, hi-IN. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add sqlite edge compound indexes * Revert "fix: add sqlite edge compound indexes" This reverts commit 9fc1f8f. * fix: add sqlite edge compound indexes * Update supported schema version to 7
CLAUDE.md: - Update graph DB baseline to schema v7 / 1914 nodes / 20966 edges - Flip "Git subprocess / MCP stdio" defect from OPEN to RESOLVED, reference the DEVNULL fix commit f0f8c35 - Add Upstream Sync Policy section documenting what landed (tirth8205#184, tirth8205#216, tirth8205#127), what's hard-skipped (tirth8205#231, tirth8205#253), and what's gated (tirth8205#249 on synthetic-node bypass confirmation) - Inline the v7-slot occupation hazard so future upstream pulls see the landmine before renumbering goes wrong - Note that MCP scope is user, not project .mcp.json: - Remove the project-scope code-review-graph entry that was shadowing the user-scope fork binary with upstream PyPI. User scope now wins unambiguously. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
edges(target_qualified, kind)andedges(source_qualified, kind)so summary, impact, and risk-oriented queries avoid unnecessary scans on larger graphsv7schema migration so existing databases pick up the new indexes automatically, not just fresh installsIssue
Some graph queries commonly filter on both a qualified symbol and the edge
kind, but the schema only had separate indexes for those columns. That meant SQLite could not optimize those lookups as effectively as it should, which can show up as avoidable work when generating summaries or running risk-related queries against bigger databases.Testing
uv run pytest tests/test_migrations.py tests/test_graph.py -q