crtx-retrieval 0.1.1

Hybrid retrieval over memory views (lexical + salience; vectors later).
Documentation
//! Read-only retrieval — never mutates memory tables.
#![warn(missing_docs)]

use cortex_core::CortexResult;

pub mod embedding;
pub mod fts5;
pub mod lexical;
pub mod resolve;
pub mod score;
pub mod snippet;

pub use embedding::{
    cosine_similarity, EmbedError, EmbedRecord, EmbedResult, Embedder, LocalStubEmbedder,
    OllamaEmbedder, DEFAULT_OLLAMA_EMBED_MODEL, DEFAULT_OLLAMA_ENDPOINT, NOMIC_EMBED_DIM,
    OLLAMA_BACKEND_ID_PREFIX, STUB_BACKEND_ID, STUB_DIM,
};
pub use fts5::{compose_fuzzy_boost, normalize_bm25, query_fts5, Fts5Hit, FUZZY_BOOST_WEIGHT};
pub use lexical::{LexicalDocument, LexicalExplanation, LexicalHit, LexicalIndex};
pub use resolve::{
    resolve_conflicts, AuthorityLevel, AuthorityProofHint, ConflictingMemoryInput,
    PrecedenceEvidence, ProofClosureHint, ResolutionReason, ResolutionState, ResolverOutput,
};
pub use score::{
    compose_lexical_semantic, score, DomainOverlapExplanation, HybridScoreExplanation,
    ScoreComponent, ScoreInputs, FTS5_WEIGHT_WITH_SEM, LEX_WEIGHT_WITH_SEM, SEM_WEIGHT_WITH_SEM,
};
pub use snippet::{
    extract as extract_snippet, snippet_ansi_highlighted, snippet_plain_text, tokenize_query,
    Snippet, MAX_SNIPPET_CHARS, SNIPPET_LEAD_CHARS,
};

/// Placeholder search hook (`memory search --explain` wiring starts here).
pub fn search_stub(query: &str) -> CortexResult<()> {
    if query.trim().is_empty() {
        return Err(cortex_core::CortexError::Validation(
            "search query must not be empty".into(),
        ));
    }
    Ok(())
}