[PR #334] [MERGED] manifest_verifier: refuse cache aliases of the input manifest (VERIFY-CACHE-COLLISION) #385

Closed
opened 2026-11-26 20:17:43 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/334
Author: @JiyouProt
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: codex/verify-cache-collision


📝 Commits (1)

  • 90b9fb8 manifest_verifier: refuse cache paths that alias the input manifest (VERIFY-CACHE-COLLISION)

📊 Changes

2 files changed (+57 additions, -0 deletions)

View changed files

📝 tests/test_manifest_verifier.py (+52 -0)
📝 tools/manifest_verifier.py (+5 -0)

📄 Description

Claimed in the coordination issue as: VERIFY-CACHE-COLLISION

What and why

Passing the same file to --manifest and --cache replaces the input manifest with cache JSON after reporting successful verification. Reject this configuration before hashing or writing, using report_paths.same_report_path so alternate path spellings, case aliases and links are also checked. The CLI exits 2 and preserves the original bytes.

Adds five synthetic regression tests. On the unchanged base, four fail and the symlink case is skipped on this Windows host. Based on main 84347bb; GitHub reports no merge conflicts.

Tested

Windows, Python 3.14.3:

  • python -I tests/test_manifest_verifier.py: 62 tests, 58 passed, 4 skipped.
  • python -I tests/test_report_paths.py: 22 tests, 20 passed, 2 skipped. The sandbox prevents hard/symbolic link creation; the other verifier skips are platform-specific.
  • Both suites also pass with Python 3.11.9: 80 passed, 4 skipped overall, including the new hard-link regression.
  • python -m compileall -q make_game.py tools tests, python -I make_game.py --help, scripts/check_no_game_data.py on both changed files, and git diff --check: passed.
  • python -I scripts/run_semantic_tests.py tests/semantic --jobs 8: completed in 501 s, 463 files and 6,075 tests run; 2 files failed (test_sopc_validation, test_unary_f16_validation) because spirv-as / spirv-val are unavailable. These translator files are unchanged by this PR.

GPUs tested: n/a. No game files used.

AI-assisted: yes, Codex.

Checklist

  • Based on main 84347bb and merges cleanly at submission.
  • One topic.
  • No game data, keys or decryption, including in fixtures and reports.
  • No new translator rule; contract table changes are not applicable.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/334 **Author:** [@JiyouProt](https://github.com/JiyouProt) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `codex/verify-cache-collision` --- ### 📝 Commits (1) - [`90b9fb8`](https://github.com/ubiquitarianism/leonida/commit/90b9fb86cc4cc35e57d87f8dfce34d84914c5770) manifest_verifier: refuse cache paths that alias the input manifest (VERIFY-CACHE-COLLISION) ### 📊 Changes **2 files changed** (+57 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_manifest_verifier.py` (+52 -0) 📝 `tools/manifest_verifier.py` (+5 -0) </details> ### 📄 Description Claimed in the coordination issue as: [VERIFY-CACHE-COLLISION](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7120714712) ### What and why Passing the same file to `--manifest` and `--cache` replaces the input manifest with cache JSON after reporting successful verification. Reject this configuration before hashing or writing, using `report_paths.same_report_path` so alternate path spellings, case aliases and links are also checked. The CLI exits 2 and preserves the original bytes. Adds five synthetic regression tests. On the unchanged base, four fail and the symlink case is skipped on this Windows host. Based on main 84347bb; GitHub reports no merge conflicts. ### Tested Windows, Python 3.14.3: - `python -I tests/test_manifest_verifier.py`: 62 tests, 58 passed, 4 skipped. - `python -I tests/test_report_paths.py`: 22 tests, 20 passed, 2 skipped. The sandbox prevents hard/symbolic link creation; the other verifier skips are platform-specific. - Both suites also pass with Python 3.11.9: 80 passed, 4 skipped overall, including the new hard-link regression. - `python -m compileall -q make_game.py tools tests`, `python -I make_game.py --help`, `scripts/check_no_game_data.py` on both changed files, and `git diff --check`: passed. - `python -I scripts/run_semantic_tests.py tests/semantic --jobs 8`: completed in 501 s, 463 files and 6,075 tests run; 2 files failed (`test_sopc_validation`, `test_unary_f16_validation`) because `spirv-as` / `spirv-val` are unavailable. These translator files are unchanged by this PR. GPUs tested: n/a. No game files used. AI-assisted: yes, Codex. ### Checklist - [x] Based on main 84347bb and merges cleanly at submission. - [x] One topic. - [x] No game data, keys or decryption, including in fixtures and reports. - [x] No new translator rule; contract table changes are not applicable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:43 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#385
No description provided.