feat: close the evaluation loop — hard golden set, router optimization, activation path#40
Merged
Merged
Conversation
…mization, activation path - Expand golden_set.json from 5 to 20 cases with hard classes (conflicting sources, unanswerable context, distractors, numeric/temporal synthesis) so DeepEval metrics discriminate instead of saturating at 1.0 - Add scripts/optimize_router_prompt.py: MIPROv2 over the teacher-labeled router dataset, scored before/after on held-out through the production prompt + parser path; artifact records both scores and the teacher-label caveat - Add ROUTER_PROMPT_PATH activation: classify_chat_action loads an optimized prompt artifact with fallback to the built-in prompt (tested) - Make model_comparison.py record per-case failures instead of aborting - Remove dead router/followup/repair specs from the template pipeline and the stale zero-improvement artifacts they produced
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Context
Review finding: DeepEval and DSPy were integrated but non-evidentiary — the 5-case golden set scored 1.0 everywhere, the committed pipeline report showed 0.0 improvement on every template, and optimized prompts had no path into production.
What changed
Golden set (5 → 20 cases) — added conflicting-source, unanswerable-from-context, distractor-heavy, partial-answer, and numeric/temporal cases. The set now discriminates:
Router prompt optimization (
scripts/optimize_router_prompt.py) — targets the actual production router prompt (hardcoded inrag_chat_helpers.py, not a Jinja2 template) using the real teacher-labeled dataset (429 train / 103 held-out). Before/after is scored through the production prompt +parse_chat_action_jsonpath, not DSPy's adapter.Result (honest null): baseline scores 92.2% held-out teacher agreement; MIPROv2 at light and medium budgets returned the existing prompt as the best program. Residual disagreement concentrates in
search_finance_tools(78.9%) /asset_price(89.5%) — consistent with teacher-label ambiguity. Labels are unverified Qwen3-30B teacher labels; the caveat is embedded in the artifact and docs.Activation path —
ROUTER_PROMPT_PATHsetting;classify_chat_actionloads an optimized artifact'ssystem_promptwith logged fallback to the built-in prompt. 4 new tests.Harness fixes —
model_comparison.pyrecords per-case failures (error column) instead of aborting; removed deadweb_search_decision/followup_answer/web_search_repairspecs (templates no longer exist) and the stale zero-improvement artifacts.Verification
Test plan
uv run python -m pytest tests/ -q— 579 passeduv run python -m src.evals.regression_gate— 100%uv run python scripts/optimize_router_prompt.py --eval-only— 92.2% baseline reproduceduv run python src/evals/model_comparison.py— 40 rows, no aborts