Write Evaluate CSV and JSON exports as UTF-8 #10887
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 202 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.318
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10887"
general
weight: 0.35
simin-yuan
What this does
Evaluate(save_as_csv=...)opened its file with the platform default encoding: on Windows with a cp936/cp1252 locale a result containing a character the locale cannot encode raisesUnicodeEncodeErrorand no CSV is produced.save_as_jsonhad the same missingencoding=, and survived only becausejson.dumpescapes non-ASCII by default.Both exports now open their file with
encoding="utf-8".Reproduction (before)
Windows 11,
locale.getpreferredencoding(False) == "cp936":Tests
tests/evaluate/test_evaluate.py::test_evaluate_save_as_csv_writes_utf8runs aPredictover aDummyLMwhose answer contains中文 🔥, exports the results and asserts the CSV decodes as UTF-8.Locally on
mainthe test fails with theUnicodeEncodeErrorabove; with the patch it passes.tests/evaluate/test_evaluate.pyas a whole has the same 9 failures before and after this change (pre-existing in this environment), with the new test added to the passing set (37 → 38 passed).Fixes #10886