Repository navigation
feat: fail CI when the answers or the golden set change - #12
Merged
Merged
Conversation
The answer eval could only replay on the machine holding the chat cache, and it refused a baseline, so a change to parsing, citation resolution or the answer metrics merged green. A golden span moved inside a chunk changed no retrieval metric and was caught by nothing. The 30 recorded answers are committed as a fixture, written by --record-answers and loaded into the chat cache by --replay-answers, so CI replays them with no key. --answer now accepts --baseline and --fail-on-change and compares every question's answer, citations, spans and hit, plus the aggregates. Every report records a digest of the parsed golden set and comparison refuses a mismatch. The answer report names the configured chat chain instead of failover's first model. The four baselines are re-cut with identical numbers.
ADR 0011 covers the committed answer fixture, what counts as drift for an answer, the golden-set digest, the re-cut baselines and five planted regressions, and why the judge and abstention were left out. ADR 0008 points to it for the closed span gap; the README says what a green check now covers and how to record answers again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CI now fails when the answers change, as well as when retrieval does. The 30 recorded answers are committed as a fixture and replayed with no key, and the answer eval is compared with the published report question by question. Every report now records the golden set it was scored against, so an edited golden span is refused instead of passed. This is the last backend slice before the frontend (F7).
Why
After ADR 0010 the answer run replayed offline, but only on the machine holding the chat cache, and
rageval.evalrefused--answerwith--baseline. A change to parsing, citation resolution or the answer metrics merged green. ADR 0008 also left a gap open: moving q01's golden span by 40 characters was caught by nothing.Scope was chosen before building: the answer gate only. A correctness judge would need 30+ live calls on a rate-limited free tier and would publish a new number. Abstention would change the prompt and replace the published 0.533. Both are named in the README and ADR as not built.
How
evals/answers/26b03ce9a1c2c1d4-682ec1326b2f.jsonlholds 30 lines, 21 KB: the chain digest of each prompt and the result returned for it, sorted, LF-terminated.--record-answers PATHwrites it, never by hand.--replay-answers PATHvalidates every line before writing any of them into the chat cache, where the keyless chat path from ADR 0010 serves them. Rejected: a release asset (the size doesn't justify one, and a reviewer can read this diff), and serving replies straight from the file, which would put a path production never uses under the gate.chat_chainreplaceschat_modelin the answer report.chat_modelnamed Gemini while Groq wrote 29 of the 30 answers.ran_at, the digest andchat_chaindiffer. The old reports stay committed.Results
Planted one at a time, with no key:
[1]→(1)in the promptno cached answer for this prompt…citation_hitoverlap<→<=golden set differsThe last row is the ADR 0008 plant that nothing caught before; now only the gate catches it. The
<=plant cannot fire on this data because no citation ends exactly where a golden span begins, the same situation as the overlap plant in ADR 0008.Verification
From
.workflow/RAG-11/evidence.md, with both keys blank and an empty cache filled only from the vector release asset and the answer fixture, as CI does:uv run ruff check .,uv run ruff format --check .,uv run mypy: passuv run pytest: 283 passeduv run pytest -m integration: pass (live provider tests skip without keys)rageval.vectors import … --sha256 …: pass--fail-on-changeagainst the new baselines:no drift, each with0 call(s) reached the network; the answer step printedloaded 30 recorded answersRisk and rollback
No critical zones. Reverting removes the fixture, the four new baselines, the answer step and the golden-set check, and
ci.ymlpoints back at the old baselines, which were never modified. No schema change in Postgres, and no change to the golden set, the prompt or the cache layout.Open questions
--record-answers, then a new fixture and answer baseline in the same PR. The README documents this.