Skip to main content

Module query

Module query 

Source
Expand description

Query engine for searching indexed code

The query engine loads the memory-mapped cache and executes deterministic searches based on lexical, structural, or symbol patterns.

Re-exports§

pub use filter::LiteralPattern;
pub use filter::QueryFilter;
pub use filter::prepare_literal_pattern;
pub use filter::substring_hint_text;
pub use zero_hint::ExcludedReason;
pub use zero_hint::ZeroHint;

Modules§

filter
Query filter types and stateless filtering helpers
open_index
A shared, reusable handle on the open index files.
result
Result assembly utilities: trigram index reconstruction and file-id resolution
zero_hint
Why a search returned nothing, judged from the FILTER, in a fixed order.

Structs§

QueryEngine
Manages query execution against the index

Constants§

ESTIMATE_FINISH_LINES
Remaining candidate lines at or below which the search just finishes instead of sampling: verifying 128 lines costs less than reasoning about them.
ESTIMATE_PER_FILE_LINES
Candidate lines verified per sampled file, so a single minified bundle with a thousand candidate lines cannot dominate the sample.
ESTIMATE_SAMPLE_FILES
Verify candidate files in path order, in parallel, stopping once budget results exist.

Functions§

generate_ai_instruction
Generate AI instruction based on query results
invalidate_caches
Drop every process-wide memo for workspace_root: the shared open-index handle and the freshness snapshot. Called around index writes so no query in this process keeps serving from replaced files or a stale verdict.