anim_index: fix RBF0 string/rig bounds, scan_rpf limit checks, and atomic --rigs/output publishing (ANIM-INDEX-HARDENING) #1460
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1460"
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?
Imported from ubiquitarianism/leonida. Originally posted by IlyassRS3 on 2026-11-25T00:40:31Z.
Claimed in the coordination issue as: ANIM-INDEX-HARDENING
Summary
Hardens
tools/anim_index.pyacross RBF0 parsing, archive scan API validation, error handling, and atomic output publishing:_fd_stringrejection: unlike_u16_string(),_fd_string()did not checklen(raw) != n, silently accepting truncated prefixes past the end ofdata.parse_rbf0()rig pairing: previously, an orphan source tag with no rig before the next source or next rigset stole the following entry's/rigset's rig viabisect_left(rig_offsets, source_at). Now capsendatmin(next_source, next_rigset)and skips sources withrig_at >= end.scan_rpf()validation:limit=0previously treatedif limit:as unbounded andlimit < 0silently scanned 0 bytes; booleans forstart/limitwere also accepted. Now validatesstartandlimit >= 1(non-boolint).--rigsbefore writingout+ atomic staged publishing:main()wrotea.outbefore collecting/parsing--rigs, clobbering an existing index output even when--rigsfailed with exit code 2 (no RBF0 streamorparse_rbf0error).--rigsis now collected and parsed first (withOSError/zlib.errorcaught cleanly).write_output()(JSON and CSV) and--rigsnow publish atomically via_write_text_atomic()(tempfile.NamedTemporaryFilesibling +file_mode.published_mode+os.replace+chmod(0o600)cleanup), rejecting trailing directory separators and symlink loops (ELOOP).OSErrorwhen listing an unreadablea.sourcedirectory during the pre-flight overwrite guard instead of raising an uncaughtPermissionErrortraceback.Testing
arm64), Python 3.14 (CPU-only, synthetic RPF9/RBF0 fixtures only, no game data)python3 -m compileall -q make_game.py tools tests-> cleanpython3 -I scripts/check_no_game_data.py tools/anim_index.py tests/test_anim_index.py-> cleanpython3 -I tests/test_anim_index.py -v-> 53/53 OK (6 new tests)python3 -I tests/test_text_write_line_endings.py-> 3/3 OKpython3 -I tests/test_ci_registration.py-> 16/16 OKtests/test_anim_index.pyon unpatchedupstream/mainb4b7756e8):FAILED (failures=9, errors=1)across all 6 new tests.Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T00:40:46Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T10:16:37Z.
Red/green: the PR's tests fail on main
4938673and pass on head84a383eedd(Linux, Python 3.13.18).Targeted batch of 11 PRs (their tests, the tests importing the changed modules, the docs tests) on main
3ca0707: no new failure, Linux / Python 3.13.AI-assisted (Claude Code, Claude Opus 5.5)