Skip to content

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

Open
Dashhhhhhhh wants to merge 1 commit into
ProjectLeonida:mainfrom
Dashhhhhhhh:fix/manifest-walk-case-exclude
Open

Dashhhhhhhh wants to merge 1 commit into
ProjectLeonida:mainfrom
Dashhhhhhhh:fix/manifest-walk-case-exclude

Conversation

@Dashhhhhhhh

Copy link
Copy Markdown
Contributor

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

normcase(realpath()) kept Game and game apart on macOS, so the next create treated the manifest as an input and verify listed it as new. The scan now uses the shared path key, which folds that case, and a hashed file under the other spelling is still refused.

Co-authored-by: Cursor <cursoragent@cursor.com>

@tiguan26 tiguan26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

#1441 | head 21227ad (merged cleanly with main 1bc055e) | 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

OreoFR commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants