Skip to content

fix(eval): reject confounded plugin delta comparisons - #1241

Open
napetrov wants to merge 4 commits into
intel:mainfrom
napetrov:fix/plugin-delta-comparability
Open

napetrov wants to merge 4 commits into
intel:mainfrom
napetrov:fix/plugin-delta-comparability

Conversation

@napetrov

Copy link
Copy Markdown
Contributor

Summary

arms plugin-delta / matrix rollup
  pair question IDs and text in artifact order
  check judge settings, reference answers, and profile prompt digests
  report paired scores or explain why the pair was refused

The treatment evaluation guide defines the comparison contract. Legacy pairs that both omit question text or judge settings produce warnings. Two recorded profile digests for the same arm must match.

Evidence

  • With the same question IDs and a changed judge temperature, the old command writes a delta. The new CLI test expects exit 2, identifies judge_temperature, and checks that both output paths are absent.

  • The report test checks a score of +7.0 over one complete pair and an empty result when the arm has zero complete pairs.

  • Base/head probes also verified swapped profile prompts, changed judge references, and comparability warnings in matrix JSON and Markdown.

  • Local review covered the comparison contract and both callers. The focused run passed 204 tests.

Merge Danger

Door · Two-way. A revert restores the earlier pairing rules. Stored schema versions stay compatible.

Blast radius · Comparisons. The CLI and matrix rollup use the same checks.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov
napetrov requested a review from a team as a code owner November 26, 2026 05:07
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@exai-bot

exai-bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 11 selected item(s).

CI at `21f703e`: 2 still running, 19 passing, 4 skipped
Check Status
Mutation of changed lines still running
Tests (py3.14) still running
Review details
  • Commit reviewed: 21f703e against merge base 50ea631
  • Coverage: 11 files in 2 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 231k tokens (142k from cache), 33s
  • Tool calls: 24 (14 file_read, 6 code_search, 2 file_read_diff, 1 ci_status, 1 local_check_results)
  • Plugin delta comparability, rollups, and reporting: 8 files
  • Record metadata and digest validation: 3 files

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 96.05263% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.16%. Comparing base (f8b5e1d) to head (af68823).

Files with missing lines Patch % Lines
dokimi/dokimi/eval/plugin_delta.py 94.54% 2 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1241   +/-   ##
=======================================
  Coverage   96.15%   96.16%           
=======================================
  Files         498      498           
  Lines       65973    66011   +38     
  Branches    11456    11467   +11     
=======================================
+ Hits        63436    63478   +42     
+ Misses       1569     1565    -4     
  Partials      968      968           
Files with missing lines Coverage Δ
dokimi/dokimi/eval/matrix_rollup.py 100.00% <100.00%> (+6.00%) ⬆️
dokimi/dokimi/records.py 100.00% <100.00%> (ø)
dokimi/dokimi/report/model_compare.py 95.55% <100.00%> (-0.12%) ⬇️
dokimi/dokimi/eval/plugin_delta.py 90.79% <94.54%> (+3.67%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vchamarthi vchamarthi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@napetrov, could you fix the 2 small things I've marked fix before merge (in the line comments) and answer my 2 questions below? I'll approve once that's done.
I'll approve once that's done.

My questions before I approve:

  • When one run has question_text, or has judge_temperature set to 0.0, and the other run predates the field, the pair is refused (different answers question text for 'q1', different judge_temperature: 0.0 vs None). Say in the changelog that a one-sided omission is refused, or change the code to warn as it does when both runs omit the field.
  • A profile digest recorded on one run only, for example profile_prompt_sha256 on the baseline and nothing on the plugin run, passes with no warning. State in the docs that a one-sided profile digest is not checked, or warn about it the way judge settings are warned.
Optional, non-blocking (1)
  • dokimi/dokimi/eval/plugin_delta.py:134: With judge_prompt_sha256 set to null on both runs and the other judge settings recorded, removing the branch at plugin_delta.py:134 still passes the changed tests.

What I checked on af68823: the 128 changed tests pass, and fail on main as expected; the full test suite passes with main merged in (32,284 tests), apart from failures main has too; it merges cleanly onto main; when I changed the code on purpose, the tests caught all 12 changes.

Comment thread dokimi/dokimi/eval/plugin_delta.py Resolved
Comment thread dokimi/dokimi/eval/plugin_delta.py Resolved
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g868eHAV
Thread: PRRT_kwDOVBg7g868eHAb
Thread: PRR_kwDOVBg7g88AAAABajuIAw
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov

Copy link
Copy Markdown
Contributor Author

Re: review by vchamarthi

Say in the changelog that a one-sided omission is refused.
State in the docs that a one-sided profile digest is not checked.
21f703e documents the refusals and digest check. The null prompt digest warning now has a test.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants