[PR #1303] mods: hash a mod.json name as hashdict.joaat does (OLD-10050) #1333

Open
opened 2026-11-26 20:20:53 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1303
Author: @wetw0rks-c0ding
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: restore/old-10050-mods-joaat-latin1


📝 Commits (1)

  • ca898f0 mods: hash a mod.json name as hashdict.joaat does (lower-cased Latin-1, not UTF-8 bytes)

📊 Changes

2 files changed (+63 additions, -5 deletions)

View changed files

📝 runtime/src/mods.h (+48 -5)
📝 runtime/test/mods_test.cpp (+15 -0)

📄 Description

Claimed in the coordination issue as: OLD-10050

What and why

mods::joaat hashed UTF-8 bytes and lower-cased only ASCII, so a mod.json name containing non-ASCII Latin-1 characters got a different hash from tools/hashdict.py and archetype swaps silently missed their target. It now decodes UTF-8, lower-cases across Latin-1 code points and hashes the Latin-1 bytes with a ? fallback, matching hashdict.joaat.

Tested

  • cmake -S runtime -B runtime/build && cmake --build runtime/build --parallel 6 && ctest --test-dir runtime/build -R mods --output-on-failure -> ctest 1/1 passed
  • python -I scripts/check_no_game_data.py runtime/src/mods.h runtime/test/mods_test.cpp -> clean
  • Environment: Linux (CachyOS), CPU-only tests, no GPU required

AI-assisted: Yes. This work was done with OpenCode agents.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1303 **Author:** [@wetw0rks-c0ding](https://github.com/wetw0rks-c0ding) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `restore/old-10050-mods-joaat-latin1` --- ### 📝 Commits (1) - [`ca898f0`](https://github.com/ubiquitarianism/leonida/commit/ca898f0e6d864d38f05a5e644bdc561dae8d5ac5) mods: hash a mod.json name as hashdict.joaat does (lower-cased Latin-1, not UTF-8 bytes) ### 📊 Changes **2 files changed** (+63 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/mods.h` (+48 -5) 📝 `runtime/test/mods_test.cpp` (+15 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-10050 ### What and why `mods::joaat` hashed UTF-8 bytes and lower-cased only ASCII, so a `mod.json` name containing non-ASCII Latin-1 characters got a different hash from `tools/hashdict.py` and archetype swaps silently missed their target. It now decodes UTF-8, lower-cases across Latin-1 code points and hashes the Latin-1 bytes with a `?` fallback, matching `hashdict.joaat`. ### Tested - `cmake -S runtime -B runtime/build && cmake --build runtime/build --parallel 6 && ctest --test-dir runtime/build -R mods --output-on-failure` -> ctest 1/1 passed - `python -I scripts/check_no_game_data.py runtime/src/mods.h runtime/test/mods_test.cpp` -> clean - Environment: Linux (CachyOS), CPU-only tests, no GPU required AI-assisted: Yes. This work was done with OpenCode agents. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1333
No description provided.