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

Open
github-bot wants to merge 1 commit from github-bot/gh-1436 into main AGit
Owner

@⁠Anonymous78e on GitHub · 2026-11-25 00:13 UTC · original
Anonymous78e:tools/pe-inspect-shared-report-path → main · +21 −10 · 2 files · 1 commits · open

Claimed in the coordination issue as: PE-INSPECT-SHARED-REPORT-PATH (#14)

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

**@⁠Anonymous78e** on GitHub · 2026-11-25 00:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1436) `Anonymous78e:tools/pe-inspect-shared-report-path` → `main` · +21 −10 · 2 files · 1 commits · open Claimed in the coordination issue as: PE-INSPECT-SHARED-REPORT-PATH (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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
tools/pe_inspect.py carried a private same_output_path (realpath + normcase +
samefile). CONTRIBUTING asks report writers to use
tools/report_paths.same_report_path, which also folds case on a
case-insensitive macOS volume where normcase does not, and samefile cannot see
a report that is not written yet. same_output_path stays as its alias.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:51:24 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 15:26 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 15:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1436#issuecomment-7166841582) 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
github-bot force-pushed github-bot/gh-1436 from 7915917f3f to 76b5d19354 2026-11-27 00:35:51 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1436/head:github-bot/gh-1436'
git switch 'github-bot/gh-1436'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1436'
git switch 'github-bot/gh-1436'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1436'
git switch 'github-bot/gh-1436'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1436'
git switch 'main'
git merge --squash 'github-bot/gh-1436'
git switch 'main'
git merge --ff-only 'github-bot/gh-1436'
git switch 'main'
git merge 'github-bot/gh-1436'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.