1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! trusty-search library crate.
//!
//! Why: Exposes the previously separate `trusty-search-core`, `-service`, and
//! `-mcp` sub-crate modules under a single library target so integration tests
//! (and downstream consumers) can reach the internal APIs after the workspace
//! was consolidated into one crate.
//! What: Re-publishes `core`, `service`, and `mcp` as `pub mod`s. The `main`
//! binary uses these via `crate::core::...`; integration tests use
//! `trusty_search::core::...`.
//! Test: `cargo build --lib` succeeds; `cargo test` runs integration tests
//! that import `trusty_search::core::*`.
// Why: surface the unified `rpc.discover` service descriptor at the crate
// root so open-mpm and other host processes can `use trusty_search::SearchMcpService`
// without traversing into the internal module layout (closes #115).
pub use SearchMcpService;
/// Compute the tokio worker-thread count for this machine.
///
/// Why (issue #1006): raising the floor to 16 prevents accept-loop starvation
/// when embed-pool workers block on 30 s CoreML/CUDA sidecar calls; with only
/// `available_parallelism` workers (e.g. 8 on a 4-core box) and tasks blocking
/// on long embed calls, the axum accept loop starves.
/// What: returns `max(cpu_count, 16)`. The result is always `>= 16`.
/// Test: `worker_thread_count_at_least_16` in `tests_state.rs` — asserts the
/// floor with `cpu_count=1` (→ 16) and the pass-through with `cpu_count=32` (→ 32).
// Regression tests for persistence data-integrity fixes (#1088, #1089, #1090).
// Extracted from persistence.rs to keep that file under its line-cap budget.