Census: report directory traversal failures #115

Merged
ZekkJJ merged 1 commit from upstream-pr/115 into main 2026-11-25 00:07:39 +00:00
ZekkJJ commented 2026-11-24 00:38:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ZekkJJ on 2026-11-24T00:38:50Z.


What

victory census discarded errors from the directory walker. A missing input path could exit successfully and report zero images and zero unreadable files.

Return a nonzero exit status with the path when a scan root fails. Report traversal errors within a readable root alongside skipped inputs while continuing to scan its other entries.

Tested

  • Windows 11 x64, Rust 1.98.1. The missing-path regression failed before the fix and passed after it. A valid input with no PE images still succeeds.
  • cargo test --locked --workspace -- --nocapture reported 247 passed, 0 failed, and 3 ignored. Four shader tests returned early because their compiler prerequisites were unavailable.
  • cargo clippy --locked -p victory --all-targets, rustfmt on both changed files, and cargo xtask policy passed.

AI assistance: Codex wrote the patch and tests and ran the checks. No game files were used.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6571910329 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/115). Originally posted by [ZekkJJ](https://github.com/ZekkJJ) on 2026-11-24T00:38:50Z. --- ## What `victory census` discarded errors from the directory walker. A missing input path could exit successfully and report zero images and zero unreadable files. Return a nonzero exit status with the path when a scan root fails. Report traversal errors within a readable root alongside skipped inputs while continuing to scan its other entries. ## Tested - Windows 11 x64, Rust 1.98.1. The missing-path regression failed before the fix and passed after it. A valid input with no PE images still succeeds. - `cargo test --locked --workspace -- --nocapture` reported 247 passed, 0 failed, and 3 ignored. Four shader tests returned early because their compiler prerequisites were unavailable. - `cargo clippy --locked -p victory --all-targets`, rustfmt on both changed files, and `cargo xtask policy` passed. AI assistance: Codex wrote the patch and tests and ran the checks. No game files were used.
noviw-rblx commented 2026-11-24 06:54:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by noviw-rblx on 2026-11-24T00:44:05Z.


checked: #115 | with: cargo test -p victory --test census | on: Windows 10, Rust 1.98.1, head b1bdd899, CPU only | result: 2 passed (census_fails_when_a_requested_path_is_missing, census_accepts_a_valid_path_with_no_pe_images). No game data required.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118375682 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/115#issuecomment-7118375682). Originally posted by [noviw-rblx](https://github.com/noviw-rblx) on 2026-11-24T00:44:05Z. --- checked: #115 | with: cargo test -p victory --test census | on: Windows 10, Rust 1.98.1, head b1bdd899, CPU only | result: 2 passed (census_fails_when_a_requested_path_is_missing, census_accepts_a_valid_path_with_no_pe_images). No game data required.
ZekkJJ commented 2026-11-24 06:54:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ZekkJJ on 2026-11-24T00:59:17Z.


LGTM

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118638851 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/115#issuecomment-7118638851). Originally posted by [ZekkJJ](https://github.com/ZekkJJ) on 2026-11-24T00:59:17Z. --- LGTM
DaviTostes commented 2026-11-24 06:54:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T01:13:14Z.


Tested b1bdd89: pass.

  • Tested the Windows build under Wine 11.22 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), cargo xwin test ... -p victory.
  • tests/census.rs: 2 passed. The app's own test (loader_lock_is_reentrant_and_exclusive) also passes.

No game data used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118881489 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/115#issuecomment-7118881489). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T01:13:14Z. --- Tested `b1bdd89`: **pass**. - Tested the Windows build under **Wine 11.22** on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), `cargo xwin test ... -p victory`. - `tests/census.rs`: 2 passed. The app's own test (`loader_lock_is_reentrant_and_exclusive`) also passes. No game data used.
KevinPratap commented 2026-11-24 08:02:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KevinPratap on 2026-11-24T07:22:12Z.


These census tests fail once #535 (asset-policy check in default_paths) is merged too, because they census the crate's own Cargo.toml, inside the source tree. Fix against this branch, verified alone and with #535: https://github.com/ZekkJJ/VIctory/pull/1. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7124913071 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/115#issuecomment-7124913071). Originally posted by [KevinPratap](https://github.com/KevinPratap) on 2026-11-24T07:22:12Z. --- These census tests fail once #535 (asset-policy check in `default_paths`) is merged too, because they census the crate's own `Cargo.toml`, inside the source tree. Fix against this branch, verified alone and with #535: https://github.com/ZekkJJ/VIctory/pull/1. AI-assisted.
mercuryVM commented 2026-11-24 09:04:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T09:04:56Z.

Review: APPROVED


Tested b1bdd89 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (247 passed, 0 failed; older base), including the two new tests/census.rs integration tests.

walkdir reports a missing or unreadable root as an error at depth 0. Failing the command there, with the path in the context, and recording deeper errors alongside unreadable images matches what a user would expect. Before, a typo in the path printed a clean "0 images scanned". The tests run the built victory binary on the crate's own Cargo.toml and a missing sibling, so they use no title data.

No issues found.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6036369668 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/115#pullrequestreview-6036369668). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T09:04:56Z. **Review:** APPROVED --- Tested b1bdd89 on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (247 passed, 0 failed; older base), including the two new `tests/census.rs` integration tests. `walkdir` reports a missing or unreadable root as an error at depth 0. Failing the command there, with the path in the context, and recording deeper errors alongside unreadable images matches what a user would expect. Before, a typo in the path printed a clean "0 images scanned". The tests run the built `victory` binary on the crate's own `Cargo.toml` and a missing sibling, so they use no title data. No issues found. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:02:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!115
No description provided.