3a0f3d8b19
This workspace uses GOOGLE_API_KEY as the canonical Google credential. Accept it ahead of the Gemini-specific aliases so the local evaluation harness can run without a separate GEMINI_API_KEY export. Validation: uv run python -m unittest tests.test_env_project tests.test_evaluate_search_quality and a one-shot keychain-backed resolution check.
1.7 KiB
1.7 KiB
Search Quality Eval
scripts/evaluate_search_quality.py is an optional local evaluation step for retrieval quality. It is not part of the user-facing runtime and does not need to run in CI by default.
What it does:
- runs a baseline revision (default
origin/main) against a candidate checkout - evaluates the fixed 5 reviewer topics by default
- computes deterministic stability metrics:
Jaccardoverlap vs baseline- retention vs baseline
- per-source counts and overlap
- optionally calls Gemini as a judge for graded relevance labels and then computes:
Precision@5nDCG@5- source-coverage recall across the judged union pool
Recommended usage:
uv run python scripts/evaluate_search_quality.py
Useful flags:
uv run python scripts/evaluate_search_quality.py \
--baseline-rev origin/main \
--candidate-rev HEAD \
--no-default-topics \
--topic "cursor IDE pricing" \
--per-source-limit 5
Gemini configuration:
- preferred on this workspace: set
GOOGLE_API_KEY - also accepted:
GEMINI_API_KEYorGOOGLE_GENAI_API_KEY - optional: set
GEMINI_MODEL - default model is
gemini-3-pro-previewfor the direct Gemini API
Notes:
- The script forces a clean env-based auth path when it shells out to
last30days.py. - It passes
XAI_API_KEY,OPENAI_API_KEY, andSCRAPECREATORS_API_KEY, but intentionally does not pass browser-cookie X auth. That keeps evaluation runs on the popup-free path. Jaccardand retention are regression guards, not truth metrics.Precision@5andnDCG@5are only as good as the judged pool. They help compare revisions, but they are not a substitute for a larger labeled benchmark.