Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f5ee3de
chore: remove dead exports and un-export internal constant
carlos-alm Mar 17, 2026
f236b55
Merge remote-tracking branch 'origin/main' into worktree-titan-recon
carlos-alm Mar 17, 2026
17cdcb0
refactor: extract shared findNodes utility from cfg and dataflow feat…
carlos-alm Mar 17, 2026
a09740d
fix: replace empty catch blocks in db connection and migrations
carlos-alm Mar 17, 2026
b691fcc
fix: replace empty catch blocks in domain analysis layer
carlos-alm Mar 17, 2026
dadb383
fix: replace empty catch blocks in parser.js
carlos-alm Mar 17, 2026
22d94f4
fix: replace empty catch blocks in features layer
carlos-alm Mar 17, 2026
3b36534
refactor: decompose extractSymbolsWalk into per-category handlers
carlos-alm Mar 17, 2026
e1d7ee0
refactor: decompose extractPythonSymbols into per-category handlers
carlos-alm Mar 17, 2026
3a656bb
refactor: decompose extractJavaSymbols into per-category handlers
carlos-alm Mar 17, 2026
bf5b986
refactor: decompose remaining language extractors
carlos-alm Mar 17, 2026
eafdf19
refactor: decompose AST analysis visitors and engine into focused hel…
carlos-alm Mar 17, 2026
46a95ae
refactor: decompose domain builder stages into focused helpers
carlos-alm Mar 17, 2026
0a3fbc7
refactor: decompose domain analysis functions into focused helpers
carlos-alm Mar 17, 2026
b2f89f1
refactor: decompose buildComplexityMetrics
carlos-alm Mar 17, 2026
cb82258
refactor: decompose buildStructure into traversal, cohesion, and clas…
carlos-alm Mar 17, 2026
54b0067
refactor: decompose buildCFGData and buildDataflowEdges
carlos-alm Mar 17, 2026
7030e7f
refactor: decompose sequenceData into BFS and message construction
carlos-alm Mar 17, 2026
b4d8a0d
refactor: decompose explain() into section renderers
carlos-alm Mar 17, 2026
ae805d5
refactor: decompose stats() into section printers
carlos-alm Mar 17, 2026
3aa2e4b
fix: address quality issues in features (boundaries, communities, tri…
carlos-alm Mar 17, 2026
246fc21
fix: split data fetching from formatting in presentation queries
carlos-alm Mar 17, 2026
3d60159
fix: extract subcommand dispatch in check, triage CLI and MCP server
carlos-alm Mar 17, 2026
fc721f3
fix: move startMCPServer JSDoc to correct function location
carlos-alm Mar 17, 2026
22ae887
fix: reorder imports in MCP server for lint compliance
carlos-alm Mar 17, 2026
e6e712d
Merge remote-tracking branch 'origin/main' into fix/review-493
carlos-alm Mar 17, 2026
a21840f
chore: release v3.2.0
carlos-alm Mar 17, 2026
6a838be
Merge branch 'main' into release/3.2.0
carlos-alm Mar 17, 2026
155dcc7
merge main into release/3.2.0
carlos-alm Mar 17, 2026
d4f9490
fix: add missing changelog entries for #498 and #493, restore libc fi…
carlos-alm Mar 17, 2026
66f6d16
Merge branch 'release/3.2.0' of https://github.com/optave/codegraph i…
carlos-alm Mar 17, 2026
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
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

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.2.0](https://github.com/optave/codegraph/compare/v3.1.5...v3.2.0) (2026-03-17)

**Post-Phase 3 decomposition and dead code accuracy.** This release completes a thorough decomposition of the remaining monolithic modules — language extractors, AST analysis visitors, domain analysis functions, and feature modules are all broken into focused, single-responsibility helpers. Dead code detection now correctly classifies symbols that are only referenced by tests as "test-only" instead of "dead", and constants are properly included in edge building so they no longer appear as false-positive dead exports. A new `brief` command provides token-efficient file summaries designed for AI hook context injection. The native engine gains a MAX_WALK_DEPTH guard to prevent stack overflows on deeply nested ASTs.

### Features

* **cli:** `codegraph brief <file>` command — token-efficient file summary with symbols, roles, caller counts, and risk tiers; designed for hook-based context injection ([#480](https://github.com/optave/codegraph/pull/480))

### Bug Fixes

* **roles:** classify test-only-called symbols as "test-only" instead of "dead" — reduces false positives in dead code detection ([#497](https://github.com/optave/codegraph/pull/497))
* **builder:** include constant nodes in edge building — constants no longer appear as false-positive dead exports ([#495](https://github.com/optave/codegraph/pull/495))
* **native:** add MAX_WALK_DEPTH guard to native engine AST walkers — prevents stack overflows on deeply nested files ([#484](https://github.com/optave/codegraph/pull/484))
* **cli:** support repeated `--file` flag for multi-file scoping across all commands ([#498](https://github.com/optave/codegraph/pull/498))
* **versioning:** use semver-compliant dev version numbering (`-dev.0` suffix instead of non-standard format) ([#479](https://github.com/optave/codegraph/pull/479))

### Refactors

* **extractors:** decompose monolithic language extractors (JS/TS, Python, Java) into per-category handlers ([#490](https://github.com/optave/codegraph/pull/490))
* **ast-analysis:** decompose AST analysis visitors and domain builder stages into focused helpers ([#491](https://github.com/optave/codegraph/pull/491))
* **domain:** decompose domain analysis and feature modules into single-responsibility functions ([#492](https://github.com/optave/codegraph/pull/492))
* **presentation:** split data fetching from formatting and extract CLI/MCP subcommand dispatch ([#493](https://github.com/optave/codegraph/pull/493))
* **cleanup:** dead code removal, shared abstractions, and empty catch block replacement across all layers ([#489](https://github.com/optave/codegraph/pull/489))

## [3.1.5](https://github.com/optave/codegraph/compare/v3.1.4...v3.1.5) (2026-03-16)

**Phase 3 architectural refactoring completes.** This release finishes the remaining two Phase 3 roadmap tasks — domain directory grouping (3.15) and CLI composability (3.16) — bringing Phase 3 to 14 of 14 tasks complete. The `src/` directory is now reorganized into `domain/`, `features/`, and `presentation/` layers. A new `openGraph()` helper eliminates DB-open/close boilerplate across CLI commands, and a universal output formatter adds `--table` and `--csv` output to all commands. Several post-reorganization bugs are fixed: complexity/CFG/dataflow analysis restored after the move, MCP server imports corrected, worktree boundary escapes prevented, CJS `require()` support added, and LIKE wildcard injection in queries patched.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ That's it. The graph is ready. Now connect your AI agent.
Connect directly via MCP — your agent gets 30 tools to query the graph:

```bash
codegraph mcp # 30-tool MCP server — AI queries the graph directly
codegraph mcp # 33-tool MCP server — AI queries the graph directly
```

Or add codegraph to your agent's instructions (e.g. `CLAUDE.md`):
Expand Down Expand Up @@ -183,7 +183,7 @@ cd codegraph && npm install && npm link

| | Feature | Description |
|---|---|---|
| 🤖 | **MCP server** | 30-tool MCP server for AI assistants; single-repo by default, opt-in multi-repo |
| 🤖 | **MCP server** | 33-tool MCP server for AI assistants; single-repo by default, opt-in multi-repo |
| 🎯 | **Deep context** | `context` gives agents source, deps, callers, signature, and tests for a function in one call; `audit --quick` gives structural summaries |
| 🏷️ | **Node role classification** | Every symbol auto-tagged as `entry`/`core`/`utility`/`adapter`/`dead`/`leaf` based on connectivity — agents instantly know architectural role |
| 📦 | **Batch querying** | Accept a list of targets and return all results in one JSON payload — enables multi-agent parallel dispatch |
Expand Down Expand Up @@ -258,6 +258,7 @@ codegraph children <name> # List parameters, properties, constants of a
```bash
codegraph context <name> # Full context: source, deps, callers, signature, tests
codegraph context <name> --depth 2 --no-tests # Include callee source 2 levels deep
codegraph brief <file> # Token-efficient file summary: symbols, roles, risk tiers
codegraph audit <file> --quick # Structural summary: public API, internals, data flow
codegraph audit <function> --quick # Function summary: signature, calls, callers, tests
```
Expand Down
4 changes: 2 additions & 2 deletions 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-16
**Last updated:** 2026-03-17
**Source:** Features derived from [COMPETITIVE_ANALYSIS.md](../../generated/competitive/COMPETITIVE_ANALYSIS.md) and internal roadmap discussions.

---
Expand Down Expand Up @@ -29,7 +29,7 @@ These two items directly improve agent experience and graph accuracy today, with

| ID | Title | Description | Category | Benefit | Zero-dep | Foundation-aligned | Problem-fit (1-5) | Breaking | Depends on |
|----|-------|-------------|----------|---------|----------|-------------------|-------------------|----------|------------|
| 83 | Hook-optimized `codegraph brief` command | New `codegraph brief <file>` command designed for Claude Code hook context injection. Returns a compact, token-efficient summary per file: each symbol with its role and caller count (e.g. `buildGraph [core, 12 callers]`), blast radius count on importers (`Imported by: src/cli.js (+8 transitive)`), and overall file risk tier. Current `deps --json` output used by `enrich-context.sh` is shallow — just file-level imports/importedBy and symbol names with no role or blast radius info. The `brief` command would include: **(a)** symbol roles in the output — knowing a file defines `core` vs `leaf` symbols changes editing caution; **(b)** per-symbol transitive caller counts — makes blast radius visible without a separate `fn-impact` call; **(c)** file-level risk tier (high/medium/low based on max fan-in and role composition). Output optimized for `additionalContext` injection — single compact block, not verbose JSON. Also add `--brief` flag to `deps` as an alias. | Embeddability | The `enrich-context.sh` hook is the only codegraph context agents actually see (they ignore CLAUDE.md instructions to run commands manually). Making that passively-injected context richer — with roles, caller counts, and risk tiers — directly reduces blind edits to high-impact code. Currently the hook shows `Defines: function buildGraph` but not that it's a core symbol with 12 transitive callers | ✓ | ✓ | 4 | No | — |
| 83 | ~~Hook-optimized `codegraph brief` command~~ | New `codegraph brief <file>` command designed for Claude Code hook context injection. Returns a compact, token-efficient summary per file: each symbol with its role and caller count (e.g. `buildGraph [core, 12 callers]`), blast radius count on importers (`Imported by: src/cli.js (+8 transitive)`), and overall file risk tier. Current `deps --json` output used by `enrich-context.sh` is shallow — just file-level imports/importedBy and symbol names with no role or blast radius info. The `brief` command would include: **(a)** symbol roles in the output — knowing a file defines `core` vs `leaf` symbols changes editing caution; **(b)** per-symbol transitive caller counts — makes blast radius visible without a separate `fn-impact` call; **(c)** file-level risk tier (high/medium/low based on max fan-in and role composition). Output optimized for `additionalContext` injection — single compact block, not verbose JSON. Also add `--brief` flag to `deps` as an alias. | Embeddability | The `enrich-context.sh` hook is the only codegraph context agents actually see (they ignore CLAUDE.md instructions to run commands manually). Making that passively-injected context richer — with roles, caller counts, and risk tiers — directly reduces blind edits to high-impact code. Currently the hook shows `Defines: function buildGraph` but not that it's a core symbol with 12 transitive callers | ✓ | ✓ | 4 | No | — | **DONE** — `codegraph brief <file>` command with symbol roles, caller counts, and risk tiers. CLI command, MCP tool, and presentation layer. ([#480](https://github.com/optave/codegraph/pull/480)) |
| 71 | Basic type inference for typed languages | Extract type annotations from TypeScript and Java AST nodes (variable declarations, function parameters, return types, generics) to resolve method calls through typed references. Currently `const x: Router = express.Router(); x.get(...)` produces no edge because `x.get` can't be resolved without knowing `x` is a `Router`. Tree-sitter already parses type annotations — we just don't use them for resolution. Start with declared types (no flow inference), which covers the majority of TS/Java code. | Resolution | Dramatically improves call graph completeness for TypeScript and Java — the two languages where developers annotate types explicitly and expect tooling to use them. Directly prevents hallucinated "no callers" results for methods called through typed variables ||| 5 | No ||

### Tier 1 — Zero-dep + Foundation-aligned (build these first)
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codegraph Roadmap

> **Current version:** 3.1.5 | **Status:** Active development | **Updated:** March 2026
> **Current version:** 3.2.0 | **Status:** Active development | **Updated:** March 2026

Codegraph is a strong local-first code graph CLI. This roadmap describes planned improvements across eleven phases -- closing gaps with commercial code intelligence platforms while preserving codegraph's core strengths: fully local, open source, zero cloud dependency by default.

Expand Down
4 changes: 2 additions & 2 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.5",
"version": "3.2.0",
"description": "Local code graph CLI — parse codebases with tree-sitter, build dependency graphs, query them",
"type": "module",
"main": "src/index.js",
Expand Down
Loading