From bda70e6011776a6f674eb4edd9ed595de824720d Mon Sep 17 00:00:00 2001 From: ajianaz Date: Wed, 5 Aug 2026 17:18:28 +0700 Subject: [PATCH 1/2] docs: sync documentation with v0.13.0 codebase state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docs/code-intelligence.md: - Schema version v6 → v7 (embed_fingerprint column) - Embedding engine section: add runtime backend selection (auto | hashing 256d | pretrained 768d) - Vector embeddings table row updated with multi-backend info - Data directory: graph.db → cora.db, add findings table - Schema table: add v7 row, fix v6 description docs/configuration.md: - Add brain.embedding config section with all 3 backends - Add brain section to .cora.yaml example docs/changelog.md: - Sync with root CHANGELOG.md (was stuck at v0.11.1) - Now includes v0.12.0 + v0.13.0 entries - Fix compare links for v0.7.0–v0.13.0 CHANGELOG.md (root): - Fix compare links (was stuck at v0.6.1 → now v0.13.0) docs/roadmap.md: - Add v0.10–v0.13 milestone sections (governance, review intelligence, search quality, runtime brain mode) docs/installation.md: - Update version examples: 0.6.1 → 0.13.0 - Fix binary download URL to new asset naming convention - Add platform-specific asset name table docs/.vitepress/config.mts: - Add Code Intelligence page to sidebar navigation docs/getting-started.md: - Add brain.embedding to config keys table - Add Code Intelligence link to Next Steps docs/index.md: - Update binary size: 10.4 MB → ~7.4 MB --- CHANGELOG.md | 13 +- docs/.vitepress/config.mts | 1 + docs/changelog.md | 307 ++++++++++++++++++++++++------------- docs/code-intelligence.md | 33 ++-- docs/configuration.md | 22 +++ docs/getting-started.md | 2 + docs/index.md | 2 +- docs/installation.md | 19 ++- docs/roadmap.md | 40 +++++ 9 files changed, 311 insertions(+), 128 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d614999..4a28f1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -850,7 +850,18 @@ Benchmarked on the cora-code repository (1,864 symbols, 115 Rust files, x86_64): - **Cross-platform** — Linux (x86_64, ARM64), macOS (Apple Silicon), Windows (x86_64) - **MIT License** — fully open source -[Unreleased]: https://github.com/codecoradev/cora-code/compare/v0.6.1...develop +[Unreleased]: https://github.com/codecoradev/cora-code/compare/v0.13.0...develop +[0.13.0]: https://github.com/codecoradev/cora-code/compare/v0.12.0...v0.13.0 +[0.12.0]: https://github.com/codecoradev/cora-code/compare/v0.11.1...v0.12.0 +[0.11.1]: https://github.com/codecoradev/cora-code/compare/v0.11.0...v0.11.1 +[0.11.0]: https://github.com/codecoradev/cora-code/compare/v0.9.0...v0.11.0 +[0.9.0]: https://github.com/codecoradev/cora-code/compare/v0.8.3...v0.9.0 +[0.8.3]: https://github.com/codecoradev/cora-code/compare/v0.8.2...v0.8.3 +[0.8.2]: https://github.com/codecoradev/cora-code/compare/v0.8.1...v0.8.2 +[0.8.1]: https://github.com/codecoradev/cora-code/compare/v0.8.0...v0.8.1 +[0.8.0]: https://github.com/codecoradev/cora-code/compare/v0.7.0...v0.8.0 +[0.7.0]: https://github.com/codecoradev/cora-code/compare/v0.6.2...v0.7.0 +[0.6.2]: https://github.com/codecoradev/cora-code/compare/v0.6.1...v0.6.2 [0.6.1]: https://github.com/codecoradev/cora-code/compare/v0.6.0...v0.6.1 [0.6.0]: https://github.com/codecoradev/cora-code/compare/v0.5.0...v0.6.0 [0.5.0]: https://github.com/codecoradev/cora-code/compare/v0.4.6...v0.5.0 diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 8da1dbb..b7171cb 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -26,6 +26,7 @@ export default createConfig({ items: [ { text: 'Usage', link: '/usage' }, { text: 'Configuration', link: '/configuration' }, + { text: 'Code Intelligence', link: '/code-intelligence' }, { text: 'Providers', link: '/providers' }, { text: 'CLI Reference', link: '/cli-reference' }, { text: 'Examples', link: '/examples' }, diff --git a/docs/changelog.md b/docs/changelog.md index ab8a376..4a28f1d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -5,17 +5,58 @@ All notable changes to cora-code are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +## [0.13.0] + +### Added + +- **Runtime embedding backend selection.** Brain Mode now reads `brain.embedding` from `.cora.yaml` to select the embedding backend at runtime instead of compile time. Supported values: `auto` (best available — default), `hashing` (force 256d zero-dependency), `pretrained` (force 768d nomic). No recompilation needed to switch. +- **Incremental per-symbol embedding.** `embed_project()` now tracks an `embed_fingerprint` (hash of symbol name + signature) and skips re-embedding symbols that have not changed since the last index. On large projects, re-indexing after touching one file embeds only the changed symbols instead of all. +- **Schema migration v7.** Adds `embed_fingerprint TEXT` column to the `symbols` table for incremental embedding tracking. Auto-migrates on first run; existing indexes are upgraded transparently. +- **`Backend` enum + `resolve_backend()` in `embed` module.** Clean runtime dispatch with `OnceLock` caching, graceful fallback when a requested backend is not compiled, and `active_dims()` / `active_provider_name()` helpers. +- **`BrainConfig` + `BrainEmbeddingMode` in config schema.** New `brain` section in `.cora.yaml` with `embedding` field. Includes `Display`, `FromStr`, and `serde` impls for CLI and YAML ergonomics. + +### Changed + +- **`embed_code_dispatch()` now checks `ACTIVE_BACKEND` at runtime.** Previously selected via `#[cfg]` at compile time only. Falls back to compile-time default if `resolve_backend()` was never called (lazy resolution). +- **`cora index`, `cora brain`, `cora watch` all resolve embedding backend on startup.** Each command loads `.cora.yaml`, reads `brain.embedding`, and calls `resolve_backend()` before touching the vector index. +- **Embedding doc comments updated.** Module-level docs now describe runtime selection and the three-tier architecture (hashing → pretrained → ONNX future). + +## [0.12.0] + +### Fixed + +- **FTS5 returning 0 results for camelCase queries (#451).** Added `file` column to FTS5 virtual table (schema v6), `split_camel_case()` identifier decomposition, and OR query expansion. Searches like `findUser` now correctly match via `find OR user`. +- **Dead-code false positives on framework entry points (#452).** Added `FRAMEWORK_ENTRY_PREFIXES` with SQL LIKE pattern matching for common framework handlers (`handle_*`, `on_*`, `route_*`, etc.) — these are no longer flagged as dead code. +- **Symbol-level suppression markers (#452).** Symbols containing `// cora: keep` in their body are excluded from dead-code detection. +- **Sticky skip files on config change (#453).** Added `index_config_hash` column to projects table — when `.cora.yaml` changes, previously skipped files are re-evaluated instead of permanently skipped. + +### Added + +- **`entry_point_patterns` config field** — New field in `AnalysisConfig` and `.cora.yaml` `analysis` section. Custom list of glob patterns for framework-specific entry points beyond built-in defaults. +- **Schema migration v6** — Auto-migration: adds `index_config_hash` to projects, drops and recreates FTS5 with `file` column, rebuilds search index. +- **`index_project_with_skip()`** — Indexing now respects `index_skip_files` from config, skipping non-code files during symbol extraction. +- **`split_camel_case()`** — Decomposes `camelCaseIdentifiers` into individual tokens for FTS5 search (`camelCase` → `camel OR case`). +- **Enhanced `sanitize_fts_query()`** — Handles quoted phrases, trims whitespace, and escapes special FTS5 characters. +- **31 new unit tests** — Tests for camelCase splitting, FTS5 query expansion, glob matching, suppression markers, framework prefix detection, schema migration v6, and config hash invalidation. + +### Changed + +- **`should_skip_file()` rewritten** — Simplified glob matching with early exit for non-glob patterns, explicit `**/name` branch handling. +- **Governance documentation** — Added CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, PR template, issue templates (bug report + feature request), and PR checks workflow (branch naming, conventional commits, PR description validation). + ## [0.11.1] ### Fixed - **Index scanner false positives on entry-point files.** Added `index_skip_files` glob patterns to `RulesConfig`. Common bundler config files (`vite.config.ts`, `webpack.config.*`) and app entry points (`src/main.ts`, `src/index.tsx`) are now skipped by default — reducing noise from imports used by bundlers, not code. -- **`cora scan` now includes index findings.** Fixed bug where `cora scan` did not wire index scanners — the scan command now runs `scan_project_index()` to produce deterministic findings alongside LLM analysis. +- **`cora scan` now includes index findings.** Fixed bug where `cora scan` did not wire index scanners (unused imports, dead code) — the scan command now runs `scan_project_index()` to produce deterministic findings alongside LLM analysis. - **Error fallback preserves index findings.** When LLM review fails, the fallback path now includes all index-based findings instead of silently dropping them. ### Added -- **`index_skip_files` config field** — New field in `RulesConfig` and `.cora.yaml` `rules_engine` section. Supports glob patterns (`*.config.ts`, `vite.config.*`, `**/main.ts`). Configurable per-project. +- **`index_skip_files` config field** — New field in `RulesConfig` and `.cora.yaml` `rules_engine` section. Supports simple glob patterns (`*.config.ts`, `vite.config.*`, `**/main.ts`). Configurable per-project. - **`should_skip_file()` helper** — Glob matching utility for index scanner file filtering. - **8 new unit tests** — Tests for `should_skip_file()` covering exact match, wildcard suffix/prefix, `**/` patterns, and default skip list validation. @@ -44,77 +85,81 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Context enrichment** — Impact analysis, affected tests, and brain search injected into LLM review prompt. - **Ruby AST extraction** — Fixed `body_statement` wrapper bug in class/module method extraction. -## [0.8.3] - 2026-07-27 - -### Added — Code Intelligence +### Technical -- **Svelte AST symbol indexing** (#384) - - `cora index` with `--features tree-sitter` now extracts functions, arrow functions, and types from `