| Add a search option | SearchOptions, as run_query fills it | The request in run_query, the handler, the MCP arguments, and build_search_request_for_path in src/web.rs | |
src/cli.rs:2223-22352223let local_options = SearchOptions {
2224 limit,
2225 context: cli.context,
2226 type_filter: cli.type_filter.clone(),
2227 include_globs: cli.include.clone(),
2228 exclude_globs: cli.exclude.clone(),
2229 scope_filter: scope_filter.clone(),
2230 skip_gitignore: cli.skip_gitignore,
2231 force_neural: cli.force_neural,
2232 progress_tx: None,
2233 cancel_token: None,
2234}; src/search.rs:95-10795pub struct SearchOptions {
96 pub limit: Option<usize>,
97 pub context: usize,
98 pub type_filter: Option<String>,
99 pub include_globs: Vec<String>,
100 pub exclude_globs: Vec<String>,
101 pub scope_filter: Option<WorkspaceScope>,
102 pub skip_gitignore: bool,
103 pub force_neural: bool,
104 pub progress_tx: Option<std::sync::mpsc::Sender<(String, usize, usize)>>,
105 /// When set to `true`, the search should bail out as soon as possible.
106 pub cancel_token: Option<std::sync::Arc<std::sync::atomic::AtomicBool>>,
107} src/cli.rs:2208-22222208let request = DaemonRequest::Search {
2209 path: query_path_opt.clone(),
2210 query: query.to_string(),
2211 limit,
2212 context: cli.context,
2213 type_filter: cli.type_filter.clone(),
2214 include_globs: cli.include.clone(),
2215 exclude_globs: cli.exclude.clone(),
2216 scope_path: scope_path.clone(),
2217 scope_is_file,
2218 skip_gitignore: cli.skip_gitignore,
2219 force_neural: cli.force_neural,
2220 hash_only: cli.hash,
2221 disable_memory_expansion: cli.no_memory_expansion_internal,
2222}; src/mcp.rs:126-151126query: Option<String>,
127path: Option<String>,
128output: Option<String>,
129#[serde(default, deserialize_with = "integer_argument")]
130budget_tokens: Option<usize>,
131since: Option<String>,
132#[serde(default, deserialize_with = "integer_argument")]
133limit: Option<usize>,
134#[serde(default, deserialize_with = "integer_argument")]
135hits_per_file: Option<usize>,
136#[serde(default, deserialize_with = "integer_argument")]
137context: Option<usize>,
138#[serde(rename = "type")]
139type_filter: Option<String>,
140regex: Option<bool>,
141literal: Option<bool>,
142symbol: Option<bool>,
143refs: Option<bool>, 8 more lines src/web.rs:681-690681fn build_search_request_for_path(
682 params: &HashMap<String, Vec<String>>,
683 path: Option<PathBuf>,
684) -> Result<DaemonRequest> {
685 let query = param(params, "q").unwrap_or_default();
686 // Spaces are part of a pattern.
687 let query = match param(params, "mode") {
688 Some("literal" | "regex") => query.trim_matches(['\r', '\n']),
689 _ => query.trim(),
690 } |
| Add an MCP argument | IvygrepSearchArgs | search_tool_schema, the checks, and the daemon request | |
src/mcp.rs:123-151123#[derive(Debug, Deserialize)]
124#[serde(deny_unknown_fields)]
125struct IvygrepSearchArgs {
126 query: Option<String>,
127 path: Option<String>,
128 output: Option<String>,
129 #[serde(default, deserialize_with = "integer_argument")]
130 budget_tokens: Option<usize>,
131 since: Option<String>,
132 #[serde(default, deserialize_with = "integer_argument")]
133 limit: Option<usize>,
134 #[serde(default, deserialize_with = "integer_argument")]
135 hits_per_file: Option<usize>,
136 #[serde(default, deserialize_with = "integer_argument")]
137 context: Option<usize>,
138 #[serde(rename = "type")]
139 type_filter: Option<String>,
140 regex: Option<bool>,11 more lines src/mcp.rs:821-842821fn search_tool_schema() -> Value {
822 json!({
823 "name": TOOL_IG_SEARCH,
824 "title": "Search local code or build a task context pack",
825 "description": "Hybrid semantic+lexical code search and token-budgeted task context. Auto-indexes on first query, stays local, respects .gitignore, and restricts results to the provided path s
826 "inputSchema": {
827 "type": "object",
828 "properties": {
829 "query": {"type": "string", "description": "Natural-language or keyword query. Uppercase AND, OR, and NOT between terms are Boolean operators (NOT excludes matches); write them in lowe
830 "path": {"type": "string", "description": "Workspace path, subdirectory, or file path. Defaults to current directory."},
831 "output": {
832 "type": "string",
833 "enum": ["hits", "context_pack"],
834 "default": "hits",
835 "description": "Return ranked search hits or one task-ready, relationship-expanded context pack. context_pack keeps the same single MCP tool call."
836 },
837 "budget_tokens": {
838 "type": "integer",4 more lines src/mcp.rs:1746-17751746if args.limit == Some(0) || args.limit.is_some_and(|limit| limit > 1000) {
1747 bail!("limit must be between 1 and 1000");
1748}
1749if args
1750 .hits_per_file
1751 .is_some_and(|hits| !(1..=MAX_HITS_PER_FILE).contains(&hits))
1752{
1753 bail!("hits_per_file must be between 1 and {MAX_HITS_PER_FILE}");
1754}
1755if args.context.is_some_and(|context| context > 100) {
1756 bail!("context must be between 0 and 100");
1757}
1758if args
1759 .budget_tokens
1760 .is_some_and(|budget| !(256..=131_072).contains(&budget))
1761{
1762 bail!("budget_tokens must be between 256 and 131072");
1763}12 more lines src/mcp.rs:1864-18761864let daemon_request = DaemonRequest::ContextPack {
1865 path: workspace.root.clone(),
1866 query: query.to_string(),
1867 budget_tokens,
1868 since: args.since.clone(),
1869 context: search_options.context,
1870 type_filter: args.type_filter.clone(),
1871 include_globs: include_globs.clone(),
1872 exclude_globs: exclude_globs.clone(),
1873 scope_path: scope_filter.as_ref().map(|scope| scope.rel_path.clone()),
1874 scope_is_file: scope_filter.as_ref().is_some_and(|scope| scope.is_file),
1875 skip_gitignore: search_options.skip_gitignore,
1876}; |
| Add a daemon request | DaemonRequest and handle_request_with_cancellation | Protocol versions, the client timeout, and, if it can be cancelled, is_search_request | |
src/daemon.rs:4466-44704466match request {
4467 DaemonRequest::Version => DaemonResponse::Version {
4468 version: Some(BUILD_VERSION.to_string()),
4469 },
4470 DaemonRequest::RuntimeStatus { path } => { src/protocol.rs:18-2218/// Wire protocol version for daemon request compatibility.
19pub const DAEMON_PROTOCOL_VERSION: u32 = 12;
20/// Older clients can omit the literal output mode and retain hit limits.
21/// This lets long-lived MCP sessions keep using a newer daemon.
22pub const MIN_DAEMON_PROTOCOL_VERSION: u32 = 8; src/daemon.rs:7332-73477332DaemonRequest::Index { .. } => 1800, // 30 min for large repos
7333DaemonRequest::StartIndex { .. } => 30, // enqueue only; generous for a loaded daemon
7334DaemonRequest::Version
7335| DaemonRequest::RuntimeStatus { .. }
7336| DaemonRequest::Status
7337| DaemonRequest::ServeWeb { .. }
7338| DaemonRequest::EnsureWatcher { .. }
7339| DaemonRequest::Restart => 5, // quick
7340DaemonRequest::Search { .. }
7341| DaemonRequest::RegexSearch { .. }
7342| DaemonRequest::LiteralSearch { .. }
7343| DaemonRequest::CancelSearch { .. } => 120, // wait for active search shutdown
7344DaemonRequest::ContextPack { .. } => 600, // several searches plus graph expansion
7345DaemonRequest::Remove { .. } => 30, // cleanup
7346// Each removal first waits for the searches that still read the index.
7347DaemonRequest::CollectOrphanedIndexes => 300, src/daemon.rs:4399-44324399fn is_search_request(request: &DaemonRequest) -> bool {
4400 matches!(
4401 request,
4402 DaemonRequest::Search { .. }
4403 | DaemonRequest::RegexSearch { .. }
4404 | DaemonRequest::LiteralSearch { .. }
4405 | DaemonRequest::ContextPack { .. }
4406 )
4407}
4408
4409/// Every search gets a cancellation token so disconnects and deadlines can
4410/// stop it. Only requests carrying a `request_id` are registered for explicit
4411/// `CancelSearch`; the registration keeps the existing tombstone semantics.
4412fn register_request_cancellation(
4413 state: &DaemonState,
4414 envelope: &DaemonRequestEnvelope,
4415) -> std::result::Result<
4416 (Option<ActiveSearchRegistration>, Option<SearchCancellation>),16 more lines |
| Add a language | LANGUAGES | resolve_type_alias, the grammar and query in tree_sitter_query, and INDEX_FORMAT_VERSION | |
src/chunking.rs:99-10799/// Master language table. Order matters only when extensions overlap —
100/// the first match wins.
101static LANGUAGES: &[LanguageDef] = &[
102 // ── Systems ────────────────────────────────────────────────────────
103 LanguageDef {
104 name: "rust",
105 extensions: &["rs"],
106 filenames: &[],
107 detect_signature: detect_rust, src/chunking.rs:461-484461"js" => "javascript",
462"ts" | "tsx" => "typescript",
463"jsx" | "mjs" | "cjs" => "javascript",
464"bash" | "zsh" | "fish" => "shell",
465"yml" | "toml" | "yaml" | "ini" | "cfg" => "config",
466"objective-c" | "objective_c" | "objectivec" => "objc",
467"proto" => "protobuf",
468"tf" | "hcl" => "terraform",
469"gql" => "graphql",
470"rb" | "rake" => "ruby",
471"kt" | "kts" => "kotlin",
472"ex" | "exs" => "elixir",
473"erl" | "hrl" => "erlang",
474"hs" => "haskell",
475"ml" | "mli" => "ocaml",
476"pl" | "pm" => "perl",
477"clj" | "cljs" | "cljc" => "clojure",
478"jl" => "julia", 6 more lines src/chunking.rs:2597-26222597fn tree_sitter_query(
2598 rel_path: &Path,
2599 language: &str,
2600 line_count: usize,
2601) -> Option<(tree_sitter::Language, Option<&'static tree_sitter::Query>)> {
2602 use std::sync::OnceLock;
2603
2604 macro_rules! cached_query {
2605 ($cell:ident, $grammar:expr, $query:expr) => {{
2606 static $cell: OnceLock<Option<tree_sitter::Query>> = OnceLock::new();
2607 let grammar: tree_sitter::Language = $grammar.into();
2608 let query = $cell
2609 .get_or_init(|| tree_sitter::Query::new(&grammar, $query).ok())
2610 .as_ref();
2611 Some((grammar, query))
2612 }};
2613 }
26148 more lines src/workspace.rs:70-7470pub const INDEX_FORMAT_VERSION: u32 = 31;
71const COMPACTION_FREE_BYTES_THRESHOLD: u64 = 16 * 1024 * 1024;
72const COMPACTION_FREE_PERCENT_THRESHOLD: f64 = 20.0;
73
74#[derive(Clone, Copy, Eq, PartialEq)] Incompatible schema, chunking, or vector-identity changes must bump it and provide rebuild or migration behavior. docs/architecture.md, sentence 173
|
| Change a stored field | create_tables_schema, build_schema | The fields in open_tantivy_index, the insert of rows, and INDEX_FORMAT_VERSION | |
src/indexer/storage.rs:421-441421pub(super) fn create_tables_schema(conn: &Connection, create_indexes: bool) -> Result<()> {
422 conn.execute_batch(
423 r#"
424 CREATE TABLE IF NOT EXISTS chunks (
425 chunk_key INTEGER PRIMARY KEY,
426 file_path TEXT NOT NULL,
427 start_line INTEGER NOT NULL,
428 end_line INTEGER NOT NULL,
429 language TEXT NOT NULL,
430 kind TEXT NOT NULL,
431 text TEXT NOT NULL,
432 vector_key INTEGER NOT NULL,
433 modified_unix INTEGER NOT NULL,
434 is_ignored INTEGER NOT NULL DEFAULT 0
435 );
436
437 CREATE TABLE IF NOT EXISTS _stats (
438 key TEXT PRIMARY KEY,2 more lines src/indexer/storage.rs:608-618608schema.add_u64_field("vector_key", STORED | FAST);
609schema.add_text_field("file_path", STRING | STORED);
610schema.add_u64_field("start_line", STORED);
611schema.add_u64_field("end_line", STORED);
612schema.add_text_field("language", STRING | STORED);
613schema.add_text_field("kind", STRING | STORED);
614schema.add_text_field("text", code_text_opts.clone());
615schema.add_text_field("text_trigrams", trigram_text_opts);
616schema.add_u64_field("is_ignored", STORED);
617schema.add_text_field("file_path_text", boosted_aux_text_opts.clone());
618schema.add_text_field("signature", boosted_aux_text_opts); src/indexer/storage.rs:645-658645let schema = index.schema();
646let fields = TantivyFields {
647 vector_key: schema.get_field("vector_key")?,
648 file_path: schema.get_field("file_path")?,
649 start_line: schema.get_field("start_line")?,
650 end_line: schema.get_field("end_line")?,
651 language: schema.get_field("language")?,
652 kind: schema.get_field("kind")?,
653 text: schema.get_field("text")?,
654 text_trigrams: schema.get_field("text_trigrams").ok(),
655 is_ignored: schema.get_field("is_ignored").ok(),
656 file_path_text: schema.get_field("file_path_text").ok(),
657 signature: schema.get_field("signature").ok(),
658}; src/indexer.rs:1888-18901888for prepared in indexed_chunks {
1889 let indexed = &prepared.chunk;
1890 persist_or_stop!(insert_chunk( src/workspace.rs:70-7470pub const INDEX_FORMAT_VERSION: u32 = 31;
71const COMPACTION_FREE_BYTES_THRESHOLD: u64 = 16 * 1024 * 1024;
72const COMPACTION_FREE_PERCENT_THRESHOLD: f64 = 20.0;
73
74#[derive(Clone, Copy, Eq, PartialEq)] Incompatible schema, chunking, or vector-identity changes must bump it and provide rebuild or migration behavior. docs/architecture.md, sentence 173
|
| Change which files are indexed | source_walker_scoped | SourcePathMatcher, the watcher filter, which shares NestedCheckouts, the targeted refresh, and SOURCE_RULES_VERSION | |
src/walker.rs:39-5039let nested_checkouts = crate::workspace::NestedCheckouts::new(root);
40let enclosing_rules = EnclosingGitRules::new(root, skip_gitignore).map(Mutex::new);
41let needs_enclosing_rules = AtomicBool::new(false);
42walker.filter_entry(move |entry| {
43 let is_dir = entry.depth() > 0 && entry.file_type().is_some_and(|kind| kind.is_dir());
44 scope.as_ref().is_none_or(|scope| scope.starts_with(entry.path()) || entry.path().starts_with(scope))
45 && entry.file_name() != ".git"
46 && !is_owned_storage_path(&workspace_root, entry.path(), owned_root.as_deref())
47 // A nested worktree or clone is a workspace of its own.
48 && !(is_dir && nested_checkouts.is_separate_checkout(&workspace_root, entry.path()))
49 && !enclosing_rules.as_ref().is_some_and(|rules| {
50 // The walk calls this for a directory before its entries. Most src/walker.rs:237-254237pub(crate) struct SourcePathMatcher {
238 root: PathBuf,
239 owned_root: Option<PathBuf>,
240 nested_checkouts: crate::workspace::NestedCheckouts,
241 ignore: SourceIgnore,
242 error: Option<ignore::Error>,
243}
244
245impl SourcePathMatcher {
246 pub(crate) fn new(root: &Path, skip_gitignore: bool) -> Self {
247 Self {
248 root: root.to_path_buf(),
249 owned_root: owned_storage_root(root),
250 nested_checkouts: crate::workspace::NestedCheckouts::new(root),
251 ignore: SourceIgnore::new(&source_walker(root, skip_gitignore), skip_gitignore),
252 error: None,
253 }
254 } src/merkle.rs:509-530509pub fn refresh_paths_in_place(
510 &mut self,
511 root: &Path,
512 rel_paths: &[PathBuf],
513 skip_gitignore: bool,
514) -> Result<Option<MerkleDiff>> {
515 if skip_gitignore {
516 return Ok(None);
517 }
518
519 validate_workspace_root(root)?;
520 let mut updates = BTreeMap::new();
521 for rel_path in rel_paths {
522 // Full walks skip non-UTF-8 names; a lossy key could alias a real file.
523 if rel_path.to_str().is_none() {
524 continue;
525 }
526 if rel_path.as_os_str().is_empty() || is_ignore_file(rel_path) {4 more lines src/indexer.rs:99-10199/// The rules that select source files. Version 2 stops `.gitignore` rules at
100/// the root of a repository.
101const SOURCE_RULES_VERSION: u32 = 2; A checkout nested inside a Git workspace is a workspace of its own, as it is for Git and for Workspace::resolve. docs/architecture.md, sentence 49
The file walker, the request-local path matcher, and the watcher event filter share one rule (NestedCheckouts in src/workspace.rs): below a Git workspace root they skip a directory whose .git entry marks a linked worktree (a .git file whose Git directory has a commondir), a nested clone (a .git directory), or a clone made with git clone --separate-git-dir (a .git file pointing at a full Git directory elsewhere). docs/architecture.md, sentence 50
|
| Change ranking | fuse_rrf_with_context | Candidate limits, the rerank limit, and a relevance measurement before and after | |
src/search_fusion.rs:294-304294let mut entries: HashMap<u64, RrfEntry> = HashMap::new();
295let mut add_entry = |chunk: IndexedChunk, score: f32, sources: SourceMask| {
296 let vector_key = chunk.vector_key;
297 let entry = entries.entry(vector_key).or_insert_with(|| RrfEntry {
298 score: 0.0,
299 chunk,
300 sources: 0,
301 });
302 entry.score += score;
303 entry.sources |= sources;
304}; src/search_execution.rs:83-9483let corpus_multiplier =
84 corpus_candidate_multiplier(ctx.searchers.iter().map(tantivy::Searcher::num_docs).sum());
85// Tantivy lexical candidates: enough headroom for remaining post-hoc
86// visibility filters without blowing up on huge repos.
87// Default natural-language query: 50 → 250, --limit 500 → 2.5K.
88let candidate_limit = if output_limit == usize::MAX {
89 50_000
90} else {
91 output_limit
92 .saturating_mul(routing.lexical_multiplier)
93 .clamp(150, 50_000)
94}; src/search.rs:5120-51325120fn rerank_candidate_limit_for_routing(routing: QueryRouting) -> usize {
5121 if let Some(configured) = configured_rerank_candidate_limit() {
5122 return configured;
5123 }
5124 if !learned_reranker_enabled_by_env() {
5125 return 30;
5126 }
5127 match routing.intent {
5128 QueryIntent::ExactIdentifier | QueryIntent::Path | QueryIntent::LiteralOrError => 30,
5129 QueryIntent::NaturalLanguage | QueryIntent::DocsTestsExamples | QueryIntent::Mixed => 100,
5130 }
5131} Performance and relevance changes need comparable before/after evidence. docs/architecture.md, sentence 791
Keep hardware, corpus, model, build profile, query set, warmup, and concurrency fixed. docs/architecture.md, sentence 792
Measure relevance before changing routing, fusion, candidate limits, or score ordering. docs/architecture.md, sentence 799
|
| Add an embedding profile | NeuralProfile | NeuralProfile.configured, create_configured_neural_model, and DenseFusionCalibration weights, which are kept only if every tuning task stays non-negative | |
src/embedding.rs:20-2720pub enum NeuralProfile {
21 Static,
22 PotionCode,
23 PotionCodeV2,
24 General,
25 Code,
26 CodeHighQuality,
27} src/embedding.rs:121-135121pub fn configured() -> Self {
122 match std::env::var("IVYGREP_MODEL_PROFILE")
123 .unwrap_or_default()
124 .to_ascii_lowercase()
125 .as_str()
126 {
127 "static" | "portable" | "static-retrieval" | "static-retrieval-v1" => Self::Static,
128 "potion" | "potion-code" | "potion-code-16m" | "potion-code-16m-v1"
129 | "model2vec-code" => Self::PotionCode,
130 "potion-v2" | "potion-code-v2" | "potion-code-16m-v2" | "model2vec-code-v2" => {
131 Self::PotionCodeV2
132 }
133 "general" | "minilm" | "all-minilm-l6-v2" => Self::General,
134 "code" | "codesearchnet" | "code-minilm-l6-v1" => Self::Code,
135 "code-hq" | "code-high-quality" | "code-minilm-l12-v1" => Self::CodeHighQuality, src/embedding.rs:475-489475fn create_configured_neural_model(is_background: bool) -> anyhow::Result<ConfiguredNeuralModel> {
476 let profile = NeuralProfile::configured();
477 match profile {
478 NeuralProfile::Static | NeuralProfile::PotionCode | NeuralProfile::PotionCodeV2 => {
479 StaticEmbeddingModel::new(profile, is_background)
480 .map(Box::new)
481 .map(ConfiguredNeuralModel::Static)
482 }
483 NeuralProfile::General | NeuralProfile::Code | NeuralProfile::CodeHighQuality => {
484 CandleEmbeddingModel::new_internal(is_background)
485 .map(Box::new)
486 .map(ConfiguredNeuralModel::Candle)
487 }
488 }
489} DenseFusionCalibration in src/embedding.rs holds the weights next to the profile: potion-code-16m-v2 uses 0.25 for both shapes, and static-retrieval-v1 and unmeasured profiles use 0, because no constant works across models. docs/architecture.md, sentence 303
To calibrate another embedding profile, fit the two weights the same way, keep a weight only when every tuning task stays non-negative, and check both repository benchmarks. docs/architecture.md, sentence 312
|
| Change worker limits | EnhancementQueue.dispatch | try_acquire_worker_slot, the guards, and both passes in run | |
src/enhancement_queue.rs:229-238229// A started worker may not hold its place yet: it waits for the load
230// guard, or behind a worker of another process. So the daemon also
231// keeps its own workers of a lane within the limit.
232let places = self.host.places();
233let mut capacity = HashMap::new();
234for lane in [WorkerLane::Hash, WorkerLane::Neural] {
235 let mine = started.values().filter(|worker| worker.lane == lane);
236 let free = self.host.free_places(lane);
237 capacity.insert(lane, free.min(places.saturating_sub(mine.count())));
238} src/indexer/enhancement.rs:187-201187pub(crate) fn try_acquire_worker_slot(lane: WorkerLane) -> Result<Option<WorkerSlot>> {
188 for index in 0..crate::config::enhance_max_workers() {
189 match probe_slot(lane, index) {
190 SlotProbe::Free(file) => return Ok(Some(WorkerSlot(Some(file)))),
191 SlotProbe::Held => {}
192 SlotProbe::Unusable(error) => {
193 tracing::warn!(
194 "enhancement worker places cannot be locked ({error}); running without the IVYGREP_ENHANCE_MAX_WORKERS limit"
195 );
196 return Ok(Some(WorkerSlot(None)));
197 }
198 }
199 }
200 Ok(None)
201} src/indexer/resources.rs:384-391384/// Reason the given enhancement tier should pause right now, if any.
385pub(super) fn check_system_constraints(tier: EnhancementTier) -> Option<String> {
386 if cfg!(test) || std::env::var("CI").is_ok() {
387 return None;
388 }
389 let snapshot = constraint_snapshot(tier);
390 enhancement_pause_reason(tier, &snapshot, crate::config::enhance_on_battery())
391} src/cli.rs:650-663650if let Some(path) = &cli.enhance_hash_internal {
651 let workspace = Workspace::resolve(path)?;
652 workspace.ensure_dirs()?;
653 let job = jobs::EnhancementJob::start(&workspace, crate::indexer::WorkerLane::Hash);
654 // Wait for a place among the running workers before touching stores.
655 let Some(_worker_slot) = crate::indexer::admit_worker(
656 &workspace,
657 crate::indexer::WorkerLane::Hash,
658 crate::indexer::WorkerStage::HashPass,
659 )?
660 else {
661 job.abandon("abandoned");
662 release_abandoned_enhancement(&workspace);
663 return Ok(()); src/cli.rs:717-728717if let Some(path) = &cli.enhance_internal {
718 let workspace = Workspace::resolve(path)?;
719 workspace.ensure_dirs()?;
720 let job = jobs::EnhancementJob::start(&workspace, crate::indexer::WorkerLane::Neural);
721 // Wait for a place among the running workers before opening stores.
722 // The run starts with the hash pass, so only the guards of that pass
723 // count here: hash vectors are built on battery too.
724 let Some(worker_slot) = crate::indexer::admit_worker(
725 &workspace,
726 crate::indexer::WorkerLane::Neural,
727 crate::indexer::WorkerStage::HashPass,
728 )? |
| Change the Web UI | web/src/main.ts, respond | Rebuild and commit web/dist; CI fails if the built files differ | |
web/src/main.ts:329-336329function runSearch(options: { preserveSelection?: boolean } = {}): void {
330 const q = currentQuery();
331 if (!options.preserveSelection) fileRequests.cancel();
332 cancelSearch();
333 syncUrlState();
334 if (!q) {
335 state.hits = [];
336 state.contextPack = null; src/web.rs:281-302281match path.as_str() {
282 "/api/status" => {
283 if request.method != "GET" {
284 return method_not_allowed(stream, "GET").await;
285 }
286 let response = crate::daemon::handle_web_request(state, DaemonRequest::Status).await;
287 write_json(stream, "200 OK", &serde_json::to_value(response)?).await
288 }
289 "/api/search" => {
290 if request.method != "GET" {
291 return method_not_allowed(stream, "GET").await;
292 }
293 let value = run_search(state, ¶ms).await;
294 write_json(stream, "200 OK", &value).await
295 }
296 "/api/search/stream" => {
297 if request.method != "GET" {
298 return method_not_allowed(stream, "GET").await;4 more lines .github/workflows/ci.yml:67-7367- name: Verify web frontend
68 run: |
69 cd web
70 corepack pnpm install --frozen-lockfile
71 corepack pnpm check
72 corepack pnpm build
73 git -C .. diff --exit-code -- web/dist Surface: Web frontend | Primary code: web/src/ | Responsibility: Search, context, tree, and file-viewer interactions docs/architecture.md, sentence 29
Frontend source changes therefore require a deterministic pnpm -C web build and committed generated assets. docs/architecture.md, sentence 38
|