world_drawable_verify: deduplicate input manifests by file identity #466

Merged
EdenBendheim merged 1 commit from upstream-pr/466 into main 2026-11-24 08:53:46 +00:00
EdenBendheim commented 2026-11-24 05:50:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-11-24T05:50:06Z.


Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123318168

What changed

  • tools/world_drawable_verify.py: Deduplicate input manifests in first-seen order using os.fstat() on the opened file handle (closing stat-vs-open races), requiring both st_dev and st_ino to be non-zero and falling back to os.path.normcase(os.path.realpath(path)) when either is unavailable. Preserves upstream source-archive alias checks and keeps independently written identical-content manifests counted separately.
  • tests/test_world_drawable_verify.py: Synthetic tests covering repeated/relative paths, hard links, symlinks, independent identical-content files, zero st_dev/st_ino and normcase fallbacks, and input-order errors.

Testing & Disclosure

  • AI-assisted: Implemented with Codex (gpt-6.2-sol) and reviewed with Codex (gpt-6.2-astra).
  • Environment: macOS 27.3, Apple M1 Max, Python 3.14.3 (CPU-only, synthetic manifests, zero game data).
  • Verified on ubiquitarianism/leonida main (8f481cf16): test_world_drawable_verify*.py (16/16), compileall, check_no_game_data.py, LF check — all passed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5466875397 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/466). Originally posted by [EdenBendheim](https://github.com/EdenBendheim) on 2026-11-24T05:50:06Z. --- Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123318168 ### What changed - **`tools/world_drawable_verify.py`**: Deduplicate input manifests in first-seen order using `os.fstat()` on the opened file handle (closing stat-vs-open races), requiring both `st_dev` and `st_ino` to be non-zero and falling back to `os.path.normcase(os.path.realpath(path))` when either is unavailable. Preserves upstream source-archive alias checks and keeps independently written identical-content manifests counted separately. - **`tests/test_world_drawable_verify.py`**: Synthetic tests covering repeated/relative paths, hard links, symlinks, independent identical-content files, zero `st_dev`/`st_ino` and `normcase` fallbacks, and input-order errors. ### Testing & Disclosure - **AI-assisted:** Implemented with Codex (`gpt-6.2-sol`) and reviewed with Codex (`gpt-6.2-astra`). - **Environment:** macOS 27.3, Apple M1 Max, Python 3.14.3 (CPU-only, synthetic manifests, zero game data). - **Verified on `ubiquitarianism/leonida` `main` (`8f481cf16`):** `test_world_drawable_verify*.py` (16/16), `compileall`, `check_no_game_data.py`, LF check — all passed.
QemmHD commented 2026-11-24 08:53:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T08:53:43Z.


Merging. Why merged: the same manifest passed twice under different paths is counted once.
Why it's good: security-reviewed; on main 1c93c86: world_drawable tests 9 -> 16 (3 fail without the fix); repo-consistency set 563/563.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7126696372 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/466#issuecomment-7126696372). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T08:53:43Z. --- Merging. Why merged: the same manifest passed twice under different paths is counted once. Why it's good: security-reviewed; on main 1c93c86: world_drawable tests 9 -> 16 (3 fail without the fix); repo-consistency set 563/563. AI-assisted (Claude Code, Claude Opus 5.5).
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!466
No description provided.