Expand description
Grounding retrieval benchmark — decided eval (PORT-CONTRACT.d/15).
Port of src/asdecided/services/eval.py. Deterministic by ADR-066: the scored
path is a pure function of (corpus bytes, query set, retrieval code) — no
network, no randomness, no clock. The only wall-clock/build values are
metadata.generated_at and metadata.lore_version, both diagnostic and
excluded from the gate (the parity harness masks them in --json).
The benchmark guards the REAL retrieval surface: a search_artifacts
case consumes resolve::search_index order verbatim, and a get_related
case consumes the incoming neighborhood ordering that the MCP
get_related tool serializes (mirrored here from decided-mcp::graph:: incoming_references — decided-engine cannot depend on decided-mcp, and eval only
needs the ordered id list).
Structs§
- Eval
Usage Error EvalUsageError— the CLI maps this to exit 2 (decided eval: <msg>).- Gate
Failure - One fired gate rule.
- Query
Case - One scored retrieval case (REQ-008).
- Scorecard
- A full benchmark run: gated
metricsplus diagnostic context.
Constants§
- DEFAULT_
BASELINE - DEFAULT_
CONFIG - DEFAULT_
CORPUS - DEFAULT_
QUERIES - K_
VALUES - The ranks the benchmark reports Precision@k / Recall@k at (REQ-003).
- NEGATIVE_
K - The hard-negative window: the widest k (REQ-003).
Functions§
- corpus_
hash corpus_hash(root)—sha256:over rel-path + NUL + bytes + NUL per walked Markdown file, in the corpus walk’s sorted order (REQ-005).- evaluate_
gate evaluate_gate(current, baseline, config)(REQ-006) — one failure per fired rule, deterministic order: negatives, then per gated pair (missing-metric floor / floor / regression).- load_
baseline load_baseline(path)— the committed baselinemetricsobject.- load_
config load_config(path)— floors and tolerance.- load_
query_ set load_query_set(path)— parse and shape-check the committed query set.- query_
set_ hash query_set_hash(path)—sha256:over the raw file bytes.- render_
metrics_ json render_metrics_json(metrics)— what--update-baselinewrites.- render_
scorecard_ human render_scorecard_human(scorecard)— overall / by-category / by-tool / Violations, Python format-spec faithful.- render_
scorecard_ json render_scorecard_json(scorecard)— pretty JSON,ensure_ascii=False.- run_
eval run_eval(root, queries_path)(REQ-001..REQ-005).