Add 5 reform-API regression eval cases (closes #82)#90
Conversation
Adds 5 Test B scenarios (b6-b10) that catch silent reform-expressibility regressions like the 2026-05-28 basic-rate +1pp failure. Each pins dataset (enhanced_frs_2023_24) and parameter_year (2025), uses expected_approx with wide tolerance_pct for direction + order-of-magnitude assertions only — no fixture files, no exact-number pinning — and uses anchor.must_mention to assert the chat's prose answer references the reform parameters by name. Branched off feat/eval-harness (PR #52) since #82 explicitly depends on the harness landing. README updated to document the two reference shapes (fixture-backed vs expected_approx-only) and the regression sub-suite. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Beta preview is ready.
|
|
@vahid-ahmadi — before this goes further, two things I'd like to understand. 1. What is this actually validating, and does the drift filter undercut it? Help me with the intent here. The Test B mechanism these extend grades the chat's output against locally-computed (For 2. Are these still wanted? If so, they'll need to be redone. The ground has shifted under this PR:
So as-is it can't merge. If you still want this coverage, it needs redoing against the merged harness — ported into Happy to do the port myself once you confirm (a) the cases are still wanted and (b) the intent in point 1. |
Summary
Adds 5 Test B scenarios (b6-b10) under
evals/scenarios/that catch silent reform-expressibility regressions — directly motivated by the 2026-05-28 live test where the agent could not express a basic-rate +1pp reform and produced no eval signal. Closes #82.Path chosen: A (extend #52)
PR #52 (
feat/eval-harness) is OPEN, mergeable, and structurally complete (SPEC, scenarios, runner, fixture builder, grader, first results writeup). The right home for #82's cases is the existing harness — this PR branches offfeat/eval-harnessand adds 5 new scenario YAMLs in the harness's existing shape.Base branch:
feat/eval-harness(rebase ontomainonce #52 merges).What the cases assert
Per #82's constraint: direction + order-of-magnitude only — no exact-number pinning. Tax microsim numbers shift with dataset version and parameter year; exact pinning would create flaky tests.
b6_basic_rate_plus_1ppb7_pa_to_15kb8_ni_primary_threshold_plus_1kb9_child_benefit_uprate_10pctb10_two_band_collapseEach case also uses
anchor.must_mentionto assert the chat's prose names the reform parameters (basic rate, personal allowance, child benefit, etc.) andanchor.must_not_sayto catch sign-flip regressions ("revenue rise" on a costing reform, etc.).How it slots into the harness
The grader (
evals/runner/grade.py:474) already supportsexpected_approxinfields_to_compareas a fixture-free alternative path — whenreference.fixtureis omitted, the diff uses the inline expected value. No grader changes needed; the new cases use existing field paths (budget.budgetary_impact,budget.tax_revenue_impact,budget.benefit_spending_impact) that the extractor'sFIELD_LABELSalready covers.Each case pins:
dataset: enhanced_frs_2023_24parameter_year: 2025chat_settings.model_backend: uk_pythonchat_settings.num_runs: 3evals/README.mdis updated with a "Reform-API regression suite" section explaining the two reference shapes (fixture-backed vsexpected_approx-only).What's deliberately out of scope
chatbot.pyoragent_tools.py(per constraint).expected_approxplumbing.Test plan
main.B_results.mdentries for b6-b10; assertions should pass when the agent successfully expresses each reform via the PolicyEngine UK API.python -c "import yaml; from pathlib import Path; [yaml.safe_load(p.read_text()) for p in Path('evals/scenarios').glob('b[6-9]_*.yaml')]"✅ (done)expected_approx: 0magnitude-only case) doesn't crash_diff_scalar— the grader'sexpected != 0guard handles it; diff entry shows extracted-only as intended.🤖 Generated with Claude Code