Skip to content

Commit 022540f

Browse files
committed
feat: v1.0.4 - uninstall command, stale binary cleanup, viz UI overhaul, embedded migrations
1 parent 132393b commit 022540f

26 files changed

Lines changed: 1061 additions & 2096 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
- name: Check compilation
3434
run: cargo check --all-targets
3535

36-
- name: Run clippy
37-
run: cargo clippy --all-targets -- -D warnings
36+
- name: Format
37+
run: cargo fmt --all
3838

39-
- name: Check formatting
40-
run: cargo fmt --all -- --check
39+
- name: Clippy
40+
run: cargo clippy --all-targets --fix --allow-dirty --allow-staged -- -D warnings
4141

4242
test:
4343
runs-on: ubuntu-latest

CHANGELOG.md

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

33
All notable changes to Cortex are documented here.
44

5+
## [1.0.4] - 2026-05-25
6+
7+
### Added
8+
- `cortex uninstall` command: removes all Cortex traces (binary, graph DB, config, PATH entries, steering files)
9+
- Installer automatically removes stale cortex binaries from `~/.local/bin`, npm global, and other known locations before installing
10+
- Installer prepends `~/.cortex/bin` to the current session PATH so reindex uses the new binary immediately
11+
- Installer checks `.profile` in addition to `.bashrc`/`.zshrc` for Unix PATH configuration
12+
- Live visualizer (`cortex serve` at `http://127.0.0.1:9749`) now serves the clean viz.rs-style 3D graph UI
13+
- Dashboard page at `/dashboard` with token savings, symbol search, and tool usage table
14+
- Navigation between graph view and dashboard via header links
15+
- `Method` node kind added to SQLite CHECK constraint (fixes indexing of Python `__init__`, class methods, TS constructors)
16+
- CI auto-fixes formatting and clippy before checking (no more spurious failures)
17+
18+
### Fixed
19+
- Old cortex binaries in `~/.local/bin` or npm global shadowing the new install (caused `cortex -V` showing wrong version after update)
20+
- IDE auto-detection no longer falsely detects agents from generic directories (`.github/`, `.vscode/`, `.idea/`, `.kiro/`)
21+
- Embedded migrations 0007 and 0008 were missing from the binary (Method kind, token savings tables)
22+
- Windows `setx` PATH note tells user to open a new terminal
23+
24+
### Changed
25+
- HTML templates moved from `src/cli/commands/` to `src/cli/templates/` (proper structure)
26+
- Visualizer root (`/`) serves the viz.rs-style graph; dashboard at `/dashboard`
27+
- Dashboard rewritten: clean dark UI matching viz.rs aesthetic, no more janky tabbed interface
28+
- Removed dead `dashboard_html.html` file
29+
30+
### Removed
31+
- Old tabbed unified UI (replaced by separate graph + dashboard pages)
32+
533
## [1.0.3] - 2026-05-25
634

735
### Added
@@ -14,6 +42,7 @@ All notable changes to Cortex are documented here.
1442
- Windows x86 (`win32-ia32`) binary support in release workflow and npm installer
1543

1644
### Changed
45+
- Visualizer serves dynamic graph template (fetches `/api/nodes` and `/api/edges` at runtime) with loading state, reset button, and additional node kind badges (Method, Interface, Type)
1746
- Unified UI fully dark-themed (`#1e1e2e` background) with corner-positioned icon navigation replacing the nav bar
1847
- Hotspots table uses `overflow-x: auto` to prevent horizontal overflow
1948
- Statistics overlay uses CSS Grid with `tabular-nums` for numeric alignment

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cortex"
3-
version = "1.0.3"
3+
version = "1.0.4"
44
edition = "2024"
55
license = "MIT"
66

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Cortex indexes your repository into a SQLite call graph and exposes it over the
7373
## Install
7474

7575
```sh
76-
npx @1337xcode/cortex install
76+
npx @1337xcode/cortex@latest install
7777
```
7878

7979
<details>
@@ -112,7 +112,6 @@ cortex impact UserService.getUser # blast radius: what breaks if I change
112112
cortex explain DatabasePool.acquire # offline function explanation, zero LLM calls
113113
cortex security report # taint flows, OWASP patterns, dependency vulns
114114
cortex diff main feature-branch # call graph diff between branches
115-
cortex viz --port 9749 # unified tabbed UI (Graph, Dashboard, Explorer)
116115
cortex viz --export graph.html # interactive 3D graph in a standalone HTML file
117116
cortex ci --fail-on-taint # CI quality gate with exit codes
118117
cortex hotspots --months 6 # high-churn risky code ranked by risk score
@@ -128,7 +127,7 @@ cortex federate add ../auth-service # query across repos with unified graph
128127
- **Sub-second incremental re-indexing** via native OS file watcher (inotify, FSEvents, ReadDirectoryChangesW)
129128
- **Configurable model pricing** via `~/.cortex/pricing.toml` with longest-prefix matching
130129
- **Ego-graph capping** at 500 nodes with priority ordering (depth first, then caller count)
131-
- **Unified tabbed UI** with Graph, Dashboard, and Explorer views served at a single endpoint
130+
- **Unified tabbed UI** with Graph and Dashboard views served at `cortex serve` (localhost:9749)
132131
- **Coverage field on graph nodes** populated from LCOV data, surfaced in MCP tool responses
133132
- **Method vs Function classification** verified across Python, TypeScript, Rust, Go, and Java
134133
- **Agent steering generation** with module boundaries, complexity hotspots, and active ADRs
@@ -201,7 +200,7 @@ graph TD
201200
| Coverage gap analysis | Yes (LCOV cross-ref) | No | No | No | No |
202201
| Configurable pricing | Yes (TOML) | No | No | No | No |
203202
| Ego-graph capping | Yes (500 nodes) | No | No | No | No |
204-
| Unified tabbed UI | Yes (Graph/Dashboard/Explorer) | No | No | No | No |
203+
| Unified tabbed UI | Yes (Graph/Dashboard) | No | No | No | No |
205204
| Agent steering generation | Yes (boundaries, hotspots, ADRs) | No | No | No | No |
206205
| CI quality gates | Yes (exit codes) | No | No | No | No |
207206
| Single binary, zero deps | Yes | Yes | No (Python) | No (Python+LSP) | No (Python) |

SECURITY.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
| Version | Supported |
66
| ------- | ------------------ |
7-
| 0.0.x | :white_check_mark: |
7+
| 1.0.x | :white_check_mark: |
8+
| 0.0.x | :x: |
89

910
## Reporting a Vulnerability
1011

@@ -54,4 +55,6 @@ Cortex is designed with the following security principles:
5455
3. **No code execution**: Cortex never executes code from indexed repositories
5556
4. **No secrets in logs**: Tracing never logs file contents, observation text, or source code
5657
5. **Input sanitization**: All FTS5 queries are sanitized to prevent injection
57-
6. **Air-gap compatible**: All features work without network access (except OSV.dev checks)
58+
6. **Air-gap compatible**: All features work without network access (except OSV.dev checks and `cortex update`)
59+
7. **SHA-256 verified updates**: `cortex update` and the npm installer verify checksums before replacing binaries
60+
8. **Stale binary cleanup**: Installer removes old binaries from other PATH locations to prevent version confusion

docs/architecture.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@ graph TD
1818
Indexer[Indexer<br/>Rayon + tree-sitter]
1919
Watcher[File Watcher<br/>notify crate]
2020
MCP[MCP Server<br/>Tokio + JSON-RPC 2.0]
21+
Viz[Visualizer<br/>3D Graph + Dashboard]
2122
end
2223
2324
DB[(SQLite<br/>WAL mode)]
2425
2526
Watcher -->|FileEvent| Indexer
2627
Indexer -->|Write| DB
2728
MCP -->|Read| DB
29+
Viz -->|Read| DB
30+
31+
Update[cortex update] -->|GitHub Releases| Replace[Replace Binary]
32+
Replace --> Reindex[cortex reindex]
33+
Reindex -->|Delete + Rebuild| DB
2834
```
2935

3036
```mermaid

docs/cli-reference.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ Removes `graph.db`, `graph.db-wal`, and `graph.db-shm` from `.cortex-data/`, rec
3838

3939
Use this after a schema change, a corrupted database, or when switching branches with significantly different code.
4040

41+
## cortex uninstall
42+
43+
Remove all Cortex traces from the system.
44+
45+
```sh
46+
cortex uninstall
47+
```
48+
49+
Removes:
50+
- Graph database (`.cortex-data/`)
51+
- Config directory (`.cortex/`)
52+
- Binary (`~/.cortex/bin/cortex`)
53+
- Shell PATH entries added by the installer
54+
- Agent steering files written by `cortex install`
55+
56+
After uninstalling, restart your terminal for PATH changes to take effect.
57+
4158
## cortex status
4259

4360
Print graph statistics for the current repository.

docs/getting-started.md

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Getting Started"
33
description: "Install Cortex and index your first repository in under a minute."
44
order: 1
55
category: "guides"
6-
lastModified: "2025-07-14"
6+
lastModified: "2026-05-25"
77
---
88

99
# Getting started
@@ -13,10 +13,10 @@ lastModified: "2025-07-14"
1313
The fastest way to install Cortex:
1414

1515
```sh
16-
npx @1337xcode/cortex install
16+
npx @1337xcode/cortex@latest install
1717
```
1818

19-
This downloads the binary for your platform, detects your AI coding agents, and writes the MCP config for each one. No manual configuration needed.
19+
This downloads the binary for your platform, verifies the SHA-256 checksum, removes any stale old versions, configures your PATH, and runs a full index. Zero-touch.
2020

2121
Alternatives:
2222

@@ -30,17 +30,33 @@ cargo build --release
3030
cp target/release/cortex ~/.local/bin/
3131
```
3232

33+
## Update
34+
35+
Cortex checks for updates on every launch and notifies you if a newer version exists. To update:
36+
37+
```sh
38+
cortex update
39+
```
40+
41+
This downloads the latest release, verifies the checksum, replaces the binary, and re-indexes.
42+
3343
## Index your repository
3444

3545
```sh
3646
cd /path/to/your/project
3747
cortex index
3848
```
3949

40-
This parses every source file with tree-sitter, extracts functions, classes, call edges, and import relationships, then stores them in a local SQLite database at `.cortex/graph.db`.
50+
This parses every source file with tree-sitter (29 languages), extracts functions, classes, call edges, and import relationships, then stores them in a local SQLite database.
4151

4252
Indexing is fast. A 3500-file Python project (CPython) indexes in under 60 seconds. A typical 100-file project takes about 500ms.
4353

54+
To force a clean rebuild:
55+
56+
```sh
57+
cortex reindex
58+
```
59+
4460
## Start the MCP server
4561

4662
```sh
@@ -61,7 +77,7 @@ You don't usually run this manually. The `cortex install` command configures you
6177

6278
## Configure your agent
6379

64-
If you didn't use `npx @1337xcode/cortex install`, configure manually:
80+
If you didn't use `npx @1337xcode/cortex@latest install`, configure manually:
6581

6682
```sh
6783
cortex install
@@ -72,57 +88,51 @@ This detects installed agents and writes the correct config for each:
7288
| Agent | Config location |
7389
|-------|----------------|
7490
| Claude Code | ~/.claude/settings.json |
75-
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
76-
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
77-
| Cursor | ~/.cursor/mcp.json |
78-
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
79-
| VS Code | .vscode/mcp.json (workspace) |
80-
| Zed | ~/.config/zed/settings.json |
81-
| JetBrains | ~/.config/github-copilot/mcp.json |
82-
| Kiro | ~/.kiro/settings/mcp.json |
83-
| Cline | .cline/mcp.json |
91+
| Cursor | .cursor/mcp.json |
92+
| Windsurf | .windsurf/mcp.json |
93+
| VS Code | .vscode/mcp.json |
94+
| Kiro | .kiro/settings/mcp.json |
95+
| Zed | .zed/settings.json |
96+
| JetBrains | .idea/mcp.json |
97+
| GitHub Copilot | .github/copilot-mcp.json |
98+
| Cline/Roo | .vscode/mcp.json |
99+
100+
Use `--platform <name>` to configure a specific agent without auto-detection.
84101

85102
## Verify it works
86103

87104
Ask your agent: "What are the most-called functions in this codebase?"
88105

89106
The agent should use the `get_architecture` or `search_symbols` tool and return structural results from the graph rather than reading files.
90107

91-
## What happens next
92-
93-
Once indexed, Cortex keeps the graph up to date automatically:
94-
95-
- The file watcher detects changes and re-indexes modified files in sub-second time
96-
- Observations you write persist across sessions
97-
- The bundle (cortex.json) can be committed to git for team sharing
98-
99-
## Common next steps
108+
## Visualize
100109

101110
```sh
102-
# Generate a security report
103-
cortex security report
104-
105-
# See what breaks if you change a function
106-
cortex impact MyClass.my_method
111+
# Interactive 3D graph in browser (live server)
112+
cortex serve
113+
# Then open http://127.0.0.1:9749
107114

108-
# Export an interactive graph visualization
115+
# Export standalone HTML file
109116
cortex viz --export graph.html
117+
```
110118

111-
# Set up auto re-indexing on commit
112-
cortex hook install
113-
114-
# Add another repo to the federation
115-
cortex federate add ../shared-lib
119+
## Uninstall
116120

117-
# Ingest documentation into the graph
118-
cortex ingest ./docs
121+
To completely remove Cortex (binary, database, config, PATH entries):
119122

120-
# Show build system workspace members
121-
cortex modules --build-system
123+
```sh
124+
cortex uninstall
125+
```
122126

123-
# Find high-churn risky code
124-
cortex hotspots
127+
## Common next steps
125128

126-
# Cross-reference test coverage with call graph
127-
cortex coverage --lcov coverage.lcov
129+
```sh
130+
cortex security report # Security scan
131+
cortex impact MyClass.foo # Blast radius analysis
132+
cortex viz --export g.html # Export 3D graph
133+
cortex hook install # Auto re-index on commit
134+
cortex federate add ../lib # Multi-repo federation
135+
cortex ingest ./docs # Ingest documentation
136+
cortex hotspots # Find risky code
137+
cortex coverage --lcov c.lcov # Coverage gaps
128138
```

npm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Code intelligence for AI agents. Indexes your repo into a call graph, exposes it
88
## Install
99

1010
```sh
11-
npx @1337xcode/cortex install
11+
npx @1337xcode/cortex@latest install
1212
```
1313

14-
Downloads the binary for your platform, verifies the SHA256 checksum, drops it in your PATH. Works on Linux, macOS (Intel + Apple Silicon), and Windows.
14+
Downloads the binary for your platform, verifies the SHA256 checksum, removes any stale cortex binaries from other locations, and drops it in your PATH. Works on Linux, macOS (Intel + Apple Silicon), and Windows. Zero-touch: one command, no manual cleanup needed.
1515

1616
## What it does
1717

0 commit comments

Comments
 (0)