mask_channels: validate dimensions/buffers and --json paths, preserve symlinks and /dev/null (MASK-CHANNELS-VALIDATION-AND-ATOMIC-IO) #1597
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1597
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/mask-channels-validation-and-atomic-io"
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?
Pull request successfully merged and closed
Item:
MASK-CHANNELS-VALIDATION-AND-ATOMIC-IO(unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touchtools/mask_channels.py).Summary
blobs()(len(mask) == width * height) andchannel_counts()(len(rgba) == width * height * 4) so zero/negative/mismatched inputs raiseValueErrorinstead ofZeroDivisionErroror silently skewed statistics.--jsonbefore decoding the DDS texture: reject empty/whitespace strings (""," ") and trailing-separator directory paths (new_dir/).--jsonpublishing via_write_json_report(): resolve symlinks so symlinked report paths update their target in place, write non-regular targets (such as/dev/null) directly, check write permissions on existing regular files before staging, usereplace_retry.replacewithallow_nan=Falseand trailing\n, and publish before printing stdout.Verification
python3 -W error -I tests/test_mask_channels.py -v: 13/13 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/mask_channels.py tests/test_mask_channels.py: passed.python3 -m compileall -q tools/mask_channels.py tests/test_mask_channels.py: passed.tests/test_mask_channels.pyagainst unpatchedmain:tools/mask_channels.py):failures=10, errors=0across all 4 new regression tests.AI-assisted: yes
GPUs tested: none (CPU-only Python texture-mask analysis tool; synthetic RGBA8 DDS only, no game data)
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 18 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)