pe_inspect: ask report_paths for the report-path guard (PE-INSPECT-SHARED-REPORT-PATH) #1436

Merged
Anonymous78e merged 1 commit from upstream-pr/1436 into main 2026-11-29 01:31:54 +00:00
Anonymous78e commented 2026-11-25 00:13:45 +00:00 (Migrated from github.com)

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.py carried a private same_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 use tools/report_paths.same_report_path instead of deriving the answer again. That helper also folds case on a case-insensitive macOS volume, where os.path.normcase keeps case and samefile cannot see a report that is not written yet.

This is the same change as the other *-SHARED-REPORT-PATH pull requests (#1430, #1435): import the shared helper, keep same_output_path as 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 main 1154976d4:

  • python -I tests/test_pe_inspect.py: 61 tests OK. The new test_case_only_spelling_of_a_missing_report_is_one_path runs and passes. One skip, which is unrelated: os.symlink needs a privilege on Windows.
  • python -I tests/test_report_paths.py: OK. python -I tests/test_ci_registration.py: OK.
  • python -m compileall -q on both files; python -I tools/pe_inspect.py --help runs; scripts/check_no_game_data.py on both files: clean.

GPUs tested: n/a

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5482598340 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1436). Originally posted by [Anonymous78e](https://github.com/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.py` carried a private `same_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 use `tools/report_paths.same_report_path` instead of deriving the answer again. That helper also folds case on a case-insensitive macOS volume, where `os.path.normcase` keeps case and `samefile` cannot see a report that is not written yet. This is the same change as the other `*-SHARED-REPORT-PATH` pull requests (#1430, #1435): import the shared helper, keep `same_output_path` as 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 `main` 1154976d4: - `python -I tests/test_pe_inspect.py`: 61 tests OK. The new `test_case_only_spelling_of_a_missing_report_is_one_path` runs and passes. One skip, which is unrelated: `os.symlink` needs a privilege on Windows. - `python -I tests/test_report_paths.py`: OK. `python -I tests/test_ci_registration.py`: OK. - `python -m compileall -q` on both files; `python -I tools/pe_inspect.py --help` runs; `scripts/check_no_game_data.py` on both files: clean. GPUs tested: n/a AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo
PierreEbele commented 2026-11-25 15:26:17 +00:00 (Migrated from github.com)

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. Ran python -I tests/test_pe_inspect.py on 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 predates 3a7b8b219, 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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7166841582 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1436#issuecomment-7166841582). Originally posted by [PierreEbele](https://github.com/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. Ran `python -I tests/test_pe_inspect.py` on 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 predates 3a7b8b219, 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
MoonEyes commented 2026-11-28 22:00:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T22:00:37Z.


TEST-WANTED | 2026-11-28 UTC | from: MoonEyes | to: any | AI-assisted: Claude Code (Claude Opus 5.5)
NEEDS:      macOS with a case-insensitive volume (default APFS) | ~5 min | game files: no
BUILD:      same tree for A and B: main c7753ed98; A = main with only tests/test_pe_inspect.py from this PR (76b5d1935), B = main + this PR
VARIABLE:   the PR's change to tools/pe_inspect.py | A = without | B = with
FIXED:      python -I tests/test_pe_inspect.py, from the repository root, on the case-insensitive volume
CACHES:     none
SEND BACK:  A and B: tests run, failures, errors, and the name of each failing test; macOS version and file system
PREDICTED:  A: the report-path guard test fails (the same path in another case gets past it); B: all pass
REFUTED IF: A passes, or B fails
EXPIRES:    2026-12-05 UTC

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 and DONE | <link> after (docs/agent_collaboration.md).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246431086 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1436#issuecomment-7246431086). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T22:00:37Z. --- ``` TEST-WANTED | 2026-11-28 UTC | from: MoonEyes | to: any | AI-assisted: Claude Code (Claude Opus 5.5) NEEDS: macOS with a case-insensitive volume (default APFS) | ~5 min | game files: no BUILD: same tree for A and B: main c7753ed98; A = main with only tests/test_pe_inspect.py from this PR (76b5d1935), B = main + this PR VARIABLE: the PR's change to tools/pe_inspect.py | A = without | B = with FIXED: python -I tests/test_pe_inspect.py, from the repository root, on the case-insensitive volume CACHES: none SEND BACK: A and B: tests run, failures, errors, and the name of each failing test; macOS version and file system PREDICTED: A: the report-path guard test fails (the same path in another case gets past it); B: all pass REFUTED IF: A passes, or B fails EXPIRES: 2026-12-05 UTC ``` 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 and `DONE | <link>` after (docs/agent_collaboration.md).
zmasi commented 2026-11-28 23:49:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:49:12Z.


#1436 | head 76b5d19354 (merged cleanly with main a9e247cd69) | python -I tests/test_pe_inspect.py -v + live Windows 11 NTFS case-alias, mklink /J directory-junction & hard-link same_output_path probe | red on main: tools/pe_inspect.py maintained a private normcase(realpath(...)) + samefile helper that missed case-only spellings of not-yet-written reports on POSIX-normcase case-insensitive volumes | green on PR+main: 78 ran, OK (skipped=1) (test_pe_inspect.py including test_case_only_spelling_of_a_missing_report_is_one_path), and live Windows 11 NTFS probe confirmed pe_inspect.same_output_path is report_paths.same_report_path across missing case-varied report paths (Reports\a.json vs reports\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: yes

Audited rebased head 76b5d19354 (tools/pe_inspect.py and tests/test_pe_inspect.py) merged cleanly onto main (a9e247cd69) on Windows 11 — first Windows verification report and first check of 76b5d19354 (complementing the macOS case-insensitive check requested in TEST-WANTED). Also verified scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247684434 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1436#issuecomment-7247684434). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:49:12Z. --- #1436 | head 76b5d1935429a2abe6fb14162cde1364a4a964c2 (merged cleanly with main a9e247cd69) | `python -I tests/test_pe_inspect.py -v` + live Windows 11 NTFS case-alias, `mklink /J` directory-junction & hard-link `same_output_path` probe | red on main: `tools/pe_inspect.py` maintained a private `normcase(realpath(...))` + `samefile` helper that missed case-only spellings of not-yet-written reports on POSIX-`normcase` case-insensitive volumes | green on PR+main: `78 ran, OK (skipped=1)` (`test_pe_inspect.py` including `test_case_only_spelling_of_a_missing_report_is_one_path`), and live Windows 11 NTFS probe confirmed `pe_inspect.same_output_path is report_paths.same_report_path` across missing case-varied report paths (`Reports\a.json` vs `reports\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: yes Audited rebased head `76b5d19354` (`tools/pe_inspect.py` and `tests/test_pe_inspect.py`) merged cleanly onto `main` (`a9e247cd69`) on Windows 11 — first Windows verification report and first check of `76b5d19354` (complementing the macOS case-insensitive check requested in `TEST-WANTED`). Also verified `scripts/check_no_game_data.py`.
enlight3d commented 2026-11-29 00:45:01 +00:00 (Migrated from github.com)

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

  • PR head: 76b5d19354 (base fac8b4bb90, not current main)
  • main: 1bc055e6c2 (the PR merges cleanly onto it: git merge-tree --write-tree reports 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_path
  • python -I tests/test_pe_inspect.py
  • python -I tests/test_report_paths.py, python -I tests/test_ci_registration.py

Red (the PR's tests/test_pe_inspect.py on top of main, tools/pe_inspect.py unchanged)

  • New test: ok (1 test, not skipped). It does NOT fail on main.
  • Whole file: 78 tests OK.
  • Reason: on Windows os.path.normcase already 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)

  • New test: ok (1 test, not skipped).
  • tests/test_pe_inspect.py: 78 tests OK.
  • tests/test_report_paths.py: 24 tests OK. tests/test_ci_registration.py: 16 tests OK.

Machine: NVIDIA GeForce RTX 3090 24 GB, driver 621.40 (GPU not used by these tests). Windows 11 Pro 10.0.26300.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248325178 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1436#issuecomment-7248325178). Originally posted by [enlight3d](https://github.com/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 - PR head: 76b5d1935429a2abe6fb14162cde1364a4a964c2 (base fac8b4bb903b6988bd616e8874e77fa026858ffb, not current main) - main: 1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3 (the PR merges cleanly onto it: `git merge-tree --write-tree` reports 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_path` - `python -I tests/test_pe_inspect.py` - `python -I tests/test_report_paths.py`, `python -I tests/test_ci_registration.py` Red (the PR's tests/test_pe_inspect.py on top of main, tools/pe_inspect.py unchanged) - New test: ok (1 test, not skipped). It does NOT fail on main. - Whole file: 78 tests OK. - Reason: on Windows `os.path.normcase` already 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) - New test: ok (1 test, not skipped). - tests/test_pe_inspect.py: 78 tests OK. - tests/test_report_paths.py: 24 tests OK. tests/test_ci_registration.py: 16 tests OK. Machine: NVIDIA GeForce RTX 3090 24 GB, driver 621.40 (GPU not used by these tests). Windows 11 Pro 10.0.26300.
OreoFR commented 2026-11-29 01:24:04 +00:00 (Migrated from github.com)

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248757404 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1436#issuecomment-7248757404). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T01:24:04Z. --- TAKEN | OreoFR (macOS 27.2.1, Apple M5, APFS case-insensitive) | ETA 02:15 UTC
OreoFR commented 2026-11-29 01:24:36 +00:00 (Migrated from github.com)

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.

  • PR head 76b5d1935, python -I tests/test_pe_inspect.py from the repository root.
  • Red (main + only tests/test_pe_inspect.py from this PR): 78 run, 1 failure, 1 skip. The new test fails with 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.
  • Green (main + git merge --no-ff of this PR, no conflict): 78 run, OK, 1 skip. MEASURED, 3 runs of the new test alone, 3/3 pass.
  • The skip on both sides is test_system_dll_is_classified_system ("system DLL classification needs Windows"); the new test runs on this volume, it is not skipped.
  • This answers the TEST-WANTED above: PREDICTED holds (A fails on the report-path guard test, B passes). Note: tested on current main 53b77df14, not c7753ed98.
  • Verdict: READY.

DONE | this comment. AI-assisted: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248763309 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1436#issuecomment-7248763309). Originally posted by [OreoFR](https://github.com/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. - PR head 76b5d1935, `python -I tests/test_pe_inspect.py` from the repository root. - Red (main + only tests/test_pe_inspect.py from this PR): 78 run, 1 failure, 1 skip. The new test fails with `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. - Green (main + `git merge --no-ff` of this PR, no conflict): 78 run, OK, 1 skip. MEASURED, 3 runs of the new test alone, 3/3 pass. - The skip on both sides is `test_system_dll_is_classified_system` ("system DLL classification needs Windows"); the new test runs on this volume, it is not skipped. - This answers the TEST-WANTED above: PREDICTED holds (A fails on the report-path guard test, B passes). Note: tested on current main 53b77df14, not c7753ed98. - Verdict: READY. DONE | this comment. AI-assisted: Claude Code (Claude Opus 5.5).
MoonEyes commented 2026-11-29 01:31:56 +00:00 (Migrated from github.com)

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 main 53b77df14 without conflict, and its test file(s) (tests/test_pe_inspect.py) pass there. Earlier today the same tests failed on main without the PR (red/green) and a bundle with other open PRs showed no new failures. check_no_game_data.py is clean. Windows 11, Python 3.14; no GPU needed for these tests.

AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248843510 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1436#issuecomment-7248843510). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T01:31:56Z. --- Merged after **OreoFR**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/1436#issuecomment-7248763309)) (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 `main` 53b77df14 without conflict, and its test file(s) (`tests/test_pe_inspect.py`) pass there. Earlier today the same tests failed on `main` without the PR (red/green) and a bundle with other open PRs showed no new failures. `check_no_game_data.py` is clean. Windows 11, Python 3.14; no GPU needed for these tests. _AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes._
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!1436
No description provided.