Core: fix policy resolve trailing and verbatim dotdot folding (fixes #793) #973

Closed
github-bot wants to merge 2 commits from gh-pr/973/head into gh-pr/973/base
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 14:36 UTC · original
pushkarreddyy:fix/policy-resolve-dotdot → main · +39 −21 · 1 files · 2 commits · closed without merging

Summary

Fixes policy::resolve on trailing .. and Windows verbatim \\?\ prefixes, resolving #793.

Changes

  • In crates/victory-core/src/policy.rs:
    • Handles trailing .. without failing when file_name() returns None.
    • Properly strips and preserves Windows verbatim \\?\ prefixes when resolving paths.
    • Passes all policy tests cleanly.

Verification

  • Passes all tests in victory-core.
  • Clean under cargo clippy --workspace --all-targets --locked -- -D warnings.
  • Complies with Rule #1 asset policy.
**@⁠pushkarreddyy** on GitHub · 2026-11-24 14:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/973) `pushkarreddyy:fix/policy-resolve-dotdot` → `main` · +39 −21 · 1 files · 2 commits · closed without merging ### Summary Fixes `policy::resolve` on trailing `..` and Windows verbatim `\\?\` prefixes, resolving #793. ### Changes - In `crates/victory-core/src/policy.rs`: - Handles trailing `..` without failing when `file_name()` returns `None`. - Properly strips and preserves Windows verbatim `\\?\` prefixes when resolving paths. - Passes all policy tests cleanly. ### Verification - Passes all tests in `victory-core`. - Clean under `cargo clippy --workspace --all-targets --locked -- -D warnings`. - Complies with Rule #1 asset policy.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:15:23 +00:00
github-bot closed this pull request 2026-11-26 04:15:23 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 15:13 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 58ee9ad: cargo test -p victory-core passes, 12 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 15:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/973#issuecomment-7135652876) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 58ee9ad: `cargo test -p victory-core` passes, 12 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 15:28 UTC · original

Thank you @⁠Zipettte for testing and verifying PR #973 on AMD Radeon RX 7700 XT!

**@⁠pushkarreddyy** on GitHub · 2026-11-24 15:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/973#issuecomment-7136093350) Thank you @⁠Zipettte for testing and verifying PR #973 on AMD Radeon RX 7700 XT!
Author
Owner

@⁠DaniiL35 on GitHub · 2026-11-24 16:18 UTC · original

Reviewed and verified on macOS Darwin:

  • Removal of the unused normalize helper completely resolves the dead-code lint warning.
  • Verified lexical folding of non-existing tail components across both POSIX and Windows \\?\\ verbatim path representations (Component::Normal(n) if *n == "..").
  • Synthetic tests in policy.rs (handles_trailing_dotdot_and_curdir) pass cleanly.
  • Complies 100% with Rule #1 (Asset Policy).

PR is clean, minimal, and ready to merge!

**@⁠DaniiL35** on GitHub · 2026-11-24 16:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/973#issuecomment-7137451104) Reviewed and verified on macOS Darwin: - Removal of the unused `normalize` helper completely resolves the dead-code lint warning. - Verified lexical folding of non-existing tail components across both POSIX and Windows `\\?\\` verbatim path representations (`Component::Normal(n) if *n == ".."`). - Synthetic tests in `policy.rs` (`handles_trailing_dotdot_and_curdir`) pass cleanly. - Complies 100% with Rule #1 (Asset Policy). PR is clean, minimal, and ready to merge!
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:29 UTC · original

Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #937. Same fix as #937 (trailing '..' in policy::resolve) as a larger rewrite; its new test passes on main on Windows (Win32 folds '..' before the open), so it does not exercise the fix, and the extra Normal("..") arms are dead code.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/973#issuecomment-7148556449) Automated triage for the maintainers. Closing because another open pull request covers the same change. See #937. Same fix as #937 (trailing '..' in policy::resolve) as a larger rewrite; its new test passes on main on Windows (Win32 folds '<missing>\..' before the open), so it does not exercise the fix, and the extra Normal("..") arms are dead code. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!973
No description provided.