AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.
Rust agent-memoryai-agentsbm25claude-codeclicode-searchcursordatabaseelasticsearchfull-text-searchhybrid-searchjsonllocal-firstmcpmcp-servermodel-context-protocolragrustsearch-enginevector-search
fix(ci): satisfy workspace format and clippy gates
buger6e8172092c4c
diff --git a/engine/crates/xerj-autoindex/src/extract/mod.rs b/engine/crates/xerj-autoindex/src/extract/mod.rsindex a91975c51..d657dd79a 100644--- a/engine/crates/xerj-autoindex/src/extract/mod.rs+++ b/engine/crates/xerj-autoindex/src/extract/mod.rs@@ -310,7 +310,11 @@ mod section_tests {fn sections_are_retrieval_sized() {let t = doc(200, 400);let secs = split_sections(&t);- assert!(secs.len() > 10, "expected many sections, got {}", secs.len());+ assert!(+ secs.len() > 10,+ "expected many sections, got {}",+ secs.len()+ );for s in &secs {assert!(s.len() <= 2 * SECTION_CHARS,@@ -327,12 +331,22 @@ mod section_tests {assert!(secs.len() >= 2);let mut overlaps = 0;for w in secs.windows(2) {- let prev_tail: String = w[0].chars().rev().take(60).collect::<String>().chars().rev().collect();+ let prev_tail: String = w[0]+ .chars()+ .rev()+ .take(60)+ .collect::<String>()+ .chars()+ .rev()+ .collect();if w[1].starts_with(&prev_tail[..prev_tail.len().min(30)]) {overlaps += 1;}}- assert!(overlaps > 0, "no section carried an overlap from its predecessor");+ assert!(+ overlaps > 0,+ "no section carried an overlap from its predecessor"+ );}#[test]@@ -341,7 +355,10 @@ mod section_tests {let secs = split_sections(&t);for i in 0..60 {let marker = format!("p{i} ");- assert!(secs.iter().any(|s| s.contains(&marker)), "paragraph {i} lost");+ assert!(+ secs.iter().any(|s| s.contains(&marker)),+ "paragraph {i} lost"+ );}}diff --git a/engine/crates/xerj-autoindex/src/extract/txt.rs b/engine/crates/xerj-autoindex/src/extract/txt.rsindex dbe7547c7..1682f95d3 100644--- a/engine/crates/xerj-autoindex/src/extract/txt.rs+++ b/engine/crates/xerj-autoindex/src/extract/txt.rs@@ -117,7 +117,10 @@ pub fn extract_lines(let mut fields = Map::new();fields.insert("text".into(), Value::String(text));- fields.insert("start_line".into(), Value::Number((start_line as u64).into()));+ fields.insert(+ "start_line".into(),+ Value::Number((start_line as u64).into()),+ );fields.insert("end_line".into(), Value::Number((end_line as u64).into()));stats.records += 1;let ok = sink(RawRecord {@@ -211,9 +214,12 @@ mod chunk_tests {let out = run(&refs);assert!(out.len() >= 2, "100 lines must produce several chunks");for w in out.windows(2) {- let (_, s0, e0, _) = &w[0];+ let (_, _s0, e0, _) = &w[0];let (_, s1, _, _) = &w[1];- assert!(s1 <= e0, "chunk {s1} must start at/before previous end {e0}");+ assert!(+ s1 <= e0,+ "chunk {s1} must start at/before previous end {e0}"+ );let repeated = e0 - s1 + 1;assert_eq!(repeated as usize, CHUNK_OVERLAP,@@ -230,7 +236,8 @@ mod chunk_tests {for i in 1..=95 {let tok = format!("unique{i}");assert!(- out.iter().any(|(t, _, _, _)| t.split('\n').any(|l| l == tok)),+ out.iter()+ .any(|(t, _, _, _)| t.split('\n').any(|l| l == tok)),"line {i} lost");}@@ -268,6 +275,9 @@ mod chunk_tests {let out = run(&["alpha", "", "beta", "", "gamma"]);assert_eq!(out.len(), 1);assert_eq!(out[0].1, 1);- assert_eq!(out[0].2, 5, "end_line must be the real file line of `gamma`");+ assert_eq!(+ out[0].2, 5,+ "end_line must be the real file line of `gamma`"+ );}}diff --git a/engine/crates/xerj-engine/src/index.rs b/engine/crates/xerj-engine/src/index.rsindex ddb5ada11..db3bc33e2 100644--- a/engine/crates/xerj-engine/src/index.rs+++ b/engine/crates/xerj-engine/src/index.rs@@ -16243,9 +16243,10 @@ fn build_highlight_fragments(/// `EmbeddingError` (500, `circuit_breaking_exception`) with `ctx` prepended./// Takes `impl Display` because the `Embedder` surfaces `anyhow::Error` (the/// classification of transient-vs-permanent already happened inside the proxy).-fn is_embedding_admission_rejection(e: &anyhow::Error) -> bool {+fn is_embedding_admission_rejection(_e: &anyhow::Error) -> bool {#[cfg(feature = "onnx-experimental")]- if e.downcast_ref::<xerj_ai::embedder::OnnxAdmissionError>()+ if _e+ .downcast_ref::<xerj_ai::embedder::OnnxAdmissionError>().is_some(){return true;@@ -16310,6 +16311,7 @@ fn validate_onnx_dimensions(fields: &[FieldConfig]) -> Result<()> {Ok(())}+#[cfg(feature = "onnx-experimental")]fn sha256_file(path: &Path) -> Result<String> {use sha2::{Digest, Sha256};use std::collections::HashMap;@@ -16362,7 +16364,7 @@ fn sha256_file(path: &Path) -> Result<String> {fn configured_onnx_identity(cfg: &xerj_common::config::EmbeddingConfig,) -> Result<Option<PersistedEmbeddingIdentity>> {- if cfg.mode.trim().to_ascii_lowercase() != "onnx-experimental" {+ if !cfg.mode.trim().eq_ignore_ascii_case("onnx-experimental") {return Ok(None);}#[cfg(not(feature = "onnx-experimental"))]diff --git a/engine/crates/xerj-query/src/parser.rs b/engine/crates/xerj-query/src/parser.rsindex c730f949b..dd76596d7 100644--- a/engine/crates/xerj-query/src/parser.rs+++ b/engine/crates/xerj-query/src/parser.rs@@ -3969,7 +3969,10 @@ mod tests {let err = parse_query(&json!({"terms": {"user_id": {"index": "customers", "id": "1", "path": "user_id"}}}));- assert!(err.is_err(), "unresolved terms lookup must error, not MatchNone");+ assert!(+ err.is_err(),+ "unresolved terms lookup must error, not MatchNone"+ );let msg = format!("{}", err.unwrap_err());assert!(msg.contains("terms lookup") && msg.contains("unresolved"),