Type Checking Part 2: Validate configuration arguments before invoking actions #14347
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.70) × (1 − Review Confidence (0.67)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.70 · 120 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.59 · 2 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
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.287
No Reviewer Assigned
no_reviewer_assigned
0.120
Sensitive Paths
sensitive_paths
0.070
Real PR Conversation Timeline
3 items
Let's only build an example string if the arguments don't match, so it's more obvious it's only for error formatting.
Makes sense.
notatallshaw
<!---
Thank you for your pull request! Before submitting, please make sure you've:
-->
What does this PR do?
The is two of (currently) seven PRs to get
nox -s typecheckchecking to pass.This fixes a bug, with an editor configured,
pip config edit unexpectedopens the configuration file and silently ignores the extra argument. Other configuration actions reject incorrect argument counts.Each configuration action declares the arguments it accepts. Dispatch checks those arguments before calling the action and reports the existing argument-count error if they do not match. A TypeError from within the action is allowed to propagate.
Design
I chose to go with inspect / reflection rather than have each action explicitly and statically register their own arguments. But I would be happy to change.
PR Checklist:
<!--- Go over all the following points, and put an
xin all the boxes that apply. --><!-- If checked and you have used AI tools, add a line below: Assisted-by: <tool name, e.g. Claude> -->