feat: implement issue #1097 — [Phase 1] Held-out eval regression gate: Sonnet 5 >= Sonnet 4.6 on triage + deep-review - #1111
Conversation
…: Sonnet 5 >= Sonnet 4.6 on triage + deep-review
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a model non-regression A/B testing framework, including documentation, a comparison script (scripts/evals/model-ab.sh), and offline BATS tests (tests/test_model_ab.bats). The feedback suggests improving the BATS tests by creating temporary directories inside
CI Failure: SonarCloud Code AnalysisStep: Quality Gate (SonarCloud) The Quality Gate failed because the Security Rating on New Code is D, below the required A. SonarCloud flagged three uses of Suggested fix: Replace |
There was a problem hiding this comment.
Pull request overview
Adds a Phase-1 “model A/B non-regression” gate to compare a candidate Claude model (e.g., Sonnet 5) against the incumbent (Sonnet 4.6) on the held-out triage and deep-review eval sets, producing a single JSON evidence artifact and enforcing a per-set >= bar while distinguishing infra failures from quality regressions.
Changes:
- Introduces
scripts/evals/model-ab.shto run the two-model × two-set matrix, hold the deep-review judge model fixed, and enforce held-out artifact immutability checks. - Adds fully-offline Bats coverage for accept/regress/tie/infra outcomes, judge confound control, and immutability detection.
- Documents the repeatable procedure and how to interpret the verdict/evidence JSON.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/test_model_ab.bats |
Offline Bats tests covering A/B comparator verdict logic, infra semantics, judge fixed-model control, and immutability guard. |
scripts/evals/model-ab.sh |
New model A/B comparator script that drives run-eval.sh, pins generator per arm, pins judge model via a shim, and emits evidence JSON + exit status. |
docs/evals/model-ab-regression.md |
Runbook describing how to execute the model A/B procedure and read the outputs. |
.github/workflows/lint.yml |
Includes the new Bats test in the Lint workflow’s test list. |
SonarCloud flagged md5sum in scripts/evals/model-ab.sh (_snapshot) as a weak-hash security hotspot (Security Rating D). Replace all three md5sum calls with sha256sum; update the matching test assertion in tests/test_model_ab.bats to keep both sides of the comparison consistent. The PR branch was created before commit 3eccefa landed on main, so tests/test_plan_materialize.bats and tests/fixtures/initiative-planner/plan-581-accepted.json were missing from the diff — causing the test-deletion guard to fail. Restore both files from the base SHA and re-add test_plan_materialize.bats to the lint.yml matrix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dev-Lead — review-changes (applied)Changes committed and pushed. |
Dev-Lead — review-changes (applied)Changes committed and pushed. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 48448343488ad6d16dbc3b7057359ab44d9b398b
Review mode: triage-approved (single reviewer)
Summary
Adds a self-contained model A/B non-regression comparator (scripts/evals/model-ab.sh), fully-offline bats coverage, a runbook doc, and a one-line lint-matrix addition. Confirms the triage tier's low-risk assessment: no auth/secrets/migration surface, all CI green, all review threads resolved, and issue #1097's five acceptance criteria are substantively implemented.
Linked issue analysis
Closes #1097 ([Phase 1] Held-out eval regression gate: Sonnet 5 >= Sonnet 4.6). All ACs addressed: (1) documented repeatable procedure driving run-eval.sh per (model, set) arm with the generator pinned via CLAUDE_TRIAGE_MODEL_CHAIN; (2) holdout-only reads with a before/after sha256 immutability guard over cases.jsonl, scorer.json, and judge.md (hard exit 2 on mutation), plus the outer git-status check in the runbook; (3) per-set '>=' non-regression bar with a regression verdict that is blocking (exit 1), deliberately not gate.sh's strict '>'; (4) infra-vs-quality per run-eval.sh #920 semantics — an un-scored arm (rc 2) marks the set infra/re-run, never a candidate regression, with regression outranking infra in verdict precedence; (5) a single JSON evidence object carrying both models' per-set scores, rc/scored flags, and the verdict for the Phase-3 go/no-go. The judge model is held fixed across arms via a shim (confound control), verified by a dedicated test.
Findings
No blocking findings. Review threads from gemini-code-assist (BATS_TEST_TMPDIR, ${1:-} under set -u) and Copilot (md5sum availability) are all resolved — later commits use
CI status
All checks green at 4844834: Lint, ShellCheck (x2), bats, CodeQL (actions/python), gitleaks secret scan, SonarCloud Code Analysis + quality gate, holdout-guard, test-deletion guard, unit-tests, AgentShield, Agent Security Scan, template-drift, validate-agent-profiles, gh-aw-compile. Dependency-audit jobs skipped (no matching ecosystems). mergeable=MERGEABLE; mergeStateStatus=BLOCKED only pending required review.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.



Closes #1097
Implemented by dev-lead agent. Please review.