Conversation
ExplainMatch: chunk-level semantic explanation. Given a query (file URI or free text) and a result URI, chunks the result file, batch-embeds all chunks, and returns the top-k by cosine score with start_line/end_line and chunk_text. Turns "this file is relevant" into "these lines drove the match." Model provenance: set_file_embedding/set_symbol_embedding now take a model name and store it in file_embedding_models/symbol_embedding_models. EmbeddingBatch persists used_model from embed_texts. QueryFileStatus exposes embedding_model per file. QueryIndexStatus exposes mixed_models bool and models_in_index list — the MCP tool warns when a model upgrade left cosine scores unreliable across the boundary. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExplainMatch— new wire message andlip_explain_matchMCP tool. Chunksresult_uri's source intochunk_lines-line windows (default 20), batch-embeds all chunks, cosine-scores each against the query embedding (cached URI or on-the-fly text), and returns the top-kExplanationChunk { start_line, end_line, chunk_text, score }records. Turns "this file is relevant" into "these specific lines drove the match."set_file_embedding/set_symbol_embeddingnow record which model produced each vector.EmbeddingBatchhandler persistsused_modelfromembed_texts.QueryFileStatus→embedding_model: Option<String>.QueryIndexStatus→mixed_models: bool+models_in_index: Vec<String>. MCPlip_index_statusemits a⚠ MIXED MODELSwarning when the index contains vectors from more than one model (cosine scores are unreliable across a model-upgrade boundary).Test plan
cargo test --all— 284 tests, 0 failurescargo fmt --all --check— cleancargo build --all— cleanExplainMatchround-trip test intypes.rsFileStatusResult.embedding_modelandIndexStatusResult.mixed_modelsfields present in JSON outputlip explain_matchagainst a real indexed file returns line ranges and scores🤖 Generated with Claude Code