meshlet_page: validate RPF9 archive headers before scanning meshlet pages (OLD-9986) #1230
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1230
Loading…
Reference in a new issue
No description provided.
Delete branch "carry/old-9986-meshlet-rpf9-header"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
What changed
Carries forward
old-pr/9986(draft #254, original commit by @lucastayaralvarenga-ui) rebased cleanly onto currentmain(705ea0910), preserving the original author commit.tools/meshlet_page.py: validate the RPF9 archive header initer_archive()before scanning for zlib streams — refuse files shorter than 8 bytes or withoutRPF9/9FPRmagic (<path>: not an RPF9 archive), and refuse data-area start offsets outside[8, size](<path>: RPF9 data start is outside the archive), raisingPageErrorso the CLI exits 2 without writing a misleading 0-page JSON report.tests/test_meshlet_page.py: addtest_invalid_archive_header_is_refused_before_writing_a_report(5 invalid header cases) andtest_header_only_archive_can_have_zero_pages.Item ID
OLD-9986(carries forwardold-pr/9986/ draft #254, #17)Verification
Tested on macOS 27.2.1 (Apple M5 arm64), Python 3.14 (no game files, no GPU, standard library only):
python3 -I tests/test_meshlet_page.py -v-> 73/73 OKtools/meshlet_page.pytoupstream/mainwhile keepingtests/test_meshlet_page.py) -> FAILED (5 failures): all 5 invalid header cases silently returned exit code0instead of2; restoring the fix returns to 73/73 OK.python3 -m compileall -q tools/meshlet_page.py tests/test_meshlet_page.py-> OKpython3 -I scripts/check_no_game_data.py tools/meshlet_page.py tests/test_meshlet_page.py-> OKpython3 -I tests/test_ci_registration.py-> 15/15 OKpython3 -I tests/test_text_write_line_endings.py-> 3/3 OKChecklist
Red/green: tests/test_meshlet_page.py fails 5 assertions on main (invalid RPF9 headers are scanned instead of refused with exit 2) and passes with the PR (cloud run on main 7daa4a4).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)