[16.0][FIX] fs_storage: check rooted_dir paths by whole components, without os.getcwd() #688
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 324 lines diff across 4 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.346
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #688"
general
weight: 0.35
lmignon
Summary
RootedDirFileSystem._joincompared paths as text, so it accepted a sibling of its root, such as../here-backupfor the rootsubdirectory/here. It also calledos.getcwd()throughmake_path_posix, which fails once the working directory is removed (#513). Paths are now normalized as strings and compared by whole components:Finishes #522 by @hnavarro-kernet, keeping their commit, as lmignon proposed. Fixes #513.
Review points:
/, and the input may be a list or a dict: the rules followself.sep, and an unknown separator raisesValueError. A/filesystem must also pass the Windows rules, because fsspec turns\into/in local paths on Windows. Lists and dicts are checked item by item.normpathon remote paths:make_path_posix, the source ofos.getcwd(), is no longer called._join: taken, withoutPurePath, which changes no POSIX result and adds a trailing\to UNC roots.Evidence
The new assertions on 16.0 and with this PR, both on fsspec 2026.9.0.
FileNotFoundErrormeans the path got past the check and reached the disk.All 14 fs_storage tests pass.
Merge Danger
Door: two-way. Nothing is stored or migrated.
Blast Radius: narrow.
Two kinds of paths that used to pass are now refused on every host: paths that climb with backslashes, and any sub path of a root that normalizes to
., such as/on S3, which fsspec reduces to an empty root. 17.0, 18.0, 19.0, and the 20.0 migration #670 have the same check and need forward ports.Assisted-by: Claude Opus 5.5
Assisted-by: Claude Sonnet 5.5
Assisted-by: Claude Haiku 5.5