mods: report swap conflicts in JSON and add check --strict (MODS-CONFLICT-REPORTING) #729

Manually merged
github merged 1 commit from gh-pr/729/head into gh-pr/729/base 2026-11-26 09:18:25 +00:00
Owner

@⁠promise-ssss on GitHub · 2026-11-24 13:00 UTC · original
promise-ssss:feat/mods-conflict-reporting → main · +98 −14 · 2 files · 1 commits · merged 2026-11-25 21:05 UTC

Claimed in the coordination issue as: MODS-CONFLICT-REPORTING

What and why

ools/leonida_mods.py already detected enabled archetype swap overrides in its plain-text print_report(), but 

eport_json() omitted override/conflict metadata and check had no strict mode to fail on warnings or swap conflicts.

This extracts a shared swap_conflicts(mods) helper used by print_report(),
eport_json(), and check --strict:

  • list --json and check --json now include overrides on overridden swap entries and a top-level conflicts list.
  • check --strict exits with code 1 when any manifest has warnings or any enabled swap conflicts with an earlier one in load order.
  • Added unit tests in ests/test_leonida_mods.py.

Tested

  • python -I tests/test_leonida_mods.py -v: 12/12 passed (0.073 s)
  • python -I scripts/check_no_game_data.py tools/leonida_mods.py tests/test_leonida_mods.py: passed
  • python -m compileall -q tools/leonida_mods.py tests/test_leonida_mods.py: clean

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)
**@⁠promise-ssss** on GitHub · 2026-11-24 13:00 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/729) `promise-ssss:feat/mods-conflict-reporting` → `main` · +98 −14 · 2 files · 1 commits · merged 2026-11-25 21:05 UTC Claimed in the coordination issue as: MODS-CONFLICT-REPORTING ### What and why ools/leonida_mods.py already detected enabled archetype swap overrides in its plain-text print_report(), but eport_json() omitted override/conflict metadata and check had no strict mode to fail on warnings or swap conflicts. This extracts a shared swap_conflicts(mods) helper used by print_report(), eport_json(), and check --strict: - list --json and check --json now include overrides on overridden swap entries and a top-level conflicts list. - check --strict exits with code 1 when any manifest has warnings or any enabled swap conflicts with an earlier one in load order. - Added unit tests in ests/test_leonida_mods.py. ### Tested - `python -I tests/test_leonida_mods.py -v`: 12/12 passed (0.073 s) - `python -I scripts/check_no_game_data.py tools/leonida_mods.py tests/test_leonida_mods.py`: passed - `python -m compileall -q tools/leonida_mods.py tests/test_leonida_mods.py`: clean 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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:18:24 +00:00
github manually merged commit 72e8616468 into gh-pr/729/base 2026-11-26 09:18:25 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 13:15 UTC · original · approved these changes

LGTM. Excellent addition to leonida_mods.py: detects archetype swap conflicts across enabled mods, surfaces overrides in JSON and human-readable output, and adds --strict mode to check. Solid tests in est_leonida_mods.py.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 13:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/729#pullrequestreview-6039833994) · **approved these changes** LGTM. Excellent addition to leonida_mods.py: detects archetype swap conflicts across enabled mods, surfaces overrides in JSON and human-readable output, and adds --strict mode to check. Solid tests in est_leonida_mods.py.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 21:05 UTC · original

Merged, thanks! The new test fails on main and passes with this.

  • Checked on main ae1b48288 + 72e861646: the semantic suite passes (491 files, 6,312 tests, 0 files failed); test_leonida_mods pass; the 15 docs and writer tests pass; check_no_game_data.py is clean on the 2 changed files.

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

**@⁠aslan2142** on GitHub · 2026-11-25 21:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/729#issuecomment-7174606221) Merged, thanks! The new test fails on `main` and passes with this. - **Checked on `main` `ae1b48288` + `72e861646`:** the semantic suite passes (491 files, 6,312 tests, 0 files failed); `test_leonida_mods` pass; the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 2 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.