translate: refuse VICTORY_FAIL_DUMP and VICTORY_DUMP_MATCH folders inside the repo too #264

Open
github-bot wants to merge 1 commit from github-bot/gh-264 into main AGit
Owner

@⁠sharan104 on GitHub · 2026-11-26 13:35 UTC · original
sharan104:fix/translate-dump-policy → main · +43 −4 · 1 files · 1 commits · open

translate::run refuses a VICTORY_EMIT_DUMP folder inside the source tree (rule #1, docs/asset-policy.md). But two other switches write the title's containers as .cdxil too, and neither was checked:

  • VICTORY_FAIL_DUMP=<dir>: the first containers of each failure reason
  • VICTORY_DUMP_MATCH=<dir>;<text>|…: the containers whose line matches

With a relative folder, or one pointing into the checkout, the game-derived files landed in the repository. It's the same kind of gap as #33.

Fix: a new dumps_outside_repo(env) checks all three folders at the start of run, reading VICTORY_DUMP_MATCH the same way translate does (the part before ;). It replaces the single VICTORY_EMIT_DUMP check.

Test: every_dump_folder_inside_repo_is_refused takes the environment as a closure instead of setting real variables, so it can't race other tests. For each of the three switches, it checks that a folder in the repo is refused and a temp folder is accepted. It fails before the change and passes after it (10 runs out of 10).

Results:

  • cargo test -p victory --locked passes.
  • cargo clippy -p victory --all-targets --locked --no-deps -- -D warnings is clean, with and without --all-features.

🤖 Generated with Claude Code

**@⁠sharan104** on GitHub · 2026-11-26 13:35 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/264) `sharan104:fix/translate-dump-policy` → `main` · +43 −4 · 1 files · 1 commits · open `translate::run` refuses a `VICTORY_EMIT_DUMP` folder inside the source tree (rule #1, `docs/asset-policy.md`). But two other switches write the title's containers as `.cdxil` too, and neither was checked: - `VICTORY_FAIL_DUMP=<dir>`: the first containers of each failure reason - `VICTORY_DUMP_MATCH=<dir>;<text>|…`: the containers whose line matches With a relative folder, or one pointing into the checkout, the game-derived files landed in the repository. It's the same kind of gap as #33. **Fix:** a new `dumps_outside_repo(env)` checks all three folders at the start of `run`, reading `VICTORY_DUMP_MATCH` the same way `translate` does (the part before `;`). It replaces the single `VICTORY_EMIT_DUMP` check. **Test:** `every_dump_folder_inside_repo_is_refused` takes the environment as a closure instead of setting real variables, so it can't race other tests. For each of the three switches, it checks that a folder in the repo is refused and a temp folder is accepted. It fails before the change and passes after it (10 runs out of 10). **Results:** - `cargo test -p victory --locked` passes. - `cargo clippy -p victory --all-targets --locked --no-deps -- -D warnings` is clean, with and without `--all-features`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`victory translate` checked VICTORY_EMIT_DUMP against the asset policy
before it ran, but not the two other folders it writes the title's
containers into: VICTORY_FAIL_DUMP (the first three containers of each
failure reason, as `.cdxil`) and VICTORY_DUMP_MATCH (`<dir>;<texts>`,
the containers whose line matches). Pointed into a checkout, both wrote
game files there, where `cargo xtask policy` only catches them once
they are tracked (rule #1, docs/asset-policy.md; #33 was the same for
VICTORY_WRITE_SITES).

All three are now checked at the start of `run`, as EMIT_DUMP was; the
folder of DUMP_MATCH is read as `translate` reads it. The new test
fails before the change (FAIL_DUMP is accepted) and passes after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:38:16 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/264/head:github-bot/gh-264'
git switch 'github-bot/gh-264'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-264'
git switch 'github-bot/gh-264'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-264'
git switch 'github-bot/gh-264'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-264'
git switch 'main'
git merge --squash 'github-bot/gh-264'
git switch 'main'
git merge --ff-only 'github-bot/gh-264'
git switch 'main'
git merge 'github-bot/gh-264'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.