Check staged file type changes in the asset policy hook #2642

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

@⁠maxence468 on GitHub · 2026-11-25 17:27 UTC · original
maxence468:fix/check-staged-type-changes → main · +1 −1 · 1 files · 1 commits · open

Git reports replacement of a tracked symlink with a regular file as T. Include that status so the pre-commit check reads the new staged blob. Verified in a temporary Git repository that the old filter omits the replacement and the updated filter lists it. git diff --check passed. The Rust suite was not run.

**@⁠maxence468** on GitHub · 2026-11-25 17:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/2642) `maxence468:fix/check-staged-type-changes` → `main` · +1 −1 · 1 files · 1 commits · open Git reports replacement of a tracked symlink with a regular file as T. Include that status so the pre-commit check reads the new staged blob. Verified in a temporary Git repository that the old filter omits the replacement and the updated filter lists it. git diff --check passed. The Rust suite was not run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:11:00 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-25 17:37 UTC · original

Independent Windows verification of PR #2642 (head 9f55841), synthetic/temporary-repository only; no game data and no source edits.

  • cargo test --locked -p xtask: 6 passed, 0 failed (including policy::tests::repository_passes_policy).
  • Manual staged-policy scenario in a temporary Git repository: a tracked symlink (index mode 120000) was replaced by a regular file and staged as mode 100644. git diff --cached --name-status reports T link. The old filter --diff-filter=ACMR lists [] (file skipped); the new ACMRT lists [link]. On this Windows host core.symlinks=false, so the mode change had to be staged explicitly with git update-index --cacheinfo 100644 — plain git add kept mode 120000. This confirms the one-line fix covers the typechange case.

No bug found. Toolchain: rustc/cargo 1.100.0 MSVC (repo pins 1.98.1). AI-assisted (Hy4 flash).

**@⁠cloph-dsp** on GitHub · 2026-11-25 17:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/2642#issuecomment-7169780477) Independent Windows verification of PR #2642 (head `9f55841`), synthetic/temporary-repository only; no game data and no source edits. - `cargo test --locked -p xtask`: **6 passed**, 0 failed (including `policy::tests::repository_passes_policy`). - Manual staged-policy scenario in a temporary Git repository: a tracked symlink (index mode `120000`) was replaced by a regular file and staged as mode `100644`. `git diff --cached --name-status` reports `T link`. The old filter `--diff-filter=ACMR` lists `[]` (file skipped); the new `ACMRT` lists `[link]`. On this Windows host `core.symlinks=false`, so the mode change had to be staged explicitly with `git update-index --cacheinfo 100644` — plain `git add` kept mode `120000`. This confirms the one-line fix covers the typechange case. No bug found. Toolchain: rustc/cargo 1.100.0 MSVC (repo pins 1.98.1). AI-assisted (Hy4 flash).
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 17:43 UTC · original

Reviewed: --diff-filter=ACMRT adds type changes so a file staged as a symlink (or symlink→file) no longer slips past the asset-policy check. Small and directly serves rule #1. CI green.

**@⁠kotekompotek** on GitHub · 2026-11-25 17:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/2642#issuecomment-7169920083) Reviewed: `--diff-filter=ACMRT` adds type changes so a file staged as a symlink (or symlink→file) no longer slips past the asset-policy check. Small and directly serves rule #1. CI green.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 23:22 UTC · original

Automated triage for the maintainers.

This changes list_files in xtask/src/policy.rs from --diff-filter=ACMR to ACMRT, so a staged type change (symlink replaced by a regular file, or the reverse) is included in the --staged asset-policy check. I checked that run reads such entries from the index via git show :<path>, so the new blob is actually inspected; the change only tightens the allowlist check and adds no exception. CI (check) passes.

This is a recommendation for a maintainer to look, not an approval.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 23:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2642#issuecomment-7177479452) <!-- victory-triage v1 head=9f55841a1aaca2f5e9ad9ab85eab6ce501db079b verdict=merge-candidate at=2026-11-25T23:22:40Z --> Automated triage for the maintainers. This changes `list_files` in `xtask/src/policy.rs` from `--diff-filter=ACMR` to `ACMRT`, so a staged type change (symlink replaced by a regular file, or the reverse) is included in the `--staged` asset-policy check. I checked that `run` reads such entries from the index via `git show :<path>`, so the new blob is actually inspected; the change only tightens the allowlist check and adds no exception. CI (`check`) passes. This is a recommendation for a maintainer to look, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 11:08 UTC · original

NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head 9f55841 (on its base 13f91ca).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 773 passed, 0 failed, 9 ignored.
  • No new #[test] functions in the diff.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 11:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/2642#issuecomment-7190336731) NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head `9f55841` (on its base `13f91ca`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **773 passed, 0 failed, 9 ignored**. - No new `#[test]` functions in the diff. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 11:39 UTC · original · approved these changes

Reviewed 9f55841a (git merge-tree against main 63bcca43 is clean): adding T to --diff-filter=ACMRT in xtask/src/policy.rs:114 closes the gap where replacing a tracked symlink with a regular file in the index skipped policy::run's git show :<path> blob inspection.

Verified locally on Windows 11 (Rust 1.98.1 MSVC):

  • rustfmt --edition 2024 --check xtask/src/policy.rs: clean.
  • cargo clippy -p xtask --all-targets -- -D warnings (default and --all-features): clean.
  • xtask policy (184 files ok) and cargo test -p xtask --locked (6/6 passed): clean.

Non-blocking notes on pre-existing behavior: --staged still inspects the index blob without checking the 120000 mode on symlink entries (and treats git show failures as deleted), and an index-level test for T transitions would be a nice follow-up.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 11:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/2642#pullrequestreview-6073506131) · **approved these changes** Reviewed `9f55841a` (`git merge-tree` against `main` `63bcca43` is clean): adding `T` to `--diff-filter=ACMRT` in `xtask/src/policy.rs:114` closes the gap where replacing a tracked symlink with a regular file in the index skipped `policy::run`'s `git show :<path>` blob inspection. Verified locally on Windows 11 (Rust 1.98.1 MSVC): - `rustfmt --edition 2024 --check xtask/src/policy.rs`: clean. - `cargo clippy -p xtask --all-targets -- -D warnings` (default and `--all-features`): clean. - `xtask policy` (`184 files ok`) and `cargo test -p xtask --locked` (6/6 passed): clean. Non-blocking notes on pre-existing behavior: `--staged` still inspects the index blob without checking the `120000` mode on symlink entries (and treats `git show` failures as deleted), and an index-level test for `T` transitions would be a nice follow-up.
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/2642/head:github-bot/gh-2642'
git switch 'github-bot/gh-2642'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2642'
git switch 'github-bot/gh-2642'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2642'
git switch 'github-bot/gh-2642'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2642'
git switch 'main'
git merge --squash 'github-bot/gh-2642'
git switch 'main'
git merge --ff-only 'github-bot/gh-2642'
git switch 'main'
git merge 'github-bot/gh-2642'
git push origin 'main'
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!2642
No description provided.