fix(translate): keep the other two shader dumps out of the repo #434
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!434
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-434"
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?
@Luxuride on GitHub · 2026-12-04 02:44 UTC · original
Luxuride:fix/dump-outside-repo→main· +37 −0 · 1 files · 1 commits · merged 2026-12-04 03:42 UTCWhat is wrong
crates/victory-core/src/policy.rs:1-6states rule #1: anything produced from the user's files is as much "from the game" as the files themselves, and every tool that writes such output must callensure_outside_repoon the destination first.apps/victory/src/translate.rs:269-275says exactly that, then checks one of three destinations:The two below it write the same bytes —
&bytes[..], the title's own.cdxilcontainer — with no check:apps/victory/src/translate.rs:582-605,VICTORY_DUMP_MATCH=<dir>;<text>|…apps/victory/src/translate.rs:617-635,VICTORY_FAIL_DUMP=<dir>, which also swallows every error withlet _ =.Concrete failure
From a clone (the cwd
./run.shuses):fills the working tree with the title's shader containers, silently. The static half of rule #1 (
cargo xtask policy) only inspects tracked files, so nothing complains untilgit add -A, at which point game data becomes a candidate commit — the one thing the policy exists to prevent. The identicalVICTORY_EMIT_DUMP=$PWDis refused withPolicyError::InsideRepo, so three neighbours in one function behave two ways.The change
Check all three destinations up front, where the existing one already is:
Checking early also means the refusal happens before any container has been translated, not after the first match.
Plus a regression test next to the existing
emit_dump_inside_repo_is_refused: it sets each variable in turn toCARGO_MANIFEST_DIRand assertsrunfails withPolicyError::InsideRepo. One test for both, so the two cannot race each other on the environment.Validation
cargo check -p victory --tests --target x86_64-pc-windows-msvc—Finished(the test harness included). The crate cannot run natively here:victory-loaderneedswindows_sys.grep -c ensure_outside_repo apps/victory/src/translate.rs: 1 → 3.cargo test -p victory-core policy::passes on this host, which is the function the new calls land in (refusesCARGO_MANIFEST_DIRwithInsideRepo).runreturningOk— walkdir failures are dropped byfilter_map(Result::ok), so an unguarded dump directory produces no error at all.Overlap
Checked every open PR that touches
apps/victory/src/translate.rs(ray-tracing and translate work): none adds or moves anensure_outside_repocall or mentionsVICTORY_FAIL_DUMP/VICTORY_DUMP_MATCH. No issue mentions either variable or rule #1.victory shaders --list <path>(apps/victory/src/translate.rs:490) writes a text listing of hashes and game paths, not container bytes; leaving it out keeps this to the data the rule names.