fix: keep rewrite final judge in evaluate#196
Conversation
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
memadi-nv
left a comment
There was a problem hiding this comment.
looks great! Thanks for the fix. Just left a small nit comment.
binaryaaron
left a comment
There was a problem hiding this comment.
Reviewed the final-judge execution change and its interaction with evaluate(), needs_human_review, preview sizing, failed records, and LLM-call accounting.
Moving the holistic judge out of RewriteWorkflow.run() fixes the model-selection mismatch and keeps judge output informational, while evaluate() remains the explicit path for detection and final judging. The updated measurement estimate correctly reflects that anonymization no longer invokes the final judge.
Validation: the prospective merge onto current main passes 1,081 applicable tests, and Ruff is clean. No blocking findings. LGTM.
What changed
RewriteWorkflow.run()no longer tries to execute the final judge. The non-critical final judge path stays inRewriteWorkflow.evaluate(), which is the only place that has the right model-selection contract and is already documented as the place wherejudge_evaluationis added.I also updated the affected rewrite workflow tests, the rewrite LLM call estimate, and the repo-level workflow notes so they match the actual behavior.
Why
The current
run()path silently degrades before it ever reaches the adapter:evaluation=keyword intoFinalJudgeWorkflow.columns()run()still only hasRewriteModelSelection, while the final judge needs the evaluate-siderewrite_judgealiasBecause
_run_final_judge()catches broadly, the failure gets hidden and looks like normal fallback behavior.Impact
run()now stays aligned with the public interface contract: rewrite judge output is added later viaevaluate().judge_evaluationtoNoneand preserves theneeds_human_reviewvalue produced by the evaluation/repair flow.run().Validation
uv run --group dev pytest tests/engine/test_rewrite_workflow.py tests/interface/test_anonymizer_interface.py tests/test_measurement.py tests/engine/test_final_judge.py -quv run --group dev ruff check src/anonymizer/engine/rewrite/rewrite_workflow.py src/anonymizer/measurement/metrics/llm_calls.py tests/engine/test_rewrite_workflow.py tests/test_measurement.py