Regenerate the retrieval baseline on demand, in CI - #680
Merged
Conversation
Unblocks the next two items: adding a golden question - including one grown from real logged queries - makes the eval run incomparable, because question_set_changed?/1 compares the question-id SET and refuses rather than letting an unmatched question read as a non-regression. That guard is right. It just means the baseline has to be regenerable, and it was not. IT HAS TO HAPPEN IN CI, and not for the reason I claimed twice today. I wrote in #670's body that a local run degrades to keyword_only and would overwrite the embeddings-arm baseline. That was wrong. The eval's vectors are deterministic functions of the committed text, so no provider is involved at all, and the no_embedding_key warnings in the log are the keyword_only ARM passing {:error, :no_api_key} deliberately, exactly as its moduledoc says. The real reason is the corpus. This job seeds a fresh database; a developer's dev DB carries whatever else it has accumulated. Measured on the same commit and the same command: CI scores mrr 0.746 with 22 of 26 answered, a local run scores 0.192 with 5 of 26. A baseline captured locally would bake one machine's private database into a deploy gate for everyone. The regeneration is a workflow_dispatch input, off by default, and uploads the file as an ARTIFACT. CI never commits it: a gate that can rewrite its own threshold unattended is not a gate. Download it, read the diff, commit it deliberately. The gate step is SKIPPED on a regeneration run. Leaving it in would compare the run against a baseline that run had just written - a comparison that passes whatever the numbers are, which is the most expensive kind of green. Procedure documented in docs/runbooks/search-events-analysis.md, including the measured local-vs-CI gap so the next person does not re-derive it from a confusing local result the way I did.
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.
Unblocks the next two items in the agreed order.
Why it's needed
Adding a golden question — including one grown from real logged queries — makes the eval run
:incomparable.question_set_changed?/1compares the question-id set and refuses,rather than letting an unmatched question read as a non-regression. That guard is right; it
just means the baseline has to be regenerable, and it wasn't.
Why in CI — and a correction
I wrote in #670's body, and repeated it, that a local run "degrades to
keyword_onlyandwould overwrite the embeddings-arm baseline." That was wrong. The eval's vectors are
deterministic functions of the committed text — no provider is involved — and the
no_embedding_keywarnings in the log are thekeyword_onlyarm passingembedding: {:error, :no_api_key}deliberately, exactly as its moduledoc says.The real reason is the corpus. This job seeds a fresh database; a developer's dev DB
carries whatever else it has accumulated. Same commit, same command:
A baseline captured locally would bake one machine's private database into a deploy gate for
everyone.
Shape
workflow_dispatchinput, off by default.threshold unattended is not a gate — download, read the diff, commit deliberately.
against a baseline that same run had just written — a comparison that passes whatever the
numbers are, which is the most expensive kind of green.
Procedure documented in the runbook, including the measured local-vs-CI gap so the next
person doesn't re-derive it from a confusing local result the way I did.
mix precommitgreen (7,514). Reviewed inline (this session's system prompt forbidsdispatching review agents; per CLAUDE.md the gate is satisfied by the best available reviewer
with that stated).