Skip to content

fix(rag-eval): prevent false credit for failures and duplicate results - #333

Merged
jjbaumert merged 1 commit into
mainfrom
fix/audit-rag-eval-integrity
Oct 12, 2026
Merged

jjbaumert merged 1 commit into
mainfrom
fix/audit-rag-eval-integrity

Conversation

@jjbaumert

Copy link
Copy Markdown
Owner

Intent

Keep failed requests, unknown IDs and duplicate hits from producing falsely perfect RAG evaluation reports.

What changed

Score distinct IDs in the server-ID namespace and retain unknown IDs in reports. Count failed non-skipped requests in recall denominators with zero credit, preserve both query errors and require an SSE done event. Preserve documented 503 and --no-ask skips and report-completion exit behavior. Document scoring and add dedicated CI for this excluded crate.

How this was tested

Real CLI reproduction against loopback HTTP/SSE: 5 regressions failed before the fix, including failed/unknown gap results scoring 1.000, duplicated hits scoring 1.500, an omitted failed ask denominator and incomplete SSE receiving credit. A healthy control passed.
cargo test --manifest-path tests/rag-eval/Cargo.toml --locked -- --test-threads=1: 6 library tests and 8 CLI cases passed, including catalog-ID impersonation and explicit skip controls. CSV rows and summaries are checked. No model or AWS calls.
Strict Clippy compared with main: the same one preexisting ptr_arg lint in the percentile helper, no new diagnostics. cargo fmt --check retains only preexisting source failures (main 15 versus 16 hunks, library 3 versus 4); the new CLI test and patch whitespace are clean. The existing baseline waiver applies.
The new workflow parses as YAML and executes the excluded crate's library and CLI tests. Evidence is included here under the existing approval to avoid gist uploads.

Findings fixed during review

Independent fresh-context review found no unresolved findings. Subsequent formatting edits were reviewed as mechanical only.

Risk: medium

Evaluation scores and failure reporting intentionally change. HTTP 503 remains the documented AI-unavailable skip, and completed reports still exit zero while setup/output errors fail.

Closes #315.

@jjbaumert
jjbaumert merged commit 216b1b9 into main Oct 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RAG evaluation can score HTTP failures and unknown results as perfect and report recall above one

1 participant