v3.5.14
Performance
- BLAKE3 hashing — Replaced all MD5 (
md5_hex,md5_hex_bytes) with BLAKE3 via centralizedcore::hashermodule. 12 duplicate hash functions eliminated across the codebase. BLAKE3 is ~3x faster than MD5 for large inputs with better collision resistance. - Tree-sitter Query Cache — Compiled tree-sitter
Queryobjects are now cached inOnceLock<HashMap>statics inchunks_ts,signatures_ts, anddeep_queries. Eliminates re-compilation of query patterns on every file parse. Parser instances reuse viathread_local!. - Token cache upgrade — Token cache enlarged from 256→2048 entries with BLAKE3-based keys and LRU-like eviction (half-evict instead of full clear). Reduces redundant BPE tokenization across sessions.
- SQLite Property Graph optimized — Added
PRAGMA cache_size = -8000,mmap_size = 256MB,temp_store = MEMORY. 5 new composite indices onnodes(kind),nodes(kind, file_path),edges(kind),edges(source_id, kind),edges(target_id, kind).busy_timeout(5000ms)for WAL contention. - Parallel indexing —
rayon::par_iterfor CPU-bound deep-query parsing inctx_impact build(embeddings feature path). - ModePredictor Arc —
ModePredictorstored asArc<ModePredictor>to avoid deep cloning on everyctx_readcall. - Compact JSON serialization —
ProjectIndex::save()usesserde_json::to_string(compact) instead ofto_string_pretty, reducing index file size and serialization time. - Server dispatch deduplicated —
count_tokenscalled once per request instead of redundantly after terse pass when content unchanged.
Improved
- Rules: Mode Selection Decision Tree — Adopted community-contributed improvement (credit: Zeel Connor). Rules now include a numbered decision tree for
ctx_readmode selection and an anti-pattern warning against usingfullfor context-only files. Applied across all rule formats (shared, dedicated, Cursor MDC, CLI-redirect). - Flaky test fixes — BM25 tests (
save_writes_project_root_marker,max_bm25_cache_bytes_reads_env) now acquiretest_env_lock()to preventenv::set_varrace conditions. ContextBus tests use isolated temp SQLite databases viatest_bus()instead of shared global DB.
Added
core::hashermodule — Centralized BLAKE3 hashing:hash_hex(bytes),hash_str(s),hash_short(s). Single source of truth for all non-cryptographic hashing.core::communitymodule — Louvain-based community detection on the Property Graph (file clustering by dependency).core::pagerankmodule — PageRank computation on the Property Graph for file importance scoring.core::smellsmodule — Code smell detection (long functions, deep nesting, high complexity).ctx_smellstool — MCP + CLI tool for code smell analysis with graph-enriched scoring.- 58 MCP tools — Up from 57 in previous release (added
ctx_smells).
Upgrade
lean-ctx update # recommended (auto-downloads + refreshes shell hooks)
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxNote: After upgrading via cargo/npm/brew, run
lean-ctx setupto refresh shell aliases.lean-ctx updatedoes this automatically.
Full Changelog: v3.5.14...v3.5.14