manifest: exclude a manifest spelled with another case (MANIFEST-WALK-CASE-EXCLUDE) #1441

Closed
Dashhhhhhhh wants to merge 0 commits from upstream-pr/1441 into main
Dashhhhhhhh commented 2026-11-25 00:18:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Dashhhhhhhh on 2026-11-25T00:18:41Z.


Claimed in the coordination issue as: MANIFEST-WALK-CASE-EXCLUDE

What and why

tools/manifest.py walk() decided the manifest was outside the game folder by comparing os.path.normcase(os.path.realpath()). That keeps the case you typed on macOS. A folder created as Game and --out game/MANIFEST.json are one file on APFS, so the next create treated the manifest as an input and refused to replace it, and verify listed it as NEW and then printed OK.

The scan now compares report_paths.path_key, which folds case on a volume that ignores it. Recreating a real manifest under the other spelling works. A hashed file under the other spelling is still refused, and a hard link to a hashed file is still refused. manifest_verifier.py has the same exclude key; pull requests #344 and #899 already edit that file, so this change leaves it alone.

Tested

python -I tests/test_manifest.py (42 tests) and python -I tests/test_report_paths.py (22 tests), on macOS APFS. The new tests exclude PKG/Manifest.json from a folder created as pkg, recreate that manifest, and refuse PKG/ROOT.DAT. No game files.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md (not a translator change).

Made with Cursor

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5482647351 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441). Originally posted by [Dashhhhhhhh](https://github.com/Dashhhhhhhh) on 2026-11-25T00:18:41Z. --- Claimed in the coordination issue as: MANIFEST-WALK-CASE-EXCLUDE ### What and why `tools/manifest.py` `walk()` decided the manifest was outside the game folder by comparing `os.path.normcase(os.path.realpath())`. That keeps the case you typed on macOS. A folder created as `Game` and `--out game/MANIFEST.json` are one file on APFS, so the next `create` treated the manifest as an input and refused to replace it, and `verify` listed it as `NEW` and then printed `OK`. The scan now compares `report_paths.path_key`, which folds case on a volume that ignores it. Recreating a real manifest under the other spelling works. A hashed file under the other spelling is still refused, and a hard link to a hashed file is still refused. `manifest_verifier.py` has the same exclude key; pull requests #344 and #899 already edit that file, so this change leaves it alone. ### Tested `python -I tests/test_manifest.py` (42 tests) and `python -I tests/test_report_paths.py` (22 tests), on macOS APFS. The new tests exclude `PKG/Manifest.json` from a folder created as `pkg`, recreate that manifest, and refuse `PKG/ROOT.DAT`. No game files. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [ ] A new translator rule is in the contract table of `docs/design.md` (not a translator change). Made with [Cursor](https://cursor.com)
tiguan26 commented 2026-11-25 03:54:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T03:54:53Z.

Review: APPROVED


Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Comparing through path_key folds case on a case-insensitive volume, where normcase(realpath()) keeps the typed case on macOS, so Game/manifest.json and game/manifest.json are now the same file for --exclude and for the output-inside-game-folder check.

AI-assisted (Claude).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6051631876 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#pullrequestreview-6051631876). Originally posted by [tiguan26](https://github.com/tiguan26) on 2026-11-25T03:54:53Z. **Review:** APPROVED --- Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Comparing through path_key folds case on a case-insensitive volume, where normcase(realpath()) keeps the typed case on macOS, so Game/manifest.json and game/manifest.json are now the same file for --exclude and for the output-inside-game-folder check. AI-assisted (Claude).
zmasi commented 2026-11-28 20:55:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T20:55:44Z.


#1441 | head 21227adbd6 (merged cleanly with main 1bc055e6c2) | python -I tests/test_manifest.py + simulated macOS APFS (sys.platform = "darwin", pathconf(_PC_CASE_SENSITIVE) = 0, posixpath.normcase, case-preserving realpath) over case-insensitive NTFS | red on main (APFS-style case-preserving realpath/normcase): FAILED (failures=1, errors=1) (Manifest.json stayed in walk(pkg, exclude=".../PKG/Manifest.json") and create refused replacement) | green on PR+main: 5/5 ManifestWalkTest OK under APFS-style case-preserving resolution + 42 ran, OK (skipped=1) natively on Windows 11 NTFS | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited tools/manifest.py and tests/test_manifest.py on Windows 11 NTFS, confirming path_key exclusion in walk() and _inside() prefix checking in create() pass all 41 Windows-applicable tests natively and resolve the case-preserving realpath/normcase failure mode from macOS APFS. (Non-blocking note: on a Linux case-folding mount such as vfat/exFAT/CIFS, report_paths.case_insensitive_volume returns False because it checks sys.platform != "darwin", so path_key alone would still keep case there unless paired with samefile/same_report_path.) Also verified tests/test_ci_registration.py (18 OK), tests/test_text_write_line_endings.py (3 OK), and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245647037 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#issuecomment-7245647037). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T20:55:44Z. --- #1441 | head 21227adbd6b1f9974d39534a14d86e6c2bbebe79 (merged cleanly with main 1bc055e6c2) | `python -I tests/test_manifest.py` + simulated macOS APFS (`sys.platform = "darwin"`, `pathconf(_PC_CASE_SENSITIVE) = 0`, `posixpath.normcase`, case-preserving `realpath`) over case-insensitive NTFS | red on main (APFS-style case-preserving `realpath`/`normcase`): `FAILED (failures=1, errors=1)` (`Manifest.json` stayed in `walk(pkg, exclude=".../PKG/Manifest.json")` and `create` refused replacement) | green on PR+main: `5/5` `ManifestWalkTest` `OK` under APFS-style case-preserving resolution + `42 ran, OK (skipped=1)` natively on Windows 11 NTFS | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited `tools/manifest.py` and `tests/test_manifest.py` on Windows 11 NTFS, confirming `path_key` exclusion in `walk()` and `_inside()` prefix checking in `create()` pass all 41 Windows-applicable tests natively and resolve the case-preserving `realpath`/`normcase` failure mode from macOS APFS. (Non-blocking note: on a Linux case-folding mount such as `vfat`/`exFAT`/`CIFS`, `report_paths.case_insensitive_volume` returns `False` because it checks `sys.platform != "darwin"`, so `path_key` alone would still keep case there unless paired with `samefile`/`same_report_path`.) Also verified `tests/test_ci_registration.py` (`18 OK`), `tests/test_text_write_line_endings.py` (`3 OK`), and `scripts/check_no_game_data.py`.
OreoFR commented 2026-11-28 21:50:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:50:55Z.


Verified by OreoFR

  • Base: main 3408969a7 + PR head 21227adbd
  • Test: python -I tests/test_manifest.py
  • Red on main: 42 OK (1 skipped)
  • Green with the PR: same
  • Verdict: NO RED
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246317392 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#issuecomment-7246317392). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:50:55Z. --- **Verified by OreoFR** - Base: main `3408969a7` + PR head `21227adbd` - Test: `python -I tests/test_manifest.py` - Red on main: 42 OK (1 skipped) - Green with the PR: same - Verdict: NO RED - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
TheGeogeo commented 2026-11-29 14:18:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:18:35Z.


Ready for testing: merges cleanly with main 3535eb5c4. Not in main yet: git cherry finds 1 commit(s) not there, and 5 of the 43 lines it adds are already present. No duplicate found: its claim MANIFEST-WALK-CASE-EXCLUDE appears in no other open pull request and in no main commit.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257202556 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#issuecomment-7257202556). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:18:35Z. --- Ready for testing: merges cleanly with `main` `3535eb5c4`. Not in `main` yet: `git cherry` finds 1 commit(s) not there, and 5 of the 43 lines it adds are already present. No duplicate found: its claim `MANIFEST-WALK-CASE-EXCLUDE` appears in no other open pull request and in no `main` commit. AI-assisted (Claude Code).
enlight3d commented 2026-11-29 15:29:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T15:29:12Z.


RUN comment, PR #1441 (manifest: exclude a manifest spelled with another case)

Heads: PR 21227adbd, main 91bab934d (local merge of the PR into it, not pushed).
Kind: Python (tools/manifest.py) + tests/test_manifest.py.

Commands (repo root):
python -I tests/test_manifest.py
python -I tests/test_report_paths.py, test_report_path_case.py, test_world_index.py, test_mask_channels.py (other tests that import manifest or report_paths)

RED: not reachable on Windows. With tools/manifest.py put back to the merge-base version and the tests kept, test_manifest.py still passes (42 tests, 1 skipped, an unrelated POSIX-backslash test). The three new tests run (not skipped: the volume ignores case) and pass without the fix: the bug is macOS-specific (os.path.normcase keeps case there, on Windows it lowercases, so the old normcase(realpath()) already matched). The red needs macOS.
GREEN at the PR head: test_manifest 42 OK (1 skipped), test_report_paths 22, test_report_path_case 4 (1 skipped), test_world_index 46, test_mask_channels 9.
GREEN merged into main: test_manifest 42 OK (1 skipped), test_report_paths 26, test_report_path_case 4 (1 skipped), test_world_index 47, test_mask_channels 13.
(tests/test_user_sgpr_census.py also mentions the module but needs pytest, which is not installed here; unrelated.)

Machine: Windows 11 Pro, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (uv build), run with python -I, one process per test file.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258126810 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#issuecomment-7258126810). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T15:29:12Z. --- RUN comment, PR #1441 (manifest: exclude a manifest spelled with another case) Heads: PR 21227adbd, main 91bab934d (local merge of the PR into it, not pushed). Kind: Python (tools/manifest.py) + tests/test_manifest.py. Commands (repo root): python -I tests/test_manifest.py python -I tests/test_report_paths.py, test_report_path_case.py, test_world_index.py, test_mask_channels.py (other tests that import manifest or report_paths) RED: not reachable on Windows. With tools/manifest.py put back to the merge-base version and the tests kept, test_manifest.py still passes (42 tests, 1 skipped, an unrelated POSIX-backslash test). The three new tests run (not skipped: the volume ignores case) and pass without the fix: the bug is macOS-specific (os.path.normcase keeps case there, on Windows it lowercases, so the old normcase(realpath()) already matched). The red needs macOS. GREEN at the PR head: test_manifest 42 OK (1 skipped), test_report_paths 22, test_report_path_case 4 (1 skipped), test_world_index 46, test_mask_channels 9. GREEN merged into main: test_manifest 42 OK (1 skipped), test_report_paths 26, test_report_path_case 4 (1 skipped), test_world_index 47, test_mask_channels 13. (tests/test_user_sgpr_census.py also mentions the module but needs pytest, which is not installed here; unrelated.) Machine: Windows 11 Pro, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (uv build), run with `python -I`, one process per test file.
MoonEyes commented 2026-11-29 17:09:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T17:09:12Z.


Tested 21227adbd merged (no commit) with main 4364a4fa6: Python 3.12, Windows 11 10.0.26300, CPU only.

  • python -I tests/test_manifest.py gives 42 tests OK (1 skipped) with this PR, and also with tools/manifest.py back to main. No red: which case fails without the fix?

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259464263 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#issuecomment-7259464263). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T17:09:12Z. --- Tested `21227adbd` merged (no commit) with `main` `4364a4fa6`: Python 3.12, Windows 11 10.0.26300, CPU only. - `python -I tests/test_manifest.py` gives 42 tests OK (1 skipped) with this PR, and also with `tools/manifest.py` back to `main`. No red: which case fails without the fix? AI-assisted (Claude Code).
aslan2142 commented 2026-12-01 11:41:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:41:37Z.

Review: APPROVED


Reviewed the diff against main: tools/manifest.py:72-120 cleanly switches _inside() and walk(..., exclude=...) to report_paths.path_key so case-variant paths on case-insensitive volumes are properly excluded/protected, with tests in tests/test_manifest.py. Clean-room verified. Approving; awaiting a green CI run before merge.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130515504 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#pullrequestreview-6130515504). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:41:37Z. **Review:** APPROVED --- Reviewed the diff against `main`: `tools/manifest.py:72-120` cleanly switches `_inside()` and `walk(..., exclude=...)` to `report_paths.path_key` so case-variant paths on case-insensitive volumes are properly excluded/protected, with tests in `tests/test_manifest.py`. Clean-room verified. Approving; awaiting a green CI run before merge. *(AI-assisted review.)*
MoonEyes commented 2026-12-02 10:32:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T10:32:12Z.


For information: this pull request is carried in #3087, which merges your head (your commits are kept) into current main, resolves the conflicts keeping both sides, and fixes the points raised in review here (details in its description). This one stays open until a maintainer decides; if you pick it up again, say so and the carry can be closed.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7342613447 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#issuecomment-7342613447). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T10:32:12Z. --- For information: this pull request is carried in #3087, which merges your head (your commits are kept) into current `main`, resolves the conflicts keeping both sides, and fixes the points raised in review here (details in its description). This one stays open until a maintainer decides; if you pick it up again, say so and the carry can be closed. AI-assisted (Claude Code, Claude Opus 5.5)
MoonEyes commented 2026-12-02 11:48:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T11:48:51Z.


Closing: this pull request no longer applies to current main (merge conflict in tools/manifest.py), and open pull requests that have fallen out of step with main are being closed so the list stays workable. Your work is not lost: it is carried in #3087
, which keeps your commits and resolves the conflict on current main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7344442904 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1441#issuecomment-7344442904). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T11:48:51Z. --- Closing: this pull request no longer applies to current `main` (merge conflict in `tools/manifest.py`), and open pull requests that have fallen out of step with `main` are being closed so the list stays workable. Your work is not lost: it is carried in #3087 , which keeps your commits and resolves the conflict on current `main`. AI-assisted (Claude Code).

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!1441
No description provided.