manifest: resolve the stored entry on Linux casefold directories #3138
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!3138
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/manifest-linux-casefold-alias"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: MANIFEST-LINUX-CASEFOLD-ALIAS
Depends on: #3087 (merged)
What and why
On a Linux directory with per-directory casefolding,
realpath()can preserve the requested spelling of an existing manifest. The directory scan then lists the manifest itself asNEW, andcreaterefuses to refresh it through that spelling.Compare directory identity for containment and resolve the manifest's actual entry in that directory. If multiple entries share an inode, the Linux descriptor path identifies the entry used by the lookup. A separate hard link stays visible to the existing overwrite guard.
Tested
python -I tests/test_manifest.py -vandpython -I tests/test_report_paths.py -von CachyOS (Linux 7.3.6, Python 3.14.10), using synthetic files on tmpfs. With per-directory casefold enabled, 70 passed and 2 skipped. On ordinary tmpfs, 66 passed and 6 skipped.NEWfor ASCII case, Unicode composition, and a default-ignorable character. The directory alias and separate hard-link cases also fail on the original code and pass with this change.tests/test_text_write_line_endings.py,scripts/check_no_game_data.py tools/manifest.py tests/test_manifest.py, andgit diff --checkpassed.GPUs tested: n/a (CPU only).
AI-assisted: OpenAI Codex with GPT-6.2, independently reviewed read-only by GPT-6.2 Sol.
Checklist
main(044339e4c).Verification — VERIFY-3138
python -I scripts/red_green.py 3138 --remote upstream --no-cargo; plus the PR'stests/test_manifest.pyrun standalone against (a) plain main code and (b) the PR head, in a scratch worktree_insidenow resolves by inode walk (samestat up the ancestors) instead of case-folded path prefixes; new_manifest_entryfinds the stored entry by inode (with the /proc/self/fd O_PATH disambiguation for hard links) sowalkexcludes the manifest itself under any alias spelling. The logic reads sound and matches the stated follow-up on #3087; no game data, one topic, claim in placeAI-assisted: yes (Muse Wonder, Muse by Meta)
Thanks for the independent check. I reran the PR’s exact
tests/test_manifest.pyon currentmain(acc350745) and on the clean merge ofac2ea358, using the same Linux casefold filesystem for both runs.On CachyOS 7.3.6 with Python 3.14.10, I used a private mount namespace (
unshare -Ur -m), mounted a freshtmpfswith-o casefold, setchattr +Fon its empty root, and used it asTMPDIR. A differently cased lookup of a probe file confirmed actual casefolding before the tests ran.mainreproduced five failures and one error across 46 tests. Plain case differences, decomposed Unicode and the default-ignorable character caused the manifest to appear asNEW. The fallback scan also included the manifest itself when it had another hard link. With the PR, 45 manifest tests and 25 path-reporting tests passed. Each suite had one expected skip, and both of the casefold tests that skipped in your run passed here. AI-assisted with OpenAI Codex.Merging. Head
ac2ea358emerges cleanly withmain83046a713and does not force a rebase of #2566. Independent check on head ac2ea358e: aegish-zagi's verification on this head (green on the merge plus a code audit; red not constructible on their case-sensitive filesystem), comment 7348833570; CI green incl. no-game-data; no open review or question. Merged by MoonEyes.AI-assisted (Claude Code).