App: enforce asset policy check in default_paths #535
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!535
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-535"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@pushkarreddyy on GitHub · 2026-11-24 04:35 UTC · original
pushkarreddyy:fix/app-default-paths-policy-check→main· +30 −0 · 1 files · 3 commits · openMotivation
apps/victory/src/main.rs:default_pathsresolves paths supplied either via the command line or fromvictory.toml(game_dirandtest_titles). Previously, it returned these paths without validating that they are outside the repository according to VIctory's asset policy (Rule #1).While
show_configlogged policy violations, commands relying ondefault_paths(census,shader-info,translate) did not enforcevictory_core::ensure_outside_repo(&p).Solution
default_pathswithvictory_core::ensure_outside_repo(p)?prior to returning.apps/victory/src/main.rsverifying that paths inside the repository are rejected and paths outside the repository are accepted.No game files used.
@pushkarreddyy on GitHub · 2026-11-24 04:51 UTC · original
### Technical Verification & Implementation Details
Context & Root Cause
In
apps/victory/src/main.rs,default_pathsresolves paths supplied on the CLI or fromvictory.toml(game_dirandtest_titles) forcensus,shader-info, andtranslate. Previously, it returned these paths without validating that they are outside the repository according to VIctory's asset policy (Rule #1).Changes & Diff
victory_core::ensure_outside_repo(p)?prior to returning.default_paths_enforces_outside_repo(rejecting repository paths) anddefault_paths_accepts_outside_path.Git Log Line & Verification
ext 8cc7bd2 App: enforce asset policy check in default_paths apps/victory/src/main.rs | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-)cargo xtask policy(Rule #1 compliance, zero game assets).rustfmt --edition 2024.@pushkarreddyy on GitHub · 2026-11-24 06:24 UTC · original
### Call for Testing & Maintainer Review
Community verification on CLI commands (
victory run,victory census,victory config) and cross-platform configuration on Windows/Linux is welcome!cargo xtask policypassing).@Marvisak: Ready for maintainer review and merge when convenient!
@KevinPratap on GitHub · 2026-11-24 07:22 UTC · original
Heads-up: with this merged, #115's census tests fail (they pass the crate's own
Cargo.tomlas input, whichdefault_pathsnow refuses as inside the source tree). Verified onmain+ #115 + #535: bothcensustests FAILED. The tests are what should change; a fix against #115's branch: https://github.com/ZekkJJ/VIctory/pull/1 (then 2 passed with this PR merged too). AI-assisted.@pushkarreddyy on GitHub · 2026-11-24 07:32 UTC · original
Thanks for the heads-up and verification @KevinPratap!
You're spot on: passing files inside the repository (like
Cargo.toml) directly violates Rule #1 andensure_outside_repo, so #115's tests pointing inside the source tree are indeed what should be updated (e.g. using a temporary directory fixture outside the repository). Great to see your fix in https://github.com/ZekkJJ/VIctory/pull/1 makes both tests pass with this PR merged as well!@pushkarreddyy on GitHub · 2026-11-24 12:34 UTC · original
Thanks @mercuryVM! You're completely right on aligning behavior and intent: the core requirement of Rule #1 is that configured directories in
victory.toml(game_dir,test_titles) must never point into the repository, whereas explicit CLI arguments passed to analysis tools (census,shader-info,translate) legitimately inspect in-tree test fixtures.I've updated the branch in commit
4307207so that:if !paths.is_empty() { return Ok(paths); }).victory.tomlstrictly enforcevictory_core::ensure_outside_repo(p)?, rejecting any in-repo configured path with an error.The PR title, behavior, and policy guarantees now align completely.
@pushkarreddyy on GitHub · 2026-11-24 11:27 UTC · original · edited 2026-11-24 14:22 UTC
Thanks @mercuryVM for the insightful architectural distinction!
You are completely right: read-only analysis tools (\census, \shader-info, \ ranslate) need to inspect synthetic in-repo test fixtures (like \ ests/fixtures\ or #115's test cases) without triggering an asset policy error. Hard-blocking reads inside the repo was conflating read-only analysis with writing derived data.
I've updated the branch in commit \ebfa8ae\ so that:
@Marvisak on GitHub · 2026-11-25 01:22 UTC · original · edited 2026-11-25 22:16 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main(conflict inapps/victory/src/main.rs). It will be reviewed again once it is rebased.From the earlier needs-work note, still open: name an output the new
default_pathsguard protects that is not already covered, and add a test that reaches the new branch indefault_paths.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.