Reject malformed Unicode escape sequences #1176
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.26) × (1 − Review Confidence (0.88)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.26 · 37 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.91 · 2 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
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.218
Real PR Conversation Timeline
3 items
Probably worth testing "\u{" as well, as the minimal invalid sequence?
On the other hand, I'd drop the tests with variables below -- at least it's not obvious to me what extra coverage they are adding.
Thank you. Added a test for \u{ and removed the cases with variables as suggested.
nikic
ydah
String_only matches complete hexadecimal Unicode escapes, leaving malformed sequences as literal text instead of reporting an error:Also match the
\u{prefix and reject it when no complete hexadecimal escape was captured. This catches invalid digits, empty escapes, and missing closing braces.