Skip to content

Releases: optave/codegraph

v3.1.3

12 Mar 02:05
6d2ac93

Choose a tag to compare

Bug fixes and build instrumentation. This patch fixes WASM builds silently producing zero complexity rows, resolves four dogfood-reported issues (benchmark crash resilience, WASM parser memory cleanup, native dynamic import tracking, stale native version reporting), and adds missing build phase timers so setupMs and finalizeMs now account for the previously untracked ~45% of total build time. Prepared statement caching is extracted into a reusable cachedStmt utility.

Features

  • builder: add setupMs and finalizeMs phase timers to buildGraph — closes the ~45% gap in phase breakdown accounting (#415)

Bug Fixes

  • complexity: fix WASM builds producing zero function_complexity rows — incorrect import alias caused findFunctionNode to be undefined in WASM-only path (#414)
  • native: track import() expressions in Rust extractor — adds dynamicImport field to Import struct, matching WASM behavior for dead-export analysis (#418)
  • native: report correct native package version in codegraph info — reads from platform npm package.json instead of binary-embedded version (#418)
  • benchmark: wrap engine calls in try/catch so one engine failure doesn't prevent the other from running; fix embedding benchmark disposeModel leak (#418)
  • parser: add disposeParsers() to release cached WASM parsers/queries; call tree.delete() after AST analysis to prevent segfaults on repeated builds (#418)
  • queries: hoist prepared statement out of BFS loop in getClassHierarchy (#403)
  • ci: only trigger Claude automated review on PR open, not every push (#419)

Performance

  • db: extract cachedStmt utility into src/db/repository/cached-stmt.js — reusable prepared statement caching for hot-path repository functions (#417, #402)

Dev build 3.1.9-dev.cc991ab

12 Mar 10:57
cc991ab

Choose a tag to compare

Pre-release

Dev build from commit cc991aba5bef729158209444d780a0bfa4e582a5 on main.

Dev build 3.1.8-dev.b76433f

12 Mar 09:13
b76433f

Choose a tag to compare

Pre-release

Dev build from commit b76433fb4f19d6c8dc290ca0621dc98a51c1bbe9 on main.

v3.1.2

11 Mar 07:22
21ba896

Choose a tag to compare

Phase 3 architectural refactoring reaches substantial completion. This release finishes the unified AST analysis framework (Phase 3.1) — all four analyses (complexity, CFG, dataflow, AST-store) now run in a single DFS walk via pluggable visitors, with cfg.js shrinking from 1,242 to 518 lines and cyclomatic complexity derived directly from CFG structure. CLI command/query separation (Phase 3.2) moves ~1,059 lines of formatting code into a dedicated src/commands/ directory. Repository pattern migration (Phase 3.3) extracts raw SQL from 14 source modules. Dynamic import() expressions are now tracked as dynamic-imports graph edges, fixing false positives in dead-export analysis and impact tracing. Prepared statement caching cuts hot-path DB overhead in the repository layer.

Features

  • ast-analysis: unified AST analysis framework — shared DFS walker with pluggable enterNode/exitNode/enterFunction/exitFunction hooks; complexity, CFG, AST-store, and dataflow visitors in a single coordinated pass (#388)
  • cfg: CFG visitor rewrite — node-level DFS visitor replaces statement-level buildFunctionCFG, Mode A/B split eliminated; cyclomatic complexity now derived from CFG (E - N + 2); cfg.js reduced from 1,242 → 518 lines (#392)
  • commands: extract CLI wrappers into src/commands/ directory (Phase 3.2) — command/query separation complete across all 19 analysis modules; src/infrastructure/ added for shared result-formatter.js and test-filter.js (#393)
  • builder: track dynamic import() expressions as dynamic-imports graph edges — destructured names feed into call resolution, fixing false "zero consumers" in dead-export analysis (#389)

Bug Fixes

  • hooks: fix check-dead-exports hook silently no-ops on ESM codebases (#394)
  • hooks: guard pre-push hook against sh -e failure when diff-impact is unavailable
  • complexity: remove function nodes from nestingNodeTypes and eliminate O(n²) lookup
  • complexity: remove function nesting inflation in computeAllMetrics and pass langId to LOC
  • ast-analysis: guard runAnalyses call, fix nested function nesting, rename _engineOpts
  • ast-analysis: fix Halstead skip depth counter, debug logging, perf import

Performance

  • db: cache prepared statements in hot-path repository functions — avoids repeated statement compilation on incremental builds

Refactors

  • migrate raw SQL from 14 source modules into repository pattern (Phase 3.3) — src/db/repository/ split into 10 domain files (nodes, edges, build-stmts, complexity, cfg, dataflow, cochange, embeddings, graph-read, barrel)
  • address Greptile review — deduplicate relatedTests, hoist prepared stmts, fix .raw() no-op

v3.1.1

09 Mar 06:09
8cab5d2

Choose a tag to compare

Reliability, architecture, and MCP cold-start fixes. This patch breaks a circular dependency cycle, fixes MCP server first-connect reliability by deferring heavy imports, corrects flow matching to use core symbol kinds, and refactors all database access to use try/finally for reliable db.close(). Internal architecture improves with repository pattern for data access and command/query separation.

Features

  • hooks: add pre-commit hooks for cycles, dead exports, signature warnings (#381)
  • benchmark: add 1-file rebuild phase breakdown to build benchmarks (#370)

Bug Fixes

  • cycles: break circular dependency cycle and remove dead queryName export (#378)
  • queries: use CORE_SYMBOL_KINDS in flow matching (#382)
  • mcp: defer heavy imports in MCP server for first-connect reliability (#380)

Refactors

  • wrap all db usage in try/finally for reliable db.close() (#384, #383)
  • repository pattern for data access (#371)
  • command/query separation — extract CLI wrappers, shared output helper (#373)

Chores

  • ci: allow merge type in commitlint config (#385)
  • deps-dev: bump tree-sitter-go from 0.23.4 to 0.25.0 (#356)

v3.1.0

08 Mar 09:44
81544df

Choose a tag to compare

Sequence diagrams, native engine performance leap, and unused export detection. This release adds codegraph sequence for Mermaid sequence diagram generation from call graph edges, delivers major native engine build optimizations (deep-clone elimination, batched SQLite inserts, call edge building in Rust, FS caching, rayon-parallel import resolution), introduces --unused on the exports command to detect dead exports, and fixes an ~80x native no-op rebuild regression.

Features

  • sequence: add codegraph sequence <name> command for Mermaid sequence diagram generation from call graph edges — participants are files, BFS forward from entry point, optional --dataflow flag for parameter/return annotations; exposed via CLI, MCP tool, and programmatic API (#345)
  • exports: add --unused flag to codegraph exports — new exported column (migration v14) populated from parser export declarations, enabling detection of symbols declared as exports but with zero consumers (#361)

Performance

  • native: eliminate deep-clone in normalizeNativeSymbols — replace 125-line JS deep-clone with in-place patchNativeResult via #[napi(js_name)] annotations on Rust types (#361)
  • native: add include_ast_nodes flag to parse_file/parse_files — initial parse skips AST node walking, saving ~200ms (#361)
  • native: move call/receiver/extends edge building to Rust (edge_builder.rs) — narrowest-span caller resolution, confidence sorting, dedup via u64 edge keys (#361)
  • native: add known_files HashSet cache to resolve_imports_batch — avoids redundant FS syscalls during import resolution (#361)
  • native: parallelize resolve_imports_batch with rayon for concurrent import resolution (#361)
  • builder: batch SQLite multi-value INSERTs — accumulate node/edge rows and flush with chunked INSERT statements (200 rows per chunk) instead of individual prepared statement runs (#361)

Bug Fixes

  • native: fix no-op rebuild regression (~80x slower than WASM) — extToLang map was not built when native engine provided pre-computed CFG, causing langId lookup to return null and triggering full re-parse on every incremental build (#360)
  • native: pass full file list to known_files cache — on incremental builds only changed files were passed, causing valid import targets to be dropped (#361)
  • benchmark: install native package explicitly in npm benchmark mode (#351)

Documentation

  • reorder README to be AI-first throughout (#362)
  • add MCP tool surface optimization proposal (#363)
  • update build performance, query, and incremental benchmarks for 3.0.4 (#352, #353, #354)

Chores

  • deps: bump graphology from 0.25.4 to 0.26.0 (#358)
  • deps-dev: bump @biomejs/biome from 2.4.4 to 2.4.6 (#359)
  • deps-dev: bump @commitlint/cli from 20.4.2 to 20.4.3 (#357)
  • deps-dev: bump @commitlint/config-conventional (#355)

v3.0.4 Performance

06 Mar 07:10
01d554f

Choose a tag to compare

Native engine goes full-stack: CFG, AST nodes, and WASM double-parse elimination. This release completes the native engine migration — CFG computation and AST node extraction now run in Rust for 8 languages, eliminating the redundant WASM pre-parse on native builds.

Performance

  • native: compute CFG in Rust native engine for all 8 languages (JS/TS/TSX, Python, Go, Rust, Java, C#, Ruby, PHP) — ports buildFunctionCFG algorithm to Rust with per-language CfgRules, eliminates WASM re-parsing in CFG phase (#342)
  • native: extract AST nodes (call, new, throw, await, string, regex) for all non-JS languages in Rust via shared walk_ast_nodes_with_config() — astMs drops from ~651ms to ~50ms (#340)
  • builder: skip ensureWasmTrees entirely when native engine provides complete CFG + dataflow + AST data — wasmPreMs drops from ~388ms to 0 on native builds (#344)

Bug Fixes

  • native: fix function-scoped const declarations being incorrectly extracted as top-level constants (#344)
  • benchmark: show all build phases (astMs, cfgMs, dataflowMs, wasmPreMs) in benchmark report and document v3.0.0→v3.0.3 native regression cause (#339)

3.0.3 (2026-03-04)

Note: 3.0.2 was an internal/unpublished version used during development.

v3.0.3 Performance

04 Mar 08:28
c24f063

Choose a tag to compare

Performance

  • ast: use single transaction for AST node insertion — astMs drops from ~3600ms to ~350ms (native) and ~547ms (WASM), reducing overall native build from 24.9 to 8.5 ms/file (#333)

v3.0.2 Patch

04 Mar 07:09
45a55e5

Choose a tag to compare

Dataflow goes multi-language, build performance recovery, and native engine parity fixes. This patch extends dataflow analysis from JS/TS-only to all 11 supported languages, recovers build performance lost after CFG/dataflow became default-on, fixes language-aware identifier collection in dataflow, and closes a native engine scoping bug for constants.

Features

  • dataflow: extend dataflow analysis to all supported languages (Python, Go, Rust, Java, C#, PHP, Ruby) with per-language DATAFLOW_RULES and makeDataflowRules() factory (#318)

Bug Fixes

  • dataflow: use isIdent in collectIdentifiers for language-aware referencedNames — fixes PHP variable_name and other non-identifier node types being missed in return statements (#324)
  • native: skip local constants inside function bodies — the native JS extractor incorrectly extracted function-scoped const as top-level constants (#327)
  • native: enable extended kinds (parameters, properties, constants, receivers) in parity tests and update native binary to v3.0.1 (#327)

Performance

  • builder: fix v3.0.1 build performance regression (14.1 → ~5.8 ms/file) — eliminate redundant WASM parsing via ensureWasmTrees(), memoize createParsers(), filter CFG/dataflow to changed files only (#325)

Documentation

  • update build performance, query, and incremental benchmarks for 3.0.1 (#321, #322, #323)

v3.0.1 Patch

04 Mar 04:52
e112bf6

Choose a tag to compare

Post-release fixes and dataflow multi-language expansion. This patch extends dataflow analysis (flows_to, returns, mutates edges) from JS/TS-only to all 11 supported languages, enables --cfg and --dataflow by default on builds, closes several native/WASM engine parity gaps, and fixes miscellaneous issues found during v3.0.0 dogfooding.

Features

  • dataflow: extend dataflow analysis to all supported languages (Python, Go, Rust, Java, C#, PHP, Ruby, Terraform) (221a791)
  • builder: enable --cfg and --dataflow by default on builds (#312)

Bug Fixes

  • native: close engine parity gap between native and WASM (#292) (#309)
  • native: extract new/throw/await/string/regex AST nodes in native engine (#306) (#314)
  • native: bump native engine version to 3.0.0 (#305) (#310)
  • queries: include role-based entry points in flow --list (#313)
  • benchmark: handle missing WASM grammars gracefully in benchmark scripts (#311)
  • ci: prevent duplicate benchmark PRs on stable releases (#304)

Documentation

  • document dataflow multi-language support in README (851f060)
  • mark resolved bugs and suggestions in dogfood reports (#316)
  • add dogfood report for v3.0.0 (#307)
  • update build performance, query, and incremental benchmarks for 3.0.0 (#298, #299, #300)

Chores

  • ci: include Cargo.toml in publish version bump commit (#315)
  • ci: replace npm ci with npm install in benchmark and license workflows (#308)