tools tier

tools-retrieval-eval

Sprint 3.39 retrieval eval: scores hybrid RRF search against a frozen, DB-anchored gold set. recall.rs is a pure precision@k/recall@k evaluator, baseline.rs a pure keyed-line ratchet (no DB, no embedder, both fully unit-tested); the gold set is checked-in fixture data. main.rs is the documented Gate-2 DB-shell: connects to the live index, runs the frozen gold queries, and enforces the ratchet.

Sprint 3.39 retrieval eval: scores hybrid RRF search against a frozen, DB-anchored gold set. recall.rs is a pure precision@k/recall@k evaluator, baseline.rs a pure keyed-line ratchet (no DB, no embedder, both fully unit-tested); the gold set is checked-in fixture data. main.rs is the documented Gate-2 DB-shell: connects to the live index, runs the frozen gold queries, and enforces the ratchet.

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/retrieval-eval
Edition2021
Targetstools-retrieval-eval, tools_retrieval_eval
Public items11 across 3 modules
Tests34

What it is for

Sprint 3.39 retrieval eval: scores hybrid RRF search against a frozen, DB-anchored gold set. recall.rs is a pure precision@k/recall@k evaluator, baseline.rs a pure keyed-line ratchet (no DB, no embedder, both fully unit-tested); the gold set is checked-in fixture data. main.rs is the documented Gate-2 DB-shell: connects to the live index, runs the frozen gold queries, and enforces the ratchet.

Capabilities

baseline (other)

Pure baseline-ratchet logic (sprint 3.39 Phase 0 task 1, DB-shell binary

Item
fn flatten(report : & EvalReport, k : usize) -> BTreeMap <String, f64>
fn render(map : & BTreeMap <String, f64>) -> String
fn parse(text : & str) -> Result <BTreeMap <String, f64>, String>

Regression

Pure baseline-ratchet logic (sprint 3.39 Phase 0 task 1, DB-shell binary

Item
pub enum Regression
fn regressions(current : & BTreeMap <String, f64>, baseline : & BTreeMap <String, f64>,) -> Vec <Regression>

gold_books_v1 (other)

Frozen, DB-anchored gold set — sprint 3.39 Class A (books, v1).

Item
fn cases() -> Vec <GoldCase>

recall (other)

Pure retrieval-quality scorer (sprint 3.39 Phase 0 task 1). No DB, no

Item
fn score(gold : & GoldCase, retrieved : & HashMap <String, Vec <String>>, k : usize) -> EvalReport

CaseResult

Pure retrieval-quality scorer (sprint 3.39 Phase 0 task 1). No DB, no

Item
pub struct CaseResult

CorpusAggregate

Pure retrieval-quality scorer (sprint 3.39 Phase 0 task 1). No DB, no

Item
pub struct CorpusAggregate

EvalReport

Pure retrieval-quality scorer (sprint 3.39 Phase 0 task 1). No DB, no

Item
pub struct EvalReport

GoldCase

Pure retrieval-quality scorer (sprint 3.39 Phase 0 task 1). No DB, no

Item
pub struct GoldCase

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

tools_retrieval_eval

flowchart TD
  n_tools_retrieval_eval["tools_retrieval_eval"]
  n_tools_retrieval_eval --> n_baseline["baseline"]
  n_tools_retrieval_eval --> n_gold_books_v1["gold_books_v1"]
  n_tools_retrieval_eval --> n_recall["recall"]

Public surface

`baseline`

ItemWhat it is
fn flatten(report : & EvalReport, k : usize) -> BTreeMap <String, f64>Flatten a report into the same key -> value shape the baseline file stores, at cutoff k
fn render(map : & BTreeMap <String, f64>) -> StringRender a flattened map as the keyed-line baseline text, at RENDER_DECIMALS places.
fn parse(text : & str) -> Result <BTreeMap <String, f64>, String>Parse baseline text back into a key -> value map
pub enum RegressionOne baseline key that failed to hold.
fn regressions(current : & BTreeMap <String, f64>, baseline : & BTreeMap <String, f64>,) -> Vec <Regression>Every baseline key not held by current — new keys in current that aren't in baseline are growth, never a regression.

`gold_books_v1`

ItemWhat it is
fn cases() -> Vec <GoldCase>The 6 Class-A cases

`recall`

ItemWhat it is
pub struct GoldCaseOne labeled query -> gold-answer case
pub struct CaseResultPer-case score
pub struct CorpusAggregate
pub struct EvalReport
fn score(gold : & GoldCase, retrieved : & HashMap <String, Vec <String>>, k : usize) -> EvalReportScore every gold case against its retrieved (raw, rank-ordered, un-deduped, un-truncated) doc refs, keyed by case_id — not by query text, since two cases may share a query

Re-exports. Exported here, defined elsewhere.

ExportDefined in
{score,CaseResult,CorpusAggregate,EvalReport,GoldCase}recall::{score,CaseResult,CorpusAggregate,EvalReport,GoldCase}

Boundary

Reaches into infrastructure.

Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)tools
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/tools/retrieval-eval
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_tools["tools"] --> n_infrastructure["infrastructure"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`infrastructure-doc-ingest`infrastructurenoalways
`infrastructure-knowledge-index`infrastructurenoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
clap^4derivenoalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
tokio^1full, macros, rt-multi-threadnoalways
uuid^1v4, v7, serde, jsnoalways

Development, in this workspace.

CrateTierOptionalOnly on
`tools-cli-conformance`toolsnoalways

Build. None.

Depended on by. Nothing in this workspace.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  SELF["tools-retrieval-eval"]
  SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"]
  SELF -->|runtime| n_infrastructure_doc_ingest["infrastructure-doc-ingest"]
  SELF -->|runtime| n_infrastructure_knowledge_index["infrastructure-knowledge-index"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
ortinfrastructure-doc-ingest/ortno
flowchart LR
  n_ort["ort"] --> n_infrastructure_doc_ingest_ort["infrastructure-doc-ingest/ort"]

Targets

KindNameSource
bintools-retrieval-eval`src/main.rs`
libtools_retrieval_eval`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimeyes
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
DATABASE_URLsrc/main.rs
ORG_KNOWLEDGE_DBsrc/main.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests34
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
baseline500
gold_books_v1100
recall500

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc911
Public modules with a //! block33
pie showData
    title Public items with rustdoc
    "Documented" : 9
    "No rustdoc detected" : 2

Metrics

MetricValue
Rust source files5
Source lines1039
Code lines815
Public API items11
Public modules3
Tests34
Examples0
Cargo features1
Direct runtime dependencies6
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "enum" : 1
    "function" : 6
    "struct" : 4
pie showData
    title Rust source composition
    "Code" : 815
    "Blank or comment" : 224

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All tools · Manual