Reject malformed wheel record paths #14257
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.47) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 313 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
Diff Size
diff_size
0.344
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #14257"
general
weight: 0.35
2ykwang
<!---
Thank you for your pull request! Before submitting, please make sure you've:
-->
What does this PR do?
Fixes #10118.
A malformed wheel RECORD entry such as ./ can cause pip to treat the installation root as package-owned.
A later update, reinstall, or uninstall can then remove unrelated files from site-packages.
This PR hardens RECORD path handling.
On install:
empty paths are rejected;
absolute wheel paths are rejected;
paths that resolve to the installation root are rejected;
validation happens before installation file operations begin.
On uninstall:
entries that resolve to the installation root are rejected;
entries that name real directories are rejected;
valid relative file paths continue to work;
valid absolute installed RECORD file paths continue to work;
symlinks continue to identify the symlink itself rather than the directory they point to.
Absolute paths are valid in an installed RECORD. This includes Windows cases where pip cannot make a path relative because the file and lib_dir are on different logical disks.
The tests cover these cases directly.
Verification
The exact submitted commit was independently verified with FalseGreen against a frozen verification contract.
The verification covers:
relative and absolute paths resolving to the installation root;
relative and absolute real-directory entries;
valid relative file entries;
valid absolute installed RECORD file entries;
Windows different-logical-disk path conversion;
relative and absolute symlink-directory entries;
the original malformed ./ install and uninstall regression.
6/6 verification criteria passed.
Verified source:
a650ad175ea02c5d0fd5a17b8000736c75af0e3e
The verification is scoped to these criteria. It does not claim broader correctness of pip.
PR Checklist:
Assisted-by: Codex