test(verdict): golden-set regression harness for verdict prompt changes - #1135
Open
kyle-compute wants to merge 1 commit into
Open
test(verdict): golden-set regression harness for verdict prompt changes#1135kyle-compute wants to merge 1 commit into
kyle-compute wants to merge 1 commit into
Conversation
…hanges PR #1120 rewrote the verdict prompt and changed TaskVerdictModel from is_good to verdict=accept|reject with nothing watching whether such a change shifts the accept/reject line. This adds a golden set of seven scenarios, each pinning one rule of verdict_prompt.txt to its expected verdict, consumed by two layers: - test_verdict_golden_set.py (every CI run, no network): each scenario's prompt renders with its defining substance intact, and a synthetic judge reply round-trips VerdictBlock's parse path. Guards rendering and schema regressions only. - test_verdict_golden_set_live.py (opt-in): runs the real verdict model over the whole set via synthesize_task_verdict, prints a per-case table plus the aggregate accept rate, and fails on any drifted verdict. Skipped unless the configured OpenAI provider's credentials resolve; ODDISH_VERDICT_PROMPT_FILE swaps in an alternative prompt for A/B comparison without touching production code. Claude-Session: https://claude.ai/code/session_01MzJSdrHKEqJrJHU7RRJ758
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Oddish previewCommit:
Vercel deployment URL: https://oddish-c9ar48q77.oddish.app Plan:
This comment is updated by the PR Preview workflow. |
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.


The gap
#1120 rewrote the verdict prompt (
oddish/src/oddish/analyze/verdict_prompt.txt) and changedTaskVerdictModelfromis_good: booltoverdict: Literal["accept","reject"]. The verdict is the judgment that decides whether a benchmark task is accepted, and nothing measured whether that rewrite (or any future one) shifts the accept/reject distribution. This PR adds that feedback loop as a golden set of seven scenarios, each pinning one rule of the prompt to the verdict it must produce:all_trials_goodmajority_same_failuresingle_bad_labelall_harness_errorsbaseline_nop_passedweak_tests_single_trialweak_tests_with_verifier_findingmust_fixverifierfinding is highLayer 1: offline (every CI run, no network)
tests/test_verdict_golden_set.py, over the shared fixtures intests/verdict_golden_set.py:VerdictBlock.build_prompt()succeeds for every scenario (a degraded section raises rather than rendering, so reaching the assertions proves it rendered) and the scenario's substance survives into the prompt: every trial's name and evidence, plus per-case markers like theCRITICAL: nop agent passedbaseline line and the[must_fix/verifier]finding.VerdictBlock.to_verdict()and reconstructs asTaskVerdictModel, guarding theverdict/confidenceliterals and theis_goodproperty.This layer guards prompt-rendering and schema regressions. It says nothing about model behavior — that is deliberate and is what the second layer is for.
Layer 2: opt-in live backtest
tests/test_verdict_golden_set_live.pyruns the REAL verdict model over the whole set through the production path (synthesize_task_verdict, including its fallback plumbing), prints a per-case table (case, expected, got, confidence) plus the aggregate accept rate, and fails if any case's verdict drifts. One case erroring records anerror(...)row instead of hiding the rest of the table.settings.verdict_model's configured OpenAI provider resolve — the samerequire_public_openai_config()/require_azure_openai_config()checks_build_openai_clientperforms — so normal CI never touches the network.ODDISH_VERDICT_PROMPT_FILE=/path/to/alt_prompt.txtand re-run. The test monkeypatchesclassifier._VERDICT_PROMPT(the module globalbuild_verdict_promptformats), so no production code changed; the override file must keep the four{num_trials}/{baseline_summary}/{quality_check_summary}/{trial_classifications}placeholders.save_to_s3/save_to_db/record_cost) is patched out, matching the existing verdict-test style: the backtest measures the model, not S3/Postgres.Testing
uv run pytest tests/test_verdict_block.py tests/test_verdict_fallback.py tests/test_verdict_sync.py tests/test_verdict_golden_set.py tests/test_verdict_golden_set_live.py→ 37 passed, 1 skipped (the live backtest, no credentials — confirming the gate).synthesize_task_verdict, the table and accept rate print, and the final assertion reports the drifted cases.build_verdict_prompt's output.https://claude.ai/code/session_01MzJSdrHKEqJrJHU7RRJ758
Note
Low Risk
Test-only additions with no production code changes; live tests are credential-gated and skipped in normal CI.
Overview
Adds a seven-scenario golden set (
verdict_golden_set.py) that maps each case to an expectedaccept/rejectverdict and confidence, so prompt or schema rewrites can be regression-tested.Offline CI (
test_verdict_golden_set.py): every case must render viaVerdictBlock.build_prompt()(trial evidence and scenario markers in the prompt) and synthetic judge JSON must round-trip throughto_verdict()/TaskVerdictModel, includingis_good. A meta-test keeps both verdicts and all three confidence levels covered.Opt-in live backtest (
test_verdict_golden_set_live.py): runssynthesize_task_verdicton the real model when OpenAI/Azure credentials resolve; prints a comparison table and fails on drift. SupportsODDISH_VERDICT_PROMPT_FILEto patchclassifier._VERDICT_PROMPTfor A/B prompt comparison, with persistence mocked out.Reviewed by Cursor Bugbot for commit ff2286f. Bugbot is set up for automated code reviews on this repo. Configure here.