meshlet_page: ask report_paths for the report-path guard (carry of #1431) #3086
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3086"
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?
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T10:29:22Z.
Claimed in the coordination issue as: MESHLET-PAGE-SHARED-REPORT-PATH (the item ID the original author, Dashhhhhhhh, gave in the description of #1431)
What and why
Carry of #1431 (Dashhhhhhhh), unchanged since 2026-11-25 (last commit; no author push or comment after that). Branch = main + the author's head
ba4e7ef65(both commits kept) + conflict resolution + no further commits of mine.is_scanned_inputintools/meshlet_page.pydecided whether a report path is inside the carve folder withos.path.normcase(os.path.abspath()), which keeps the typed case on macOS. A page report underCARVE/for a folder created ascarvewas not seen as inside the folder. This branch compares the two withreport_paths.path_key, which folds case on a case-insensitive volume, and adds the author's two regression tests (test_json_cannot_create_the_manifest_under_another_case,test_json_cannot_replace_a_page_under_another_case_of_the_folder).The first half of #1431 (
same_output_pathdelegating toreport_paths.same_report_path) landed in main through #2639, which is what conflicted. The resolution keeps main's import header and itssame_output_path = same_report_pathalias and adds onlypath_key, as the review on #1431 asked. The import is a separate line,from report_paths import path_key, becausetests/test_report_paths.py(NoPrivateCopiesTests) asserts the exact textfrom report_paths import same_report_pathin each shared tool. Review defects: none found still present beyond that rebase request.Tested
Windows 11, no GPU, no game files, on main
a917c54d6plus this branch.python -I tests/test_meshlet_page.py: 75 tests, OK (both new tests ran, NTFS ignores case).python -I tests/test_report_paths.py: 26 tests, OK (1 skipped). A first merge that importedpath_keyin the same line assame_report_pathfailedNoPrivateCopiesTestshere; the split import fixes it.tools/meshlet_page.pyand the branch's tests,python -I tests/test_meshlet_page.pygives 75 tests, OK, because Windowsrealpath/normcasealready fold case. Simulated instead with a throw-away script outside the repository (not part of this PR) that makesos.path.normcasekeep case,os.path.realpathequalabspathandcase_insensitive_volumereturn True, then callsis_scanned_inputfor a foldercarvecontaining0000.bin: on main,CARVE/0000.binis not refused (False); on this branch it is refused (True).CARVE/index.jsonis refused on both in that simulation. OreoFR measured a real red on APFS for the manifest test in a comment on #1431; I did not reproduce that.python -I scripts/check_no_game_data.py tools/meshlet_page.py tests/test_meshlet_page.py: clean.Not run: the full suite, CI.
GPUs tested: n/a (unit tests only)
AI-assisted: yes. Models: Claude Opus 5.5 in Claude Code (carry, conflict resolution, fixes, tests); separate read-only reviewer agent: Claude Opus 5.5.
Checklist
mainand merges cleanly (merged with maina917c54d6; main may have moved since).docs/design.md, with how it was confirmed (not a translator change).Supersedes #1431 once merged; the original stays open until a maintainer decides.
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T12:25:00Z.
RUN (independent run on Windows, #3086 head
ec005f54a, merged locally intomain9b4d71899withgit merge --no-ff, no conflicts. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)ba4e7ef65is an ancestor of the head through the mergeb0e288218. Both of Dashhhhhhhh's commits (9cc9fded7,ba4e7ef65) are kept under their author's name.main'sfrom report_paths import same_report_pathline andsame_output_pathalias stay, andpath_keycomes in on its own import line.python -I tests/test_report_paths.pyon the merge gives 26 tests OK, includingNoPrivateCopiesTests.python -I tests/test_meshlet_page.py -v: main 73 tests OK; merge 75 tests OK. Both new tests ran here, since NTFS ignores case and neither skipped.python -m pytest tests/test_meshlet_page.py tests/test_report_paths.py tests/test_tool_stdout_encoding.py -q: main 103 passed; merge 105 passed.main'stools/meshlet_page.py, the pull request's 75 tests pass, because on Windowsntpath.normcasealready folds case.os.path.normcaseto keep case,os.path.realpathtoabspath, andreport_paths.case_insensitive_volumeto True. It then callsis_scanned_inputfor a foldercarveholding0000.bin:main:CARVE/0000.binnot refused (False).CARVE/index.jsonrefused.carve/0000.binrefused.CARVE/index.jsonis refused on both, so in this simulation the first new test would pass onmaintoo. The body mentions a real APFS red for it, which I could not check here.tools/meshlet_page.py, each run with the test file and the simulation, and restored afterwards (git statusclean):path_keyreplaced bymain'snormcase(abspath())inis_scanned_input: survives the test file on Windows. The simulation catches it:CARVE/0000.binis not refused again..binor.rpf" test replaced byTrue: killed (test_json_inside_carve_dir_can_be_written_and_replaced).if target != root and not target.startswith(prefix): return False): survives both. With this mutation, any existing.binanywhere would be refused as an input. That is an over-refusal, not a loss of data.prefix = root): survives both. A sibling folder likecarve2/would count as insidecarve, which is also an over-refusal. No test writes a report next to the carve folder under a name that shares its prefix.Not covered here: a real macOS or other case-insensitive, case-keeping volume. Only that kind of volume can show this pull request's red, and CI's jobs on the head do not include macOS. Linux was not run locally.
Verdict: PARTIAL. The change is right in the macOS simulation (
mainmissesCARVE/0000.bin, the merge refuses it), the merge keepsmain's shared-guard import asNoPrivateCopiesTestsrequires, and both of the author's commits are kept. But on Windows the two new tests pass withmain's tool and cannot catch the case-folding mutation, so the red still needs a run on APFS.Machine: Windows 11 Pro 26300 (NTFS), i9-13900K, 64 GB, CPython 3.13.12 (CI uses 3.12); unit tests only, no GPU or game files used.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:45:11Z.
Merging. Head
ec005f54amerges cleanly withmain23a51c494and does not force a rebase of #2566. Moon's own pull request, merged on green CI at his instruction. An independent read-only check by a separate agent on headec005f54afound every CI check green including no-game-data, no conflict with current main, no open review or unanswered question, and for a carry the original author's commits kept as ancestors. Merged by MoonEyes.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T12:55:28Z.
Ran natively on Windows 11, Python 3.13, head
ec005f54amerged into currentmain(23a51c494, no conflicts).py -3.13 -I tests/test_meshlet_page.py: 75 tests OK, as already reported.The body and the earlier run say there is no native red on Windows. There is one, just not through case: the PR also swaps
abspathforrealpath(insidepath_key), so a carve folder named through a junction or an 8.3 short name is now recognised too. Onmainboth spellings let--jsonoverwrite a page file. Throwaway folders, a 13-byte dummy0000.bin(not game data),tools/meshlet_page.pyswapped betweenmain's and the PR's in the merged tree:--jsonmainlink(junction toreal,mklink /J, no admin) /real/0000.bin0000.binreplaced by the JSON reporterror: --json would overwrite the input link, file intactCARVEP~1(8.3 name ofcarve pages long) /carve pages long/0000.bin0000.binreplacederror: --json would overwrite the input CARVEP~1, file intactSo the change fixes real data loss on Windows as well, not only on macOS. Neither new test covers it; a junction test would give the PR a red that runs on the Windows and Linux CI (a symlinked carve folder does the same on Linux).
Not checked: a real macOS volume, Linux, symlinks (need admin here).
GPUs tested: n/a (CPU-only tests).
AI-assisted: yes (Claude Code).