Skip to main content

vera2_core/
lib.rs

1//! Vera Core — parsing, indexing, retrieval, storage, and embedding engine.
2//!
3//! This crate provides the core functionality for Vera's code indexing and
4//! retrieval pipeline. It is consumed by `vera-cli` (CLI interface) and
5//! `vera-mcp` (MCP server).
6//!
7//! # Module overview
8//!
9//! - [`parsing`] — Tree-sitter based source code parsing and AST extraction.
10//! - [`indexing`] — Building and maintaining the search index (BM25, vectors).
11//! - [`retrieval`] — Hybrid search, fusion, and reranking pipeline.
12//! - [`storage`] — Persistent storage backends (SQLite + sqlite-vec, Tantivy).
13//! - [`embedding`] — Embedding generation via external API providers.
14
15mod cancellation;
16pub mod chunk_text;
17pub mod corpus;
18pub mod discovery;
19pub mod embedding;
20pub mod git_scope;
21
22pub use cancellation::CancellationToken;
23
24/// Install the rustls crypto provider (ring). Safe to call multiple times.
25pub fn init_tls() {
26    let _ = rustls::crypto::ring::default_provider().install_default();
27}
28
29pub mod indexing;
30pub mod parsing;
31pub(crate) mod path_containment;
32pub mod presentation;
33pub mod retrieval;
34pub mod storage;
35
36/// Shared types used across multiple modules.
37pub mod types;
38
39/// Configuration types and defaults.
40pub mod config;
41
42pub mod local_models;
43
44/// Index statistics collection.
45pub mod stats;
46
47#[cfg(test)]
48mod test_env;