Infra: Add custom lexers for PEP 823 + 824 #5125
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.59) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 174 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.309
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.059
Real PR Conversation Timeline
1 comments
"Review active on #5125"
general
weight: 0.35
encukou
<!--
This template is for an infra or meta change not belonging to another category.
Please read our Contributing Guidelines (CONTRIBUTING.rst)
to make sure this repo is the right place for your proposed change. Thanks!
-->
Even minimal syntax highlighting can improve the readability of code snippets and examples in a PEPs. For syntax changes the default Python lexer provided by pygments can sometimes fail to parse the code having to fall back to pure text.
This PR adds new custom lexers which extends the default one to support the examples in PEP 823 and 824. The sphinx directives for these will be
.. code-block:: py823andpy824respectively.| | Before | After |
| - | - | - |
| 823 | <img width="450" height="60" alt="Screenshot 2026-09-15 at 19 13 48" src="https://github.com/user-attachments/assets/c625d051-b91a-41ae-9b63-f946fe0c2af5" /> | <img width="445" height="60" alt="Screenshot 2026-09-15 at 19 13 57" src="https://github.com/user-attachments/assets/d93edb6b-1783-4453-af74-1dbc60fb53c9" /> |
| 824 | <img width="343" height="81" alt="Screenshot 2026-09-15 at 19 15 25" src="https://github.com/user-attachments/assets/dd82f42a-3ad9-4b50-b196-ca55ca81a347" /> | <img width="342" height="81" alt="Screenshot 2026-09-15 at 19 15 45" src="https://github.com/user-attachments/assets/6d69a14d-01df-456f-ba74-6f4149e295ce" /> |