check_no_game_data: inspect legacy V7 tar archives #1899

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

@⁠XeNS1 on GitHub · 2026-11-25 15:07 UTC · original
XeNS1:codex/check-no-game-data-v7-tar-20261125 → main · +73 −2 · 2 files · 1 commits · open

Claimed in the coordination issue as: CHECK-NO-GAME-DATA-V7-TAR
#1608

Related: #1024 handles explicit-path validation in the same files; that separate behavior is unchanged here.

What and why

A valid V7 tar archive has no ustar marker. Saved under a harmless name such as .bin, it previously passed check_no_game_data.py without its members being inspected, even if a member started with a prohibited binary-format header.

Recognize legacy archives by validating their first 512-byte header through tarfile.TarInfo.frombuf. The existing ustar detection still identifies damaged modern tar archives as unchecked. Member inspection continues through the existing depth, expanded-byte and member-count budgets.

Add generated synthetic fixtures covering raw V7 tar, gzip/bzip2/xz compression, ZIP nesting, a clean first member followed by a synthetic DDS header, clean text-only archives, and non-archive controls. All binary fixture bytes are generated in temporary directories; no game files are included or needed.

Tested

Linux x86-64, Python 3.14.8, CPU only:

  • python3 -I tests/test_check_no_game_data.py: 15 tests passed.
  • python3 -I tests/test_no_game_data_workflow.py: 3 tests passed.
  • Regression proof: all five cases in the new V7 detection test fail against the unchanged scanner and pass with the fix.
  • tests/test_text_write_line_endings.py: 3 tests passed.
  • Full semantic suite: 489 files, 6,288 tests, zero failed files, 213 seconds with 2 workers. This was run before rebasing; the only subsequent upstream changes were runtime/CMakeLists.txt and runtime/test/d3d12_title_va_test.cpp, so the Python sources and semantic fixtures are identical.
  • compileall for make_game.py, tools, tests and the changed scanner; make_game.py --help; changed-file game-data scan; git diff --check: passed.
  • Known baseline failure: test_runner_calls_all_tests.py reports the uncalled test_feature_scan.py::test_out_named_like_the_optional_spirv_index. The same failure was reproduced on a separate clean upstream worktree. Neither file is changed here.

GPUs tested: n/a; CPU-only checks. No game installation was accessed.

AI-assisted: yes, OpenAI Codex.

Checklist

  • Rebased on current main without conflicts.
  • One topic.
  • No game data, keys, decryption or game-derived logs in the change or report.
  • No translator rule changed; contract-table update is not applicable.
**@⁠XeNS1** on GitHub · 2026-11-25 15:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1899) `XeNS1:codex/check-no-game-data-v7-tar-20261125` → `main` · +73 −2 · 2 files · 1 commits · open Claimed in the coordination issue as: CHECK-NO-GAME-DATA-V7-TAR https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608 Related: #1024 handles explicit-path validation in the same files; that separate behavior is unchanged here. ### What and why A valid V7 tar archive has no `ustar` marker. Saved under a harmless name such as `.bin`, it previously passed `check_no_game_data.py` without its members being inspected, even if a member started with a prohibited binary-format header. Recognize legacy archives by validating their first 512-byte header through `tarfile.TarInfo.frombuf`. The existing `ustar` detection still identifies damaged modern tar archives as unchecked. Member inspection continues through the existing depth, expanded-byte and member-count budgets. Add generated synthetic fixtures covering raw V7 tar, gzip/bzip2/xz compression, ZIP nesting, a clean first member followed by a synthetic DDS header, clean text-only archives, and non-archive controls. All binary fixture bytes are generated in temporary directories; no game files are included or needed. ### Tested Linux x86-64, Python 3.14.8, CPU only: - `python3 -I tests/test_check_no_game_data.py`: 15 tests passed. - `python3 -I tests/test_no_game_data_workflow.py`: 3 tests passed. - Regression proof: all five cases in the new V7 detection test fail against the unchanged scanner and pass with the fix. - `tests/test_text_write_line_endings.py`: 3 tests passed. - Full semantic suite: 489 files, 6,288 tests, zero failed files, 213 seconds with 2 workers. This was run before rebasing; the only subsequent upstream changes were `runtime/CMakeLists.txt` and `runtime/test/d3d12_title_va_test.cpp`, so the Python sources and semantic fixtures are identical. - `compileall` for `make_game.py`, `tools`, `tests` and the changed scanner; `make_game.py --help`; changed-file game-data scan; `git diff --check`: passed. - Known baseline failure: `test_runner_calls_all_tests.py` reports the uncalled `test_feature_scan.py::test_out_named_like_the_optional_spirv_index`. The same failure was reproduced on a separate clean upstream worktree. Neither file is changed here. GPUs tested: n/a; CPU-only checks. No game installation was accessed. AI-assisted: yes, OpenAI Codex. ### Checklist - [x] Rebased on current `main` without conflicts. - [x] One topic. - [x] No game data, keys, decryption or game-derived logs in the change or report. - [x] No translator rule changed; contract-table update is not applicable.
Recognize checksum-valid legacy tar headers without a ustar marker, while retaining the existing handling of damaged modern tar archives. Add synthetic CLI regressions for raw, compressed and nested archives, clean text, and non-archive controls.

AI-assisted: OpenAI Codex
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:10:36 +00:00
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-25 15:32 UTC · original

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

python -m pytest -q tests/test_check_no_game_data.py:

  • PR: 15 passed, 71 subtests passed. main: 11 passed, 66 subtests passed. The new tests pass on Windows.

(AI-assisted test run; output checked by hand.)

**@⁠DeadlyChirp** on GitHub · 2026-11-25 15:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1899#issuecomment-7166993151) Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. `python -m pytest -q tests/test_check_no_game_data.py`: - PR: 15 passed, 71 subtests passed. main: 11 passed, 66 subtests passed. The new tests pass on Windows. (AI-assisted test run; output checked by hand.)
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/1899/head:github-bot/gh-1899'
git switch 'github-bot/gh-1899'

Merge

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