leonida_mods: hash lower-cased Latin-1 bytes in joaat() #168

Closed
Andretuta wants to merge 1 commit from upstream-pr/168 into main
Andretuta commented 2026-11-24 02:34:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:34:06Z.


Carried over from old PR 9902 by EspadaHD in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9902, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
EspadaHD: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116815084

What and why

tools/leonida_mods.py's joaat(name) encoded the string as UTF-8 first and only folded ASCII uppercase bytes (0x41..0x5A), diverging from tools/hashdict.py's canonical name.lower().encode("latin-1", "replace") on every non-ASCII name and causing 6 subtest failures in tests/test_joaat_agreement.py (copy='leonida_mods'). Hash name.lower().encode("latin-1", "replace") so leonida_mods.joaat agrees with hashdict.joaat.

Tested

  • python -I tests/test_joaat_agreement.py: all 10 copy='leonida_mods' subtests pass (0 failures for leonida_mods, down from 6; remaining 6 failures on main are in find_hash_lookup)
  • python -I tests/test_leonida_mods.py -v: ManifestTests (test_hashes_match_the_runtime_contract, test_manifest_validation_matches_runtime_rules) and SamplesAndGuiTests pass (9/10 pass; test_run_print_builds_gta6rt_command has an unrelated pre-existing Windows failure because its fixture creates gta6rt.sh)
  • python -m compileall -q tools/leonida_mods.py: exit 0
  • python -I scripts/check_no_game_data.py tools/leonida_mods.py: exit 0
  • Environment: Windows, CPU-only standard library tests, no game data, no GPU used.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465000504 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/168). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:34:06Z. --- > Carried over from **old PR 9902** by `EspadaHD` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9902`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `EspadaHD`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116815084 ### What and why `tools/leonida_mods.py`'s `joaat(name)` encoded the string as UTF-8 first and only folded ASCII uppercase bytes (`0x41..0x5A`), diverging from `tools/hashdict.py`'s canonical `name.lower().encode("latin-1", "replace")` on every non-ASCII name and causing 6 subtest failures in `tests/test_joaat_agreement.py` (`copy='leonida_mods'`). Hash `name.lower().encode("latin-1", "replace")` so `leonida_mods.joaat` agrees with `hashdict.joaat`. ### Tested - `python -I tests/test_joaat_agreement.py`: all 10 `copy='leonida_mods'` subtests pass (0 failures for `leonida_mods`, down from 6; remaining 6 failures on `main` are in `find_hash_lookup`) - `python -I tests/test_leonida_mods.py -v`: `ManifestTests` (`test_hashes_match_the_runtime_contract`, `test_manifest_validation_matches_runtime_rules`) and `SamplesAndGuiTests` pass (9/10 pass; `test_run_print_builds_gta6rt_command` has an unrelated pre-existing Windows failure because its fixture creates `gta6rt.sh`) - `python -m compileall -q tools/leonida_mods.py`: exit 0 - `python -I scripts/check_no_game_data.py tools/leonida_mods.py`: exit 0 - Environment: Windows, CPU-only standard library tests, no game data, no GPU used. AI-assisted: yes ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
DadaCap commented 2026-11-28 10:33:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:33:09Z.


Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures.

Reason: superseded by main.

If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237970148 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/168#issuecomment-7237970148). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T10:33:09Z. --- Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures. Reason: superseded by main. If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!168
No description provided.