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

Open
opened 2026-11-26 20:21:21 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1436
Author: @Anonymous78e
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: tools/pe-inspect-shared-report-path


📝 Commits (1)

  • 76b5d19 pe_inspect: ask report_paths for the report-path guard (PE-INSPECT-SHARED-REPORT-PATH)

📊 Changes

2 files changed (+21 additions, -10 deletions)

View changed files

📝 tests/test_pe_inspect.py (+16 -0)
📝 tools/pe_inspect.py (+5 -10)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1436 **Author:** [@Anonymous78e](https://github.com/Anonymous78e) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `tools/pe-inspect-shared-report-path` --- ### 📝 Commits (1) - [`76b5d19`](https://github.com/ubiquitarianism/leonida/commit/76b5d1935429a2abe6fb14162cde1364a4a964c2) pe_inspect: ask report_paths for the report-path guard (PE-INSPECT-SHARED-REPORT-PATH) ### 📊 Changes **2 files changed** (+21 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_pe_inspect.py` (+16 -0) 📝 `tools/pe_inspect.py` (+5 -10) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1466
No description provided.