Skip to content

bvh_slot_check: use shared report_paths.same_report_path for --save-evidence guard - #8533

Open
suleymansarilar wants to merge 1 commit into
ItsNotRexed:mainfrom
suleymansarilar:bvh-slot-check-report-paths
Open

suleymansarilar wants to merge 1 commit into
ItsNotRexed:mainfrom
suleymansarilar:bvh-slot-check-report-paths

Conversation

@suleymansarilar

Copy link
Copy Markdown

Claimed in the coordination issue as: bvh_slot_check: use shared report_paths.same_report_path for --save-evidence input guard (BUILD-589)

What and why

tools/bvh_slot_check.py guarded --save-evidence against overwriting archive, index, and *manifests using save.resolve() in {path.resolve() ...} instead of tools/report_paths.same_report_path. That check missed hard links and non-existent case-only aliases on case-insensitive volumes.

  • Switch census() in tools/bvh_slot_check.py to report_paths.same_report_path(save, path) per CONTRIBUTING.md.
  • Register bvh_slot_check in SHARED in tests/test_report_paths.py and add a folding-volume case-alias unit test in tests/test_bvh_slot_check.py.

Tested

  • python -I tests/test_report_paths.py (22 tests, OK)
  • python -I tests/test_bvh_slot_check.py SlotControls.test_save_evidence_uses_shared_same_report_path_and_rejects_input_aliases (OK)
  • python -I scripts/check_no_game_data.py tools/bvh_slot_check.py tests/test_bvh_slot_check.py tests/test_report_paths.py
  • git diff --check
  • Windows 11, NVIDIA GeForce RTX 3070 Laptop GPU (synthetic fixtures only, no game files).

AI-assisted: yes (Antigravity / Gemini 4 Argon)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (N/A — tool path guard only)

…vidence guard

Use tools/report_paths.same_report_path(save, path) instead of Path.resolve() set membership when guarding --save-evidence against overwriting archive, index, or manifest inputs. Register bvh_slot_check in SHARED in tests/test_report_paths.py and add a folding-volume case-alias test.

@leoleahy leoleahy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted.

Independently verified on Windows 11 (Python 3.14.8, CPU-only) at 9f7822aa:

  • Merge cleanliness against upstream/main (867d922f): git merge-tree --write-tree clean, git diff --check clean, python -I -m compileall -q clean.
  • python -I tests/test_report_paths.py: 21/22 passed, 1 skipped on HEAD; negative control on base dde82f27 fails test_switched_tools_import_the_helper_and_define_no_copy for bvh_slot_check.
  • python -I tests/test_bvh_slot_check.py: 7/10 passed including the new test_save_evidence_uses_shared_same_report_path_and_rejects_input_aliases (the 3 remaining errors are the pre-existing model_geometries 5-vs-6 unpack bug on dde82f27, fixed separately in #8013 / #8421); negative control on base dde82f27 adds an error on the new test (AttributeError: module 'bvh_slot_check' has no attribute 'same_report_path').
  • Direct unmocked NTFS probe with real Path objects confirmed census(..., save=root / "INDEX.JSON") raises ValueError: evidence output would overwrite a census input.

Looks good to merge.

@RAINighty

Copy link
Copy Markdown

Tested 9f7822aa9 merged with main 867d922f0 (clean merge) on Windows 11 (10.0.26300), Python 3.13.15 in UTF-8 mode (PYTHONUTF8=1; venv with the pinned tests/requirements.txt): tests/test_report_paths.py passes; tests/test_bvh_slot_check.py is red with and without this PR (the same 3 errors).

  • tests/test_report_paths.py: passes with this PR (Ran 22 tests, OK); on main also OK (Ran 22 tests).
  • tests/test_bvh_slot_check.py: with this PR 10 tests, errors=3; on main 9 tests, errors=3. The three errors are the same ones on both sides (ValueError: too many values to unpack (expected 5) in SlotControls, and the incremental-CLI test failing with a non-zero exit from tools/bvh_slot_check.py), so this PR neither causes nor fixes them; the new test does pass.
  • Negative control: this PR's tests with main's versions of tools/bvh_slot_check.py fail (test_bvh_slot_check.py errors=4, test_report_paths.py failures=1), so the added cases do catch the change.
  • Code not reviewed beyond running it. No GPU or game files.

AI-assisted (Claude Code).

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 9f7822aa on Windows Server 2022, CPython 3.13.12: pass

  • python -I tests/test_bvh_slot_check.py -> FAILED (errors=3); python -I tests/test_report_paths.py -> OK
  • the 3 errors are pre-existing Windows platform failure (same or worse on unmodified upstream/main), not the PR (upstream/main gives 4 errors)

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants