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

Open
maxence468 wants to merge 1 commit from upstream-pr/2642 into main
maxence468 commented 2026-11-25 17:27:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by maxence468 on 2026-11-25T17:27:05Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6609985957 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2642). Originally posted by [maxence468](https://github.com/maxence468) on 2026-11-25T17:27:05Z. --- 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.
cloph-dsp commented 2026-11-25 18:02:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-25T17:37:58Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7169780477 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2642#issuecomment-7169780477). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-25T17:37:58Z. --- 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).
kotekompotek commented 2026-11-25 18:02:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T17:43:56Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7169920083 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2642#issuecomment-7169920083). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T17:43:56Z. --- 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.
Marvisak commented 2026-11-26 00:03:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:22:47Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177479452 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2642#issuecomment-7177479452). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T23:22:47Z. --- <!-- 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)_
fuzeofficlal commented 2026-11-26 12:05:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T11:39:22Z.

Review: APPROVED


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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6073506131 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2642#pullrequestreview-6073506131). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T11:39:22Z. **Review:** APPROVED --- 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.
futurepro62 commented 2026-11-26 12:05:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T11:08:57Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7190336731 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2642#issuecomment-7190336731). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T11:08:57Z. --- 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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2642:upstream-pr/2642'
git switch 'upstream-pr/2642'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2642'
git switch 'upstream-pr/2642'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2642'
git switch 'upstream-pr/2642'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2642'
git switch 'main'
git merge --squash 'upstream-pr/2642'
git switch 'main'
git merge --ff-only 'upstream-pr/2642'
git switch 'main'
git merge 'upstream-pr/2642'
git push origin 'main'
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!2640
No description provided.