[PR #1834] leonida_mods: read mod.json as the runtime does, camera section and byte-order mark included (MODS-MANIFEST-RUNTIME-RULES) #1847

Open
opened 2026-11-26 21:19:10 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1834
Author: @RK28A
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: mods-manager-camera-bom


📝 Commits (2)

  • c5b09c2 leonida_mods: read mod.json as the runtime does, camera section and byte-order mark included
  • 4895e63 Merge remote-tracking branch 'up/main' into mods-manager-camera-bom

📊 Changes

3 files changed (+193 additions, -13 deletions)

View changed files

📝 docs/modding.md (+2 -1)
📝 tests/test_leonida_mods.py (+101 -0)
📝 tools/leonida_mods.py (+90 -12)

📄 Description

Claimed in the coordination issue as: MODS-MANIFEST-RUNTIME-RULES

What and why

The mod manager checks mod.json with its own copy of the rules in runtime/src/mods.h and that copy was behind. It did not read the camera section so list said that mods/first_person changes nothing and check passed camera values the runtime refuses. It refused a mod.json that starts with a UTF-8 byte-order mark although the runtime and docs/modding.md accept it. It also accepted "archetype_swaps": null which the runtime refuses.

The manager now applies the same checks as parse_mod and list shows the camera each mod sets.

Tested

python -I tests/test_leonida_mods.py passes with 13 tests and 5 of them fail without the change. I compared the manager with parse_mod built from runtime/src/mods.h on 30,015 generated manifests. 17,256 decisions differed before and none after. Linux and Python 3.13.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a: no translator change)

🔄 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/1834 **Author:** [@RK28A](https://github.com/RK28A) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `mods-manager-camera-bom` --- ### 📝 Commits (2) - [`c5b09c2`](https://github.com/ubiquitarianism/leonida/commit/c5b09c21ec63a21d48fa2078bb2e7e8f4fa6bd93) leonida_mods: read mod.json as the runtime does, camera section and byte-order mark included - [`4895e63`](https://github.com/ubiquitarianism/leonida/commit/4895e63a99a19f94d38b3a52b43feb852a5560cb) Merge remote-tracking branch 'up/main' into mods-manager-camera-bom ### 📊 Changes **3 files changed** (+193 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `docs/modding.md` (+2 -1) 📝 `tests/test_leonida_mods.py` (+101 -0) 📝 `tools/leonida_mods.py` (+90 -12) </details> ### 📄 Description Claimed in the coordination issue as: MODS-MANIFEST-RUNTIME-RULES ### What and why The mod manager checks `mod.json` with its own copy of the rules in `runtime/src/mods.h` and that copy was behind. It did not read the `camera` section so `list` said that `mods/first_person` changes nothing and `check` passed camera values the runtime refuses. It refused a `mod.json` that starts with a UTF-8 byte-order mark although the runtime and `docs/modding.md` accept it. It also accepted `"archetype_swaps": null` which the runtime refuses. The manager now applies the same checks as `parse_mod` and `list` shows the camera each mod sets. ### Tested `python -I tests/test_leonida_mods.py` passes with 13 tests and 5 of them fail without the change. I compared the manager with `parse_mod` built from `runtime/src/mods.h` on 30,015 generated manifests. 17,256 decisions differed before and none after. Linux and Python 3.13. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [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. (n/a: no translator change) --- <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#1847
No description provided.