@openez-graph/cli 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -69,19 +69,24 @@ openez setup codex # wire up Codex
69
69
  openez setup opencode # wire up OpenCode
70
70
  openez setup windsurf # wire up Windsurf / Devin Desktop
71
71
  openez setup devin # wire up Devin CLI
72
+ openez config get [key] # show embedding config (all if no key)
73
+ openez config set <key> <value> # set embedding config value
74
+ openez config list # list all DB-stored config overrides
72
75
  ```
73
76
 
77
+ Valid config keys: `embedding.provider`, `embedding.openai_api_key`, `embedding.openai_base_url`, `embedding.openai_model`, `embedding.ollama_base_url`, `embedding.ollama_model`. API keys are encrypted at rest with AES-256-GCM.
78
+
74
79
  ## MCP Tools
75
80
 
76
- | Tool | Description |
77
- |------|-------------|
78
- | `list_workspaces` | List all registered workspaces |
79
- | `code_query` | Hybrid FTS/vector search + graph expansion over indexed code and docs |
80
- | `code_context` | Get budgeted symbol context with callers, callees, and related files |
81
- | `graph_neighbors` | Traverse graph edges from a node or label |
82
- | `memory_recall` | Recall active memory entries and technical decisions |
83
- | `memory_write` | Write a memory entry (notes, decisions, patterns) |
84
- | `index_workspace` | Trigger indexing for a workspace |
81
+ | Tool | Description |
82
+ | ----------------- | --------------------------------------------------------------------- |
83
+ | `list_workspaces` | List all registered workspaces |
84
+ | `code_query` | Hybrid FTS/vector search + graph expansion over indexed code and docs |
85
+ | `code_context` | Get budgeted symbol context with callers, callees, and related files |
86
+ | `graph_neighbors` | Traverse graph edges from a node or label |
87
+ | `memory_recall` | Recall active memory entries and technical decisions |
88
+ | `memory_write` | Write a memory entry (notes, decisions, patterns) |
89
+ | `index_workspace` | Trigger indexing for a workspace |
85
90
 
86
91
  `memory_query` is accepted as a deprecated compatibility alias for `code_query`, but is not advertised to new clients.
87
92
 
@@ -96,29 +101,36 @@ openez setup devin # wire up Devin CLI
96
101
 
97
102
  ## Supported languages
98
103
 
99
- | Language | Indexing depth |
100
- |----------|---------------|
104
+ | Language | Indexing depth |
105
+ | ----------------------- | ------------------------------------------------------ |
101
106
  | TypeScript / JavaScript | Richest — `ts-morph` symbol extraction, imports, calls |
102
- | Python | Basic top-level symbol extraction |
103
- | Go | Basic top-level symbol extraction |
104
- | Rust | Basic top-level symbol extraction |
105
- | YAML / JSON / TOML | Structure-aware chunking |
106
- | Markdown | Section-oriented chunking |
107
+ | Python | Basic top-level symbol extraction |
108
+ | Go | Basic top-level symbol extraction |
109
+ | Rust | Basic top-level symbol extraction |
110
+ | YAML / JSON / TOML | Structure-aware chunking |
111
+ | Markdown | Section-oriented chunking |
107
112
 
108
113
  ## Retrieval quality
109
114
 
110
- Benchmarked on 18 real queries against the openez codebase itself (118 files, 640 chunks):
115
+ Benchmarked on 23 queries (17 keyword + 6 semantic) against the openez codebase (128 files, 810 chunks):
116
+
117
+ | Metric | FTS only | FTS + Embedding (bge-m3) |
118
+ | ---------------- | -------: | -----------------------: |
119
+ | Recall@5 | 91.30% | 95.65% |
120
+ | Keyword queries | 100.00% | 100.00% |
121
+ | Semantic queries | 66.67% | 83.33% |
122
+ | Avg latency | 5 ms | 249 ms |
123
+
124
+ **FTS-only is the default** — 100% recall on keyword queries, 50x faster. **Embedding adds semantic search with +16.67% semantic recall and no keyword regression** via full RRF fusion (FTS weight 2x, vector weight 1x).
111
125
 
112
- | Metric | Value |
113
- |--------|-------|
114
- | Recall@5 | 94.44% |
115
- | MRR | 0.6565 |
116
- | Avg latency | 38.68 ms |
117
- | p50 latency | 18.65 ms |
118
- | Duplicate path rate | 0% |
119
- | Quality gate | PASS |
126
+ ```bash
127
+ # Enable Ollama embeddings (bge-m3 recommended for code search)
128
+ openez config set embedding.provider ollama
129
+ openez config set embedding.ollama_model bge-m3
130
+ openez reindex .
131
+ ```
120
132
 
121
- FTS5 with BM25 ranking handles 94% of queries in under 40ms — no embeddings needed for the default path. Embeddings (OpenAI/Ollama) are optional semantic fallback for queries without direct keyword overlap.
133
+ See [BENCHMARK.md](https://github.com/asta-nguyen/openez-graph/blob/main/BENCHMARK.md) for full analysis.
122
134
 
123
135
  ## Web dashboard
124
136
 
@@ -127,6 +139,7 @@ openez serve --web
127
139
  ```
128
140
 
129
141
  Opens a full web dashboard at `http://localhost:17881` with:
142
+
130
143
  - Workspace overview (documents, chunks, nodes, edges)
131
144
  - Graph explorer with force-directed layout
132
145
  - Query interface for memory retrieval
package/dist/CHANGELOG.md CHANGED
@@ -5,19 +5,71 @@ All notable changes to OpenEZ Graph are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.11.0] - 2026-08-06
9
+
10
+ ### Added
11
+
12
+ - Tree-sitter AST parsing for Python, Go, and Rust via `web-tree-sitter` (WASM) with regex fallback
13
+ - `CodeParser` interface and parser-registry pattern — pluggable parser dispatch via `getParserForPath()` + `parseDocument()`
14
+ - Six parser implementations: `TsMorphParser`, `TreeSitterParser`, `MarkdownParser`, `ConfigParser`, `FallbackParser`, and `parser-registry` dispatcher
15
+ - `language` and `parser` fields on symbol graph node metadata
16
+ - `confidence` field on call edge metadata (`medium` for ts-morph, `low` for tree-sitter/regex)
17
+ - 27 new tests (14 parser-registry + 13 tree-sitter parser)
18
+
19
+ ### Changed
20
+
21
+ - `chunkDocument()` in `index-workspace.ts` reduced from ~150 lines of per-language branching to a 12-line delegate to `parseDocument()`
22
+ - Python/Go/Rust indexing upgraded from regex-only to tree-sitter AST with automatic regex fallback
23
+ - CLI bundles `web-tree-sitter` WASM grammars for Python, Go, and Rust
24
+
25
+ ### Fixed
26
+
27
+ - Call edges now track originating parser for confidence attribution
28
+
29
+ ## [0.10.0] - 2026-08-05
30
+
31
+ ### Fixed
32
+
33
+ - MCP stdio corruption: retrieval diagnostics now write to `stderr` instead of `stdout`, preserving JSON-RPC framing for `code_query` calls
34
+ - `lint-staged` downgraded from v17 to v16.4.0 for Node.js 20 compatibility (v17 requires Node >=22.22.1)
35
+ - Master key race condition: atomic exclusive file creation (`O_CREAT|O_EXCL`) prevents concurrent processes from generating different keys
36
+ - Master key malformed-file handling: invalid key content now throws an explicit error instead of silently overwriting the file
37
+ - Master key file permissions: existing key files are now `chmod`-ed to `0o600` on read if permissions are too open
38
+ - Embedding dedup: chunks skipped by `input_hash` match now receive a copied embedding row so they appear in vector search results
39
+ - Embedding dedup legacy cleanup: `ROW_NUMBER()` ordering (newest, non-null `input_hash` first) replaces `MIN(id)` to preserve the most useful embedding
40
+ - Composite index `(provider, model, input_hash)` added to speed up embedding dedup lookups on large workspaces
41
+ - `vectorSearch` now wraps `getEmbeddingProvider()` in the same `try` block so initialization failures fall back to FTS instead of aborting `codeQuery`
42
+ - Web API `PUT /api/settings/embedding` validates `embedding.provider` against `none`, `openai`, `ollama` (returns 400 for invalid values)
43
+ - Web API clearing a setting (empty value) now deletes the DB override instead of skipping it, restoring env/default fallback
44
+ - CLI `config get <key>` resolves the effective DB-plus-environment value and prints `not set` when absent
45
+ - CLI sensitive-key masking uses `isSensitiveKey()` consistently across all `config` commands
46
+ - Settings UI syncs external config to form state via `useEffect` instead of setState-during-render; form updates after save refetch
47
+ - Settings UI resets the "Saved!" indicator when any field is edited after a successful save
48
+ - RRF `identity()` function computed once per entry instead of twice (get + set)
49
+ - Benchmark test isolated from the user's real registry DB via temp `AI_MEMORY_REGISTRY_DB_PATH`
50
+ - Benchmark stats workspace path resolved from registry instead of `cwd` to match `codeQuery`
51
+ - `withRetry` dead code replaced with a type-safe unreachable return
52
+
53
+ ### Changed
54
+
55
+ - README storage section updated from three to four local artifacts (added `master.key`)
56
+
8
57
  ## [0.9.0] - 2026-08-02
9
58
 
10
59
  ### Added
60
+
11
61
  - MCP server version and Git build identity in the protocol handshake
12
62
  - Token budgets for `code_query`, `code_context`, `graph_neighbors`, and `memory_recall`, with compact graph/context responses
13
63
  - Live `code_query` token telemetry on the dashboard and benchmark page
14
64
  - MCP contract tests for response budgets, multi-workspace attribution, graph context, and startup indexing
15
65
 
16
66
  ### Changed
67
+
17
68
  - Multi-workspace retrieval now applies one global serialized-response budget and attributes delivered tokens exactly across workspaces
18
69
  - CLI npm package now exposes the bundled entry point and installs only `better-sqlite3` at runtime
19
70
 
20
71
  ### Fixed
72
+
21
73
  - Empty workspaces no longer re-index on every MCP server restart
22
74
  - Very small token budgets are rejected instead of returning an oversized response
23
75
  - Token-savings telemetry now uses selected full-file tokens minus the actual serialized response size
@@ -25,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
77
  ## [0.8.0] - 2026-08-02
26
78
 
27
79
  ### Added
80
+
28
81
  - Memory management UI at `/memories` with list, search, detail view, and create dialog
29
82
  - Memory API routes: `GET /api/memories` (list + search), `GET /api/memories/:id`, `POST /api/memories`, `DELETE /api/memories/:id`
30
83
  - Recent memories section on the dashboard now populated from the workspace database
@@ -33,12 +86,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
86
  - Integration tests for hybrid retrieval ranking and registry operations
34
87
 
35
88
  ### Fixed
89
+
36
90
  - Changelog page stuck loading — `findChangelogPath` now walks up from `serverDir` and `cwd` to locate `CHANGELOG.md` in the monorepo root
37
91
  - Memory endpoints no longer fail when the first registered workspace has a stale root path
38
92
 
39
93
  ## [0.7.0] - 2026-08-01
40
94
 
41
95
  ### Added
96
+
42
97
  - Web dashboard changelog page (`/changelog`) with structured rendering of release notes from `CHANGELOG.md`
43
98
  - API endpoint `GET /api/changelog` serving the repo changelog
44
99
  - Changelog link in CLI README for npm package page
@@ -47,16 +102,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
47
102
  - `memory_recall` MCP tool for retrieving active technical decisions and learned notes written by `memory_write`
48
103
 
49
104
  ### Changed
105
+
50
106
  - Renamed the public `memory_query` MCP tool to `code_query`; the old name remains a deprecated, hidden compatibility alias
51
107
  - Code retrieval now fuses both FTS and vector results, and `code_context` supports result/token budgets
52
108
 
53
109
  ## [0.6.1] - 2026-08-01
54
110
 
55
111
  ### Added
112
+
56
113
  - Syntax-highlighted context blocks in the web Query page (`prism-react-renderer`), with per-source file metadata (path, line range, score) and line numbers
57
114
  - Markdown context blocks now render fenced code blocks with their own language highlighting (e.g. ` ```bash ` gets real bash highlighting)
58
115
 
59
116
  ### Fixed
117
+
60
118
  - Dark boxes obscuring markdown inline code in context blocks (stripped token `backgroundColor` from the nightOwl theme)
61
119
 
62
120
  ## [0.6.0] - 2026-08-01
@@ -64,9 +122,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
64
122
  Remediation release — index/graph correctness, data protection, and web flow fixes.
65
123
 
66
124
  ### Security
125
+
67
126
  - Web API and CLI dashboard now bind to loopback (`127.0.0.1`) by default (FIX-01)
68
127
 
69
128
  ### Fixed
129
+
70
130
  - Full reindex no longer wipes memories, query logs, and run history — only rebuildable index artifacts are reset (FIX-02)
71
131
  - Incremental indexing preserves inbound graph edges (calls/imports) to symbols in changed files; symbol and file node identities are now stable across re-parses (FIX-03)
72
132
  - Graph edges are deduplicated by `(from, to, type)` with a unique SQLite index and `ON CONFLICT DO NOTHING` inserts (FIX-04)
@@ -75,15 +135,20 @@ Remediation release — index/graph correctness, data protection, and web flow f
75
135
  - Regenerated stale route tree referencing the deleted `/jobs` route; removed the CI lint no-op (`turbo run lint` with zero lint tasks) (FIX-08)
76
136
 
77
137
  ### Removed
138
+
78
139
  - Jobs page and related API endpoints
79
140
 
80
141
  ## [0.5.1] - 2026-07-31
81
142
 
82
143
  ### Fixed
144
+
83
145
  - Blazing-fast indexing for large codebases (batch transactions, optimized write mode)
84
146
  - Error handling and validation for import path extraction
85
147
  - CLI npm packaging
86
148
 
149
+ [0.11.0]: https://github.com/asta-nguyen/openez-graph/compare/v0.10.0...v0.11.0
150
+ [0.10.0]: https://github.com/asta-nguyen/openez-graph/compare/fbcad4f...HEAD
151
+ [0.9.1]: https://github.com/asta-nguyen/openez-graph/compare/fbcad4f...HEAD
87
152
  [0.9.0]: https://github.com/asta-nguyen/openez-graph/compare/fbcad4f...HEAD
88
153
  [0.8.0]: https://github.com/asta-nguyen/openez-graph/compare/a7ce4df...849060b
89
154
  [0.7.0]: https://github.com/asta-nguyen/openez-graph/compare/9b7cc78...a7ce4df