pe_inspect: ask report_paths for the report-path guard (PE-INSPECT-SHARED-REPORT-PATH) #1436
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1436"
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 Anonymous78e on 2026-11-25T00:13:45Z.
Claimed in the coordination issue as: PE-INSPECT-SHARED-REPORT-PATH (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148263980)
What and why
tools/pe_inspect.pycarried a privatesame_output_path(realpath, normcase, then samefile). It uses this at the two checks that keep one image's JSON or Markdown report from overwriting another's. CONTRIBUTING asks a report writer to usetools/report_paths.same_report_pathinstead of deriving the answer again. That helper also folds case on a case-insensitive macOS volume, whereos.path.normcasekeeps case andsamefilecannot see a report that is not written yet.This is the same change as the other
*-SHARED-REPORT-PATHpull requests (#1430, #1435): import the shared helper, keepsame_output_pathas its alias so callers and tests are unchanged, and drop the private copy. The added test checks that a case-only spelling of a missing report is one path; it skips on a case-sensitive volume.Tested
Windows 11 Pro 26H2, CPython 3.13.15, on
main1154976d4:python -I tests/test_pe_inspect.py: 61 tests OK. The newtest_case_only_spelling_of_a_missing_report_is_one_pathruns and passes. One skip, which is unrelated:os.symlinkneeds a privilege on Windows.python -I tests/test_report_paths.py: OK.python -I tests/test_ci_registration.py: OK.python -m compileall -qon both files;python -I tools/pe_inspect.py --helpruns;scripts/check_no_game_data.pyon both files: clean.GPUs tested: n/a
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T15:26:17Z.
Reviewed
7915917f3: pe_inspect's overwrite guard now aliases tools/report_paths.same_report_path instead of its private realpath/normcase/samefile copy; the tools/ sys.path.insert the import needs shadows nothing and the importers' suites still pass. Ranpython -I tests/test_pe_inspect.pyon both trees (61 tests, 2 skips - one is the new test skipping itself, "volume keeps case", on this case-sensitive arm64 Linux volume), tests/test_report_paths.py, tests/test_report_path_case.py, the importer suites, and a probe on both: on a simulated case-insensitive volume the PR folds case and NFC/NFD accents for not-yet-written reports where main answers "two paths"; identity, distinct files, hard links and the case-sensitive answers are unchanged. Note: the branch predates3a7b8b219, so its test file is not on current main; I ran the merged file/code on main and the full suite passes - a rebase would only keep the diff reviewable. No findings; no game data touched.AI-assisted review.
Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T22:00:37Z.
On Windows (RTX 3090, driver 621.40) enlight3d measured it green at this PR's head, but red cannot be shown there: Windows already folds the case of paths. Answer with
TAKEN | <handle> | ETA <time UTC>before starting andDONE | <link>after (docs/agent_collaboration.md).Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:49:12Z.
#1436 | head
76b5d19354(merged cleanly with maina9e247cd69) |python -I tests/test_pe_inspect.py -v+ live Windows 11 NTFS case-alias,mklink /Jdirectory-junction & hard-linksame_output_pathprobe | red on main:tools/pe_inspect.pymaintained a privatenormcase(realpath(...))+samefilehelper that missed case-only spellings of not-yet-written reports on POSIX-normcasecase-insensitive volumes | green on PR+main:78 ran, OK (skipped=1)(test_pe_inspect.pyincludingtest_case_only_spelling_of_a_missing_report_is_one_path), and live Windows 11 NTFS probe confirmedpe_inspect.same_output_path is report_paths.same_report_pathacross missing case-varied report paths (Reports\a.jsonvsreports\A.JSON), missing reports through an NTFS directory junction (mklink /J), and existing NTFS hard links | Windows 11 (10.0.26200.9974), Python 3.12.10, NTFS | AI-assisted: yesAudited rebased head
76b5d19354(tools/pe_inspect.pyandtests/test_pe_inspect.py) merged cleanly ontomain(a9e247cd69) on Windows 11 — first Windows verification report and first check of76b5d19354(complementing the macOS case-insensitive check requested inTEST-WANTED). Also verifiedscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:45:01Z.
RUN: red/green check of #1436 on Windows (NTFS, case-insensitive: the new test runs, it is not skipped)
Heads tested
76b5d19354(basefac8b4bb90, not current main)1bc055e6c2(the PR merges cleanly onto it:git merge-tree --write-treereports no conflict)Commands (from the repo root, CPython 3.13.12)
python -I tests/test_pe_inspect.py -v PeInspectTest.test_case_only_spelling_of_a_missing_report_is_one_pathpython -I tests/test_pe_inspect.pypython -I tests/test_report_paths.py,python -I tests/test_ci_registration.pyRed (the PR's tests/test_pe_inspect.py on top of main, tools/pe_inspect.py unchanged)
os.path.normcasealready folds case, so main's private same_output_path already treats the two spellings as one path. The bug the PR describes (normcase keeps case, samefile cannot see a missing report) exists on a case-insensitive macOS volume, which this machine does not have. So this run cannot show red.Green (PR head)
Machine: NVIDIA GeForce RTX 3090 24 GB, driver 621.40 (GPU not used by these tests). Windows 11 Pro 10.0.26300.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T01:24:04Z.
TAKEN | OreoFR (macOS 27.2.1, Apple M5, APFS case-insensitive) | ETA 02:15 UTC
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T01:24:36Z.
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main
53b77df14: red 1 failure (test_case_only_spelling_of_a_missing_report_is_one_path) / green 78 OK.76b5d1935,python -I tests/test_pe_inspect.pyfrom the repository root.AssertionError: False is not true: on main, a case-only spelling of a missing report is seen as another path. MEASURED, 3 runs of the test alone, 3/3 fail.git merge --no-ffof this PR, no conflict): 78 run, OK, 1 skip. MEASURED, 3 runs of the new test alone, 3/3 pass.test_system_dll_is_classified_system("system DLL classification needs Windows"); the new test runs on this volume, it is not skipped.53b77df14, notc7753ed98.DONE | this comment. AI-assisted: Claude Code (Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T01:31:56Z.
Merged after OreoFR's red/green check (check) (macOS 27.2.1, Apple M5, APFS case-insensitive, Python 3.12) and a local re-check here. Merged after local re-verification: this PR merged onto
main53b77df14without conflict, and its test file(s) (tests/test_pe_inspect.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.