mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #1584] world_drawable_lookup: validate hex keys, archetype u32 fields, window budget, and deep JSON (WORLD-DRAWABLE-LOOKUP-VALIDATION) #1603
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1603
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1584
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/world-drawable-lookup-validation📝 Commits (1)
ed2affdworld_drawable_lookup: validate hex keys, archetype u32 fields, window budget, and deep JSON📊 Changes
2 files changed (+126 additions, -10 deletions)
View changed files
📝
tests/test_world_drawable_lookup.py(+89 -0)📝
tools/world_drawable_lookup.py(+37 -10)📄 Description
Item:
WORLD-DRAWABLE-LOOKUP-VALIDATION(unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touchtools/world_drawable_lookup.py).Summary
keyvalues as unsigned 64-bit hex strings ([0-9a-fA-F]+,< 2^64) so signed ("-1","+1"), underscore-separated ("1_2"),0x-prefixed, padded, or overflowing keys are counted asmissing_or_invalid_keyrather than enteringwanted(where"-1"formatted as"-000000000000001").name,asset_name, andasset_typefields as optional unsigned 32-bit integers (type(v) is int), preventing Python'sTrue == 1collision from matchingasset_type == 1(.#ft) and avoiding rawTypeError: unhashable typeon malformed rows.type(budget) is intinexport_window()sobool(True == 1),float(1.5), and non-numeric values raiseValueErrorinstead of being accepted or raisingTypeError.summary.archivestrings, catchRecursionErrorinreport_rows()andmain(argv=None), enforceallow_nan=Falseon JSON output, and return exit code0.Verification
python3 -W error -I tests/test_world_drawable_lookup.py -v: 6/6 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/world_drawable_lookup.py tests/test_world_drawable_lookup.py: passed.python3 -m compileall -q tools/world_drawable_lookup.py tests/test_world_drawable_lookup.py: passed.main:tools/world_drawable_lookup.py):failures=7, errors=3across all 4 new regression tests.AI-assisted: yes
GPUs tested: none (CPU-only Python tool; synthetic fixtures only, no game data)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.