Skip to content
Merged
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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [3.1.3](https://github.com/optave/codegraph/compare/v3.1.2...v3.1.3) (2026-03-11)

**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](https://github.com/optave/codegraph/pull/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](https://github.com/optave/codegraph/pull/414))
* **native:** track `import()` expressions in Rust extractor — adds `dynamicImport` field to `Import` struct, matching WASM behavior for dead-export analysis ([#418](https://github.com/optave/codegraph/pull/418))
* **native:** report correct native package version in `codegraph info` — reads from platform npm package.json instead of binary-embedded version ([#418](https://github.com/optave/codegraph/pull/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](https://github.com/optave/codegraph/pull/418))
* **parser:** add `disposeParsers()` to release cached WASM parsers/queries; call `tree.delete()` after AST analysis to prevent segfaults on repeated builds ([#418](https://github.com/optave/codegraph/pull/418))
* **queries:** hoist prepared statement out of BFS loop in `getClassHierarchy` ([#403](https://github.com/optave/codegraph/pull/403))
* **ci:** only trigger Claude automated review on PR open, not every push ([#419](https://github.com/optave/codegraph/pull/419))

### Performance

* **db:** extract `cachedStmt` utility into `src/db/repository/cached-stmt.js` — reusable prepared statement caching for hot-path repository functions ([#417](https://github.com/optave/codegraph/pull/417), [#402](https://github.com/optave/codegraph/pull/402))

## [3.1.2](https://github.com/optave/codegraph/compare/v3.1.1...v3.1.2) (2026-03-11)

**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.
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/BACKLOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codegraph Feature Backlog

**Last updated:** 2026-03-11
**Last updated:** 2026-03-12
**Source:** Features derived from [COMPETITIVE_ANALYSIS.md](../../generated/competitive/COMPETITIVE_ANALYSIS.md) and internal roadmap discussions.

---
Expand Down
6 changes: 4 additions & 2 deletions docs/roadmap/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codegraph Roadmap

> **Current version:** 3.1.2 | **Status:** Active development | **Updated:** March 2026
> **Current version:** 3.1.3 | **Status:** Active development | **Updated:** March 2026
Codegraph is a strong local-first code graph CLI. This roadmap describes planned improvements across ten phases -- closing gaps with commercial code intelligence platforms while preserving codegraph's core strengths: fully local, open source, zero cloud dependency by default.

Expand All @@ -16,7 +16,7 @@ Codegraph is a strong local-first code graph CLI. This roadmap describes planned
| [**2**](#phase-2--foundation-hardening) | Foundation Hardening | Parser registry, complete MCP, test coverage, enhanced config, multi-repo MCP | **Complete** (v1.4.0) |
| [**2.5**](#phase-25--analysis-expansion) | Analysis Expansion | Complexity metrics, community detection, flow tracing, co-change, manifesto, boundary rules, check, triage, audit, batch, hybrid search | **Complete** (v2.6.0) |
| [**2.7**](#phase-27--deep-analysis--graph-enrichment) | Deep Analysis & Graph Enrichment | Dataflow analysis, intraprocedural CFG, AST node storage, expanded node/edge types, extractors refactoring, CLI consolidation, interactive viewer, exports command, normalizeSymbol | **Complete** (v3.0.0) |
| [**3**](#phase-3--architectural-refactoring) | Architectural Refactoring (Vertical Slice) | Unified AST analysis framework, command/query separation, repository pattern, queries.js decomposition, composable MCP, CLI commands, domain errors, presentation layer, domain grouping, curated API, unified graph model | **In Progress** (v3.1.2) |
| [**3**](#phase-3--architectural-refactoring) | Architectural Refactoring (Vertical Slice) | Unified AST analysis framework, command/query separation, repository pattern, queries.js decomposition, composable MCP, CLI commands, domain errors, presentation layer, domain grouping, curated API, unified graph model | **In Progress** (v3.1.3) |
| [**4**](#phase-4--typescript-migration) | TypeScript Migration | Project setup, core type definitions, leaf -> core -> orchestration module migration, test migration | Planned |
| [**5**](#phase-5--intelligent-embeddings) | Intelligent Embeddings | LLM-generated descriptions, enhanced embeddings, build-time semantic metadata, module summaries | Planned |
| [**6**](#phase-6--natural-language-queries) | Natural Language Queries | `ask` command, conversational sessions, LLM-narrated graph queries, onboarding tools | Planned |
Expand Down Expand Up @@ -652,6 +652,8 @@ src/
> **v3.1.1 progress:** `src/db/` directory created with `repository.js` (134 lines), `query-builder.js` (280 lines), and `migrations.js` (312 lines). All db usage across the codebase wrapped in try/finally for reliable `db.close()` ([#371](https://github.com/optave/codegraph/pull/371), [#384](https://github.com/optave/codegraph/pull/384), [#383](https://github.com/optave/codegraph/pull/383)).
>
> **v3.1.2 progress:** `repository.js` split into `src/db/repository/` directory with 10 domain files (nodes, edges, build-stmts, complexity, cfg, dataflow, cochange, embeddings, graph-read, barrel). Raw SQL migrated from 14 src/ modules into repository layer. `connection.js` already complete (89 lines handling open/close/WAL/pragma/locks/readonly).
>
> **v3.1.3 progress:** Extracted `cachedStmt` utility into `src/db/repository/cached-stmt.js` — reusable prepared statement caching for hot-path repository functions ([#417](https://github.com/optave/codegraph/pull/417), [#402](https://github.com/optave/codegraph/pull/402)).
-`src/db/` directory structure created
-`repository/` — domain-split repository (nodes, edges, build-stmts, complexity, cfg, dataflow, cochange, embeddings, graph-read)
Expand Down
13 changes: 2 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@optave/codegraph",
"version": "3.1.2",
"version": "3.1.3",
"description": "Local code graph CLI — parse codebases with tree-sitter, build dependency graphs, query them",
"type": "module",
"main": "src/index.js",
Expand Down
Loading