rbf0_encode: refuse invalid descriptor names during batch export #454

Manually merged
github merged 1 commit from gh-pr/454/head into gh-pr/454/base 2026-11-26 09:01:07 +00:00
Owner

@⁠EdenBendheim on GitHub · 2026-11-24 05:40 UTC · original
EdenBendheim:ubiq/rbf0-encode-name-type → main · +64 −3 · 2 files · 1 commits · merged 2026-11-24 06:57 UTC

Claim: #14

What changed

  • tools/rbf0_encode.py: Validate record and descriptor-table name values before encoding so non-string names raise EncodeError("value", ...) and lone surrogates raise EncodeError("utf8", ...) instead of escaping with AttributeError. Omitted descriptor-table names continue falling back to the record name.
  • tests/test_rbf0_encode.py: Synthetic tests covering non-string names, lone surrogates, descriptor reuse, omitted-name fallback, and batch refusal leaving subsequent valid resources written byte-for-byte.

Testing & Disclosure

  • AI-assisted: Implemented with Codex (gpt-6.2-sol) and reviewed with Codex (gpt-6.2-astra).
  • Environment: macOS 27.3, Apple M1 Max (CPU-only, synthetic fixtures, zero game data).
  • Verified on ubiquitarianism/leonida main (8f481cf16): all 4 tests/test_rbf0*.py suites (105/105), check_no_game_data.py, LF check — all passed.
**@⁠EdenBendheim** on GitHub · 2026-11-24 05:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/454) `EdenBendheim:ubiq/rbf0-encode-name-type` → `main` · +64 −3 · 2 files · 1 commits · merged 2026-11-24 06:57 UTC Claim: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ### What changed - **`tools/rbf0_encode.py`**: Validate record and descriptor-table `name` values before encoding so non-string names raise `EncodeError("value", ...)` and lone surrogates raise `EncodeError("utf8", ...)` instead of escaping with `AttributeError`. Omitted descriptor-table names continue falling back to the record name. - **`tests/test_rbf0_encode.py`**: Synthetic tests covering non-string names, lone surrogates, descriptor reuse, omitted-name fallback, and batch refusal leaving subsequent valid resources written byte-for-byte. ### Testing & Disclosure - **AI-assisted:** Implemented with Codex (`gpt-6.2-sol`) and reviewed with Codex (`gpt-6.2-astra`). - **Environment:** macOS 27.3, Apple M1 Max (CPU-only, synthetic fixtures, zero game data). - **Verified on `ubiquitarianism/leonida` `main` (`8f481cf16`):** all 4 `tests/test_rbf0*.py` suites (105/105), `check_no_game_data.py`, LF check — all passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:01:03 +00:00
github manually merged commit bbf2cf1119 into gh-pr/454/base 2026-11-26 09:01:07 +00:00
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 06:57 UTC · original

Merging. Why merged: names that aren't strings now get a clean "value"/"utf8" refusal, and batch export moves on to the next resource instead of crashing.
Why it's good: security-reviewed; tested on Windows 11 merged onto main c023a36: test_rbf0_encode 32 -> 37 tests, all OK (the new tests fail on main: 12 failures, 6 errors); rbf0_tree's 38 still pass.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 06:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/454#issuecomment-7124465207) Merging. Why merged: names that aren't strings now get a clean "value"/"utf8" refusal, and batch export moves on to the next resource instead of crashing. Why it's good: security-reviewed; tested on Windows 11 merged onto main c023a36: test_rbf0_encode 32 -> 37 tests, all OK (the new tests fail on main: 12 failures, 6 errors); rbf0_tree's 38 still pass. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.