Skip to content

Commit e2dd8ad

Browse files
ci: gate page-level text retrieval against a committed baseline
The regression step compared baseline.json against itself, so it always passed and gated nothing. Replace it with a real gate a stock CPU runner can execute. scripts/eval_retrieval_ci.py runs the hybrid text retriever (bge-m3 on CPU, BM25, RRF) over the committed rag_corpus snapshot and scores nDCG@5 / recall@10 / MRR, gated against data/eval/baseline_retrieval.json at a 5% threshold. Metrics are scored at page granularity: rag_corpus is the demo corpus and is periodically re-baked by the docling chunker (ADR 0017/0021), which renumbers the ::cN chunk suffix, so the v3 golden's chunk-level labels drift out of sync with it while the page each points at does not. Projecting both sides to paper::pN coarsens the existing human labels rather than authoring new ones, the same re-chunk-robustness reasoning as ADR 0019's answer_correctness. The visual (GPU) and generation/judge (API) legs stay in the manual or scheduled full eval against baseline.json. Docs updated to match (evals.md, CONTRIBUTING, results.md).
1 parent e706367 commit e2dd8ad

6 files changed

Lines changed: 1374 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,23 @@ jobs:
4444
- name: Pytest (unit)
4545
run: uv run pytest -v --cov=src --cov-report=term-missing
4646

47-
- name: Eval regression gate (vs committed baseline)
48-
# Compares the committed baseline against itself as a smoke test until
49-
# a self-hosted runner can execute the live eval stack. When a fresh
50-
# run is fetched from artifacts, point --candidate at it. Threshold:
51-
# 5% (any metric dropping more than this fails CI).
47+
- name: Cache bge-m3 weights
48+
uses: actions/cache@v4
49+
with:
50+
path: ~/.cache/huggingface
51+
key: hf-bge-m3
52+
53+
- name: Eval regression gate (CPU page-level text retrieval)
54+
# Runs the hybrid text retriever (bge-m3 on CPU + BM25 + RRF) over the
55+
# committed rag_corpus snapshot and gates page-level retrieval metrics
56+
# against data/eval/baseline_retrieval.json at a 5% threshold. The visual
57+
# (GPU) and generation/judge (API) legs run in the manual/scheduled full
58+
# eval, not here — see docs/evals.md "Regression gate".
5259
run: |
60+
uv run python -m scripts.eval_retrieval_ci \
61+
--output data/eval/runs/retrieval-ci.json
5362
uv run python -m scripts.check_regression \
54-
--baseline data/eval/baseline.json \
55-
--candidate data/eval/baseline.json \
63+
--baseline data/eval/baseline_retrieval.json \
64+
--candidate data/eval/runs/retrieval-ci.json \
65+
--metrics ndcg_at_5 recall_at_10 mrr \
5666
--threshold 0.05

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ uv run ruff check .
2626
uv run ruff format --check .
2727
uv run mypy src tests scripts
2828
uv run pytest -v --cov=src --cov-report=term-missing
29+
uv run python -m scripts.eval_retrieval_ci --output data/eval/runs/retrieval-ci.json
2930
uv run python -m scripts.check_regression \
30-
--baseline data/eval/baseline.json \
31-
--candidate data/eval/baseline.json \
32-
--threshold 0.05
31+
--baseline data/eval/baseline_retrieval.json \
32+
--candidate data/eval/runs/retrieval-ci.json \
33+
--metrics ndcg_at_5 recall_at_10 mrr --threshold 0.05
3334
```
3435

3536
## Scripts layout

0 commit comments

Comments
 (0)