wave64_graphics_scan: harden --out guards, OSError privacy, atomic JSON, and tie-breaking (WAVE64-GRAPHICS-SCAN-CLI-AND-IO) #1582

Merged
leonida/mandy
quietfold merged 1 commit from fix/wave64-graphics-scan-cli-and-io into main 2026-11-28 10:55:00 +00:00

Pull request successfully merged and closed

quietfold commented 2026-11-25 05:05:35 +00:00

Item: WAVE64-GRAPHICS-SCAN-CLI-AND-IO (unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touch tools/wave64_graphics_scan.py).

Summary

  • Reject empty or whitespace-only --out values instead of silently skipping --out "" or creating a whitespace-named file for --out " ", and validate the resolved symlink target's parent directory before scanning.
  • Catch OSError when enumerating/reading shader listings or writing --out and exit cleanly with code 2, stripping scanned shader filenames from error details so names stay inside the work folder.
  • Publish --out JSON atomically via file_mode.published_mode + replace_retry.replace with allow_nan=False and a trailing \n before printing stdout, preserving any existing report on write failure and leaving non-regular targets (e.g. /dev/null) intact.
  • Break equal-count ties alphabetically ((-count, op)) in occurrences and mask_word_source for deterministic JSON and console output.

Verification

  • python3 -W error -I tests/test_wave64_graphics_scan.py -v: 24/24 passed.
  • python3 -I tests/test_text_write_line_endings.py: 3/3 passed.
  • python3 -I scripts/check_no_game_data.py tools/wave64_graphics_scan.py tests/test_wave64_graphics_scan.py: passed.
  • python3 -m compileall -q tools/wave64_graphics_scan.py tests/test_wave64_graphics_scan.py: passed.
  • Mutation check (running the new test suite against unpatched main:tools/wave64_graphics_scan.py): failures=5, errors=3 across all new assertions.

AI-assisted: yes
GPUs tested: none (CPU-only Python tool; synthetic fixtures only, no game data)

Item: `WAVE64-GRAPHICS-SCAN-CLI-AND-IO` (unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touch `tools/wave64_graphics_scan.py`). ### Summary - Reject empty or whitespace-only `--out` values instead of silently skipping `--out ""` or creating a whitespace-named file for `--out " "`, and validate the resolved symlink target's parent directory before scanning. - Catch `OSError` when enumerating/reading shader listings or writing `--out` and exit cleanly with code 2, stripping scanned shader filenames from error details so names stay inside the work folder. - Publish `--out` JSON atomically via `file_mode.published_mode` + `replace_retry.replace` with `allow_nan=False` and a trailing `\n` before printing stdout, preserving any existing report on write failure and leaving non-regular targets (e.g. `/dev/null`) intact. - Break equal-count ties alphabetically (`(-count, op)`) in `occurrences` and `mask_word_source` for deterministic JSON and console output. ### Verification - `python3 -W error -I tests/test_wave64_graphics_scan.py -v`: 24/24 passed. - `python3 -I tests/test_text_write_line_endings.py`: 3/3 passed. - `python3 -I scripts/check_no_game_data.py tools/wave64_graphics_scan.py tests/test_wave64_graphics_scan.py`: passed. - `python3 -m compileall -q tools/wave64_graphics_scan.py tests/test_wave64_graphics_scan.py`: passed. - Mutation check (running the new test suite against unpatched `main:tools/wave64_graphics_scan.py`): `failures=5, errors=3` across all new assertions. AI-assisted: yes GPUs tested: none (CPU-only Python tool; synthetic fixtures only, no game data)
copilot-pull-request-reviewer[bot] reviewed 2026-11-25 05:05:43 +00:00
copilot-pull-request-reviewer[bot] left a comment
No description provided.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
GeorgiyDemo commented 2026-11-25 05:20:07 +00:00

Tested 7817a454a on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main c7e82e26e (Python tool; no GPU):

  • pytest 9.2.0 on tests/test_wave64_graphics_scan.py: 24 passed, 2 subtests passed at this head.
  • The same file on main: 8 failed, 18 passed — the --out guards, atomic write and the unreadable-listing/name-leak handling are not there.
  • Not run: the scan against real shader listings; only the synthetic tests.

AI-assisted; synthetic fixtures only, no game data.

Tested `7817a454a` on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against `main` `c7e82e26e` (Python tool; no GPU): - pytest 9.2.0 on `tests/test_wave64_graphics_scan.py`: **24 passed, 2 subtests passed** at this head. - The same file on `main`: **8 failed**, 18 passed — the `--out` guards, atomic write and the unreadable-listing/name-leak handling are not there. - Not run: the scan against real shader listings; only the synthetic tests. AI-assisted; synthetic fixtures only, no game data.
sodove commented 2026-11-28 10:44:35 +00:00

#1582 | head 7817a454aec547f40d3bbb9723b20c0766cf9db8 | python3 -I tests/test_wave64_graphics_scan.py -v | red: 24 run, 5 failures, 3 errors | green: 24 passed | Red → green

The CLI tests exercised output-path validation, failed writes and atomic publication of the scan report.

Base 3bd936ecd98995bca3e1da83d5e28d2343001aef was merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. Batch claim.

#1582 | head `7817a454aec547f40d3bbb9723b20c0766cf9db8` | `python3 -I tests/test_wave64_graphics_scan.py -v` | red: 24 run, 5 failures, 3 errors | green: 24 passed | **Red → green** The CLI tests exercised output-path validation, failed writes and atomic publication of the scan report. Base `3bd936ecd98995bca3e1da83d5e28d2343001aef` was merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. [Batch claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7237873883).
MoonEyes commented 2026-11-28 10:54:57 +00:00

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 19 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18). Targeted batch of 19 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.