Repository navigation
feat(eval): add regression runs and CI gating (#305) - #351
Merged
Merged
Conversation
Introduce regression checking, CI gating, and cross-version history persistence for dynaevals. - Add check_regression() and assert_no_regression() in src/dynavec/eval/gate.py - Support metric polarity (higher-is-better vs lower-is-better) and per-metric threshold overrides - Add dynavec eval check CLI subcommand with exit code 1 on regression - Add save_json() and load_json() to EvalRunStore with atomic writes - Document GitHub Actions workflow example in docs/eval_ci_gating.md - Add comprehensive unit tests in tests/test_eval_gate.py, test_cli.py, and test_eval_trend.py
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.
Description
This PR implements regression runs and CI gating for
dynaevals, enabling evaluation runs to be compared against baseline runs with configurable thresholds, failing CI builds with a non-zero exit code when quality regresses. It also adds atomic cross-version trend persistence toEvalRunStoreand documents an end-to-end GitHub Actions workflow.Related issue
Fixes #305
Changes
CI Regression Engine (
src/dynavec/eval/gate.py):check_regression()andassert_no_regression()for evaluating run metrics against a baseline.recall@k,mrr,ndcg@k,faithfulness,relevance) must not drop, while latency metrics (p50_latency_ms,p95_latency_ms,error_rate) must not spike.--max-drop(relative or absolute) and per-metric threshold overrides.baseline == 0.0),NaNdetection, and floating-point epsilon tolerance (1e-9).Cross-Version Trend Persistence (
src/dynavec/eval/trend.py):EvalRun.from_dict().EvalRunStore.save_json()with atomic file writes (NamedTemporaryFile+os.replace) to guard against file corruption.EvalRunStore.load_json()supporting seamless bootstrapping on fresh repos/branches.CLI Gating Subcommand (
src/dynavec/cli.py):dynavec eval check --current <file> --baseline <file> [--max-drop <float>] [--threshold <METRIC=VAL>] [--store <file>] [--tag <KEY=VAL>] [--json] [--allow-missing-baseline].0on passing runs,1on regressions (blocking CI), and2on bad inputs.Documentation & Workflow Guide (
docs/eval_ci_gating.md):actions/cacheand baseline promotion on merge tomain.Comprehensive Test Suite:
tests/test_eval_gate.py(21 unit tests covering thresholds, polarity, NaN checks, and edge cases).tests/test_eval_trend.pywith JSON persistence and atomic write tests.tests/test_cli.pywith CLI command tests asserting exit codes and output formatting.Testing
pytest tests/test_eval_gate.py tests/test_eval_trend.py tests/test_cli.py tests/test_eval.py- 93 passed)ruff check src benchmarks)docs/eval_ci_gating.md)Checklist