Skip to content

Commit 6370b6e

Browse files
committed
chore: release v3.1.1
Bump version to 3.1.1 across package.json, package-lock.json, Cargo.toml. Add CHANGELOG entry with all commits since v3.1.0. Update ROADMAP to reflect Phase 3 progress (3.2, 3.3, 3.4 started).
1 parent a8fb530 commit 6370b6e

5 files changed

Lines changed: 90 additions & 39 deletions

File tree

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
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.
44

5+
## [3.1.1](https://github.com/optave/codegraph/compare/v3.1.0...v3.1.1) (2026-03-08)
6+
7+
**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.
8+
9+
### Features
10+
11+
* **hooks:** add pre-commit hooks for cycles, dead exports, signature warnings ([#381](https://github.com/optave/codegraph/pull/381))
12+
* **benchmark:** add 1-file rebuild phase breakdown to build benchmarks ([#370](https://github.com/optave/codegraph/pull/370))
13+
14+
### Bug Fixes
15+
16+
* **cycles:** break circular dependency cycle and remove dead `queryName` export ([#378](https://github.com/optave/codegraph/pull/378))
17+
* **queries:** use `CORE_SYMBOL_KINDS` in flow matching ([#382](https://github.com/optave/codegraph/pull/382))
18+
* **mcp:** defer heavy imports in MCP server for first-connect reliability ([#380](https://github.com/optave/codegraph/pull/380))
19+
20+
### Refactors
21+
22+
* wrap all db usage in try/finally for reliable `db.close()` ([#384](https://github.com/optave/codegraph/pull/384), [#383](https://github.com/optave/codegraph/pull/383))
23+
* repository pattern for data access ([#371](https://github.com/optave/codegraph/pull/371))
24+
* command/query separation — extract CLI wrappers, shared output helper ([#373](https://github.com/optave/codegraph/pull/373))
25+
26+
### Chores
27+
28+
* **ci:** allow `merge` type in commitlint config ([#385](https://github.com/optave/codegraph/pull/385))
29+
* **deps-dev:** bump tree-sitter-go from 0.23.4 to 0.25.0 ([#356](https://github.com/optave/codegraph/pull/356))
30+
531
## [3.1.0](https://github.com/optave/codegraph/compare/v3.0.4...v3.1.0) (2026-03-08)
632

733
**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.

crates/codegraph-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "codegraph-core"
3-
version = "3.1.0"
3+
version = "3.1.1"
44
edition = "2021"
55
license = "Apache-2.0"
66

docs/roadmap/ROADMAP.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Codegraph Roadmap
22

3-
> **Current version:** 3.0.0 | **Status:** Active development | **Updated:** March 2026
3+
> **Current version:** 3.1.1 | **Status:** Active development | **Updated:** March 2026
44
55
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.
66

@@ -16,7 +16,7 @@ Codegraph is a strong local-first code graph CLI. This roadmap describes planned
1616
| [**2**](#phase-2--foundation-hardening) | Foundation Hardening | Parser registry, complete MCP, test coverage, enhanced config, multi-repo MCP | **Complete** (v1.4.0) |
1717
| [**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) |
1818
| [**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) |
19-
| [**3**](#phase-3--architectural-refactoring) | Architectural Refactoring | Unified AST analysis framework, command/query separation, repository pattern, queries.js decomposition, composable MCP, CLI commands, domain errors, curated API, unified graph model | Planned |
19+
| [**3**](#phase-3--architectural-refactoring) | Architectural Refactoring | Unified AST analysis framework, command/query separation, repository pattern, queries.js decomposition, composable MCP, CLI commands, domain errors, curated API, unified graph model | **In Progress** (v3.1.1) |
2020
| [**4**](#phase-4--typescript-migration) | TypeScript Migration | Project setup, core type definitions, leaf -> core -> orchestration module migration, test migration | Planned |
2121
| [**5**](#phase-5--intelligent-embeddings) | Intelligent Embeddings | LLM-generated descriptions, enhanced embeddings, build-time semantic metadata, module summaries | Planned |
2222
| [**6**](#phase-6--natural-language-queries) | Natural Language Queries | `ask` command, conversational sessions, LLM-narrated graph queries, onboarding tools | Planned |
@@ -552,7 +552,9 @@ Plus updated enums on existing tools (edge_kinds, symbol kinds).
552552

553553
---
554554

555-
## Phase 3 -- Architectural Refactoring
555+
## Phase 3 -- Architectural Refactoring 🔄
556+
557+
> **Status:** In Progress -- started in v3.1.1
556558
557559
**Goal:** Restructure the codebase for modularity, testability, and long-term maintainability. These are internal improvements -- no new user-facing features, but they make every subsequent phase easier to build and maintain.
558560

@@ -591,7 +593,16 @@ A single AST walk with pluggable visitors eliminates 3 redundant tree traversals
591593

592594
**Affected files:** `src/complexity.js`, `src/cfg.js`, `src/dataflow.js`, `src/ast.js` -> split into `src/ast-analysis/`
593595

594-
### 3.2 -- Command/Query Separation ★ Critical
596+
### 3.2 -- Command/Query Separation ★ Critical 🔄
597+
598+
> **v3.1.1 progress:** CLI display wrappers for all query commands extracted to `queries-cli.js` (866 lines, 15 functions). Shared `result-formatter.js` (`outputResult()` for JSON/NDJSON) and `test-filter.js` created. `queries.js` reduced from 3,395 → 2,490 lines — all `*Data()` functions remain, CLI formatting fully separated ([#373](https://github.com/optave/codegraph/pull/373)).
599+
600+
-`queries.js` CLI wrappers → `queries-cli.js` (15 functions)
601+
- ✅ Shared `result-formatter.js` (`outputResult` for JSON/NDJSON dispatch)
602+
- ✅ Shared `test-filter.js` (`isTestFile` predicate)
603+
- 🔲 Extract CLI wrappers from remaining modules (audit, batch, check, cochange, communities, complexity, cfg, dataflow, flow, manifesto, owners, structure, triage, branch-compare)
604+
- 🔲 Introduce `CommandRunner` shared lifecycle
605+
- 🔲 Per-command `src/commands/` directory structure
595606

596607
Eliminate the `*Data()` / `*()` dual-function pattern replicated across 19 modules. Every analysis module (queries, audit, batch, check, cochange, communities, complexity, cfg, dataflow, ast, flow, manifesto, owners, structure, triage, branch-compare, viewer) currently implements both data extraction AND CLI formatting.
597608

@@ -616,7 +627,17 @@ src/
616627

617628
**Affected files:** All 19 modules with dual-function pattern, `src/cli.js`, `src/mcp.js`
618629

619-
### 3.3 -- Repository Pattern for Data Access ★ Critical
630+
### 3.3 -- Repository Pattern for Data Access ★ Critical 🔄
631+
632+
> **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)).
633+
634+
-`src/db/` directory structure created
635+
-`repository.js` — initial Repository class
636+
-`query-builder.js` — lightweight SQL builder (280 lines)
637+
-`migrations.js` — schema migrations extracted (312 lines)
638+
- ✅ All db usage wrapped in try/finally for reliable `db.close()`
639+
- 🔲 Migrate remaining raw SQL from 25+ modules into Repository
640+
- 🔲 `connection.js` — extract connection setup (open, WAL mode, pragma tuning)
620641

621642
Consolidate all SQL into a single `Repository` class. Currently SQL is scattered across 25+ modules that each independently open the DB and write raw SQL inline across 13 tables.
622643

@@ -633,7 +654,14 @@ Add a query builder for the common pattern "find nodes WHERE kind IN (...) AND f
633654

634655
**Affected files:** `src/db.js` -> split into `src/db/`, SQL extracted from all modules
635656

636-
### 3.4 -- Decompose queries.js (3,395 Lines)
657+
### 3.4 -- Decompose queries.js (3,395 Lines) 🔄
658+
659+
> **v3.1.1 progress:** `queries.js` reduced from 3,395 → 2,490 lines by extracting all CLI formatting to `queries-cli.js` (3.2). Symbol kind constants extracted to `kinds.js` (49 lines) ([#378](https://github.com/optave/codegraph/pull/378)).
660+
661+
- ✅ CLI formatting separated → `queries-cli.js` (via 3.2)
662+
-`kinds.js` — symbol kind constants extracted
663+
- 🔲 Split remaining `queries.js` data functions into `src/analysis/` modules
664+
- 🔲 Extract `shared/normalize.js`, `shared/generators.js`
637665

638666
Split into pure analysis modules that return data and share no formatting concerns.
639667

package-lock.json

Lines changed: 28 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@optave/codegraph",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"description": "Local code graph CLI — parse codebases with tree-sitter, build dependency graphs, query them",
55
"type": "module",
66
"main": "src/index.js",

0 commit comments

Comments
 (0)