fix: handle non-list relevant_statements in ContextRelevanceEvaluator #13758
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.45) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 281 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.338
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #13758"
general
weight: 0.35
chrikrah
Related Issues
Proposed Changes:
ContextRelevanceEvaluator._postprocess_resultscalledlen()directly onrelevant_statements, so a structurally valid but malformed LLM response such as{"relevant_statements": null}raisedTypeErrorafter parsing and bypassed theraise_on_failurehandling.The value is now validated to be a list:
raise_on_failure=False, the row is logged, marked"status": "error"with aNaNscore, and excluded from the aggregate score, consistent with other failed rows;raise_on_failure=True, aValueErroris raised instead of aTypeError.How did you test it?
test_run_invalid_statements_value_raise_on_failure_falseandtest_run_invalid_statements_value_raise_on_failure_true.hatch run pytest test/components/evaluators/test_context_relevance_evaluator.py→ 18 passed, 2 skipped (the skipped tests require an OpenAI API key).sentence-transformersdependency is not installed.hatch run pre-commit run --files ...passes on the changed files.Notes for the reviewer
The validation is intentionally scoped to
ContextRelevanceEvaluator.FaithfulnessEvaluatorhas a related output-shape validation gap that is tracked separately in #13423.Checklist
fix:and added!in case the PR includes breaking changes.