Expand description
§codelens-engine
Read/mutate/index primitives for CodeLens. Internal API.
Mutation primitives — every function that writes to the project
tree (file_ops::writer::*, auto_import::add_import,
edit_transaction::apply_full_write_with_evidence,
lsp::LspWorkspaceEditTransaction::apply, rename::apply_rename) —
do NOT enforce ADR-0009 role gates, audit sinks, or cache
invalidation contracts. Those guarantees live exclusively in
codelens-mcp’s dispatch pipeline (dispatch::role_gate,
dispatch::session::apply_post_mutation).
Consumers — including third-party crates that depend on
codelens-engine — MUST route mutations through
codelens-mcp (HTTP / stdio MCP protocol, or in-process
dispatch_tool) so the trust substrate can audit, gate, and
invalidate consistently. Calling mutation primitives directly is
supported only inside the workspace (mcp + engine tests + benches);
anything else is at the caller’s own risk and will silently bypass
the project’s principals.toml configuration.
Read primitives (find_*, get_*, search_*, LspSessionPool)
are safe to call directly — they have no side effects on disk or
audit state.
See ADR-0009 (docs/adr/ADR-0009-mutation-trust-substrate.md)
for the full contract this crate participates in.
Re-exports§
pub use auto_import::ImportSuggestion;pub use auto_import::MissingImportAnalysis;pub use auto_import::add_import;pub use auto_import::analyze_missing_imports;pub use call_graph::CallEdge;pub use call_graph::CalleeEntry;pub use call_graph::CallerEntry;pub use call_graph::extract_calls;pub use call_graph::get_callees;pub use call_graph::get_callers;pub use circular::CircularDependency;pub use circular::find_circular_dependencies;pub use coupling::CouplingEntry;pub use coupling::get_change_coupling;pub use db::DirStats;pub use db::IndexDb;pub use db::NewCall;pub use db::NewImport;pub use db::NewSymbol;pub use db::SymbolWithFile;pub use db::content_hash;pub use db::index_db_path;pub use edit_transaction::ApplyError;pub use edit_transaction::ApplyEvidence;pub use edit_transaction::ApplyStatus;pub use edit_transaction::FileHash;pub use edit_transaction::RollbackEntry;pub use edit_transaction::WorkspaceEditTransaction;pub use edit_transaction::apply_full_write_with_evidence;pub use edit_transaction::apply_full_writes_with_evidence;pub use file_ops::DirectoryEntry;pub use file_ops::EnclosingSymbol;pub use file_ops::FileMatch;pub use file_ops::FileReadResult;pub use file_ops::PatternMatch;pub use file_ops::SmartPatternMatch;pub use file_ops::TextReference;pub use file_ops::create_text_file;pub use file_ops::delete_lines;pub use file_ops::extract_word_at_position;pub use file_ops::find_files;pub use file_ops::find_referencing_symbols_via_text;pub use file_ops::insert_after_symbol;pub use file_ops::insert_at_line;pub use file_ops::insert_before_symbol;pub use file_ops::list_dir;pub use file_ops::read_file;pub use file_ops::replace_content;pub use file_ops::replace_lines;pub use file_ops::replace_symbol_body;pub use file_ops::search_for_pattern;pub use file_ops::search_for_pattern_smart;pub use git::ChangedFile;pub use git::DiffSymbol;pub use git::DiffSymbolEntry;pub use git::get_changed_files;pub use git::get_diff_symbols;pub use import_graph::BlastRadiusEntry;pub use import_graph::DeadCodeEntry;pub use import_graph::DeadCodeEntryV2;pub use import_graph::GraphCache;pub use import_graph::ImportanceEntry;pub use import_graph::ImporterEntry;pub use import_graph::extract_imports_for_file;pub use import_graph::find_dead_code;pub use import_graph::find_dead_code_v2;pub use import_graph::get_blast_radius;pub use import_graph::get_importance;pub use import_graph::get_importers;pub use import_graph::resolve_module_for_file;pub use import_graph::supports_import_graph;pub use lsp::LSP_RECIPES;pub use lsp::LspDiagnostic;pub use lsp::LspDiagnosticRequest;pub use lsp::LspRecipe;pub use lsp::LspReference;pub use lsp::LspRenamePlan;pub use lsp::LspRenamePlanRequest;pub use lsp::LspRequest;pub use lsp::LspResolveTargetRequest;pub use lsp::LspResolvedTarget;pub use lsp::LspResourceOp;pub use lsp::LspSessionPool;pub use lsp::LspStatus;pub use lsp::LspTypeHierarchyRequest;pub use lsp::LspWorkspaceEditTransaction;pub use lsp::LspWorkspaceSymbol;pub use lsp::LspWorkspaceSymbolRequest;pub use lsp::check_lsp_status;pub use lsp::default_lsp_args_for_command;pub use lsp::default_lsp_command_for_extension;pub use lsp::default_lsp_command_for_path;pub use lsp::find_referencing_symbols_via_lsp;pub use lsp::get_diagnostics_via_lsp;pub use lsp::get_lsp_recipe;pub use lsp::get_rename_plan_via_lsp;pub use lsp::get_type_hierarchy_via_lsp;pub use lsp::lsp_binary_exists;pub use lsp::resolve_symbol_target_via_lsp;pub use lsp::search_workspace_symbols_via_lsp;pub use project::ProjectRoot;pub use project::WorkspacePackage;pub use project::compute_dominant_language;pub use project::detect_frameworks;pub use project::detect_workspace_packages;pub use rename::RenameEdit;pub use rename::RenameResult;pub use rename::RenameScope;pub use rename::apply_edits;pub use rename::find_all_word_matches;pub use rename::rename_symbol;pub use embedding::EmbeddingEngine;pub use embedding::configured_embedding_model_name;pub use embedding::configured_embedding_runtime_info;pub use embedding::configured_embedding_runtime_preference;pub use embedding::configured_embedding_threads;pub use embedding::embedding_model_assets_available;pub use embedding_types::EmbeddingIndexInfo;pub use embedding_types::EmbeddingRuntimeInfo;pub use embedding_types::SemanticMatch;pub use scope_analysis::ReferenceKind;pub use scope_analysis::ScopedReference;pub use scope_analysis::find_scoped_references;pub use scope_analysis::find_scoped_references_in_file;pub use search::SearchResult;pub use search::search_symbols_hybrid;pub use search::search_symbols_hybrid_with_semantic;pub use symbols::IndexStats;pub use symbols::RankedContextEntry;pub use symbols::RankedContextResult;pub use symbols::SymbolIndex;pub use symbols::SymbolInfo;pub use symbols::SymbolKind;pub use symbols::SymbolProvenance;pub use symbols::find_symbol;pub use symbols::find_symbol_range;pub use symbols::get_symbols_overview;pub use symbols::make_symbol_id;pub use symbols::parse_symbol_id;pub use symbols::sparse_coverage_bonus_from_fields;pub use symbols::sparse_max_bonus;pub use symbols::sparse_threshold;pub use symbols::sparse_weighting_enabled;pub use type_hierarchy::TypeHierarchyResult;pub use type_hierarchy::TypeNode;pub use type_hierarchy::get_type_hierarchy_native;pub use watcher::FileWatcher;pub use watcher::WatcherStats;pub use ir::CodeDiagnostic;pub use ir::DiagnosticSeverity;pub use ir::EditAction;pub use ir::EditActionKind;pub use ir::EditPlan;pub use ir::ImpactKind;pub use ir::ImpactNode;pub use ir::IntelligenceSource;pub use ir::IrCallEdge;pub use ir::PreciseBackend;pub use ir::Relation;pub use ir::RelationKind;pub use ir::RetrievalConfig;pub use ir::RetrievalStage;pub use ir::RetrievalWeights;pub use ir::SearchCandidate;
Modules§
- auto_
import - Automatic import suggestion and insertion.
- call_
graph - change_
signature - circular
- community
- Louvain-style community detection on the import graph. Produces a high-level architecture overview by grouping tightly-coupled files.
- coupling
- db
- edit_
transaction - Workspace edit transaction substrate.
- embedding
- Semantic search using fastembed + sqlite-vec.
Gated behind the
semanticfeature flag. - embedding_
store - Data types for vector embedding storage.
- embedding_
types - Pure data types for semantic search results.
Unconditional — available whether or not the
semanticfeature is enabled. - file_
ops - git
- import_
graph - inline
- ir
- Canonical semantic IR types for downstream consumers.
- lang_
registry - Single source of truth for supported language extensions.
- lsp
- memory
- Project memory file management — .codelens/memories/ persistence layer.
- move_
symbol - oxc_
analysis - Precise JS/TS scope analysis using oxc_semantic. Provides compiler-grade reference resolution without LSP.
- project
- rename
- scope_
analysis - Scope-aware reference analysis using tree-sitter.
- search
- symbols
- type_
hierarchy - Tree-sitter based type hierarchy analysis.
- vfs
- Virtual File System event normalization layer.
- watcher