Repository navigation
Conversation
…ect non-string stage, skip .s dirs
|
Tested ce33d28 merged onto main 8575d36 on Windows 11 Pro, Intel i7-14700KF, CPython 3.11.0 (stdlib only for these tests), CPU only: pass.
Review notes (none blocking):
AI-assisted (Claude Code). |
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
Independent Windows CPU verification at ce33d28befa6899624d526d3477cf8aa3809323c.
Environment & Test Suite
- Platform: Native Windows 11 x64, Python 3.12 / 3.13, CPU-only.
- Clean-room: Pure synthetic test fixtures only, zero game data (
scripts/check_no_game_data.pypasses with exit 0).
Verification
python -I tests/test_op_reach.pyran 15 tests, OK (1.28s) — includes coverage for UTF-8 BOM index, non-string stages,.sdirectories ignored incensus(), pre-scan--jsonvalidation (collision with--index, listings, sidecars, folder/empty path), atomic write with pinned LF line endings, and tempfile cleanup on failure.python -I tests/test_report_paths.pyran 22 tests, OK (10.17s).- Line ending check: AST scan confirmed zero unpinned writes in
tools/op_reach.py. python -I -m compileall tools/op_reach.py tests/test_op_reach.py: clean, exit 0.git diff --check: clean (0).
LGTM. Approved.
|
Tested ce33d28 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
|
Tested
Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047. |
Claimed in the coordination issue as: #7049 (comment)
What and why
Hardens
tools/op_reach.pyinput/output handling so invalid inputs fail cleanly in oneERROR:line before scanning all 26,503 listings, and prevents--jsonfrom clobbering input files:--jsonvalidation (_validate_json_out): before callingstages_of()/census(), refuses an empty--jsonpath, a folder / trailing-separator target, a missing or non-folder parent, a collision with--index(viareport_paths.same_report_path), or a target resolving to a.slisting indisasmor a.fssmsidecar in--fssm. Previously--json index.jsonran the full scan and silently overwrote the carve index, and bad--jsontargets were only caught after scanning the entire corpus.stagetype validation instages_of(): readsindex.jsonwithutf-8-sig(handling PowerShell 5.1 BOM files) and rejects non-stringstagevalues withValueErrorinstead of crashingcensus()with an uncaughtTypeErrortraceback (unhashable typeon lists/dicts or<comparison failure on ints)..ssubdirectories incensus(): checksos.path.isfile(...)when collecting*.sfiles so a stray subfolder ending in.sdoes not fail withIsADirectoryError._write_json_atomic): writes to a sibling temp file withnewline=\n, adds a trailing\n, atomically replaces the target viaos.replace, and unlinks the temp file on failure.Scope intentionally leaves
if __name__ == __main__:untouched to avoid colliding with #7184 / #7174.Tested
Windows 11 x64, CPU only (no GPU, no game files), rebased onto
upstream/main8575d36ed:python -I -W default tests/test_op_reach.py -v(Python 3.14.7): 15/15 OK (10 existing + 5 new regression tests covering UTF-8 BOM index, non-string stages,.ssubdirectories, pre-scan--jsoncollision/folder/empty/missing-parent rejection, LF ending and temp cleanup on replace error)python -I -W default tests/test_op_reach.py -v(Python 3.11.9): 15/15 OKpython -I tests/test_report_paths.py: 22 ran, OK (1 skipped)python -m compileall -q tools/op_reach.py tests/test_op_reach.py: exit 0python -I tests/test_text_write_line_endings.py:tools/op_reach.pyhas zero unpinned writespython -I scripts/check_no_game_data.py: exit 0AI-assisted: yes (Antigravity)
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)