Repository navigation
recomp_census: a wrong input is one ERROR line, not a traceback (RECOMP-CENSUS-WRONG-INPUT) - #1088
Conversation
…MP-CENSUS-WRONG-INPUT) A missing image (FileNotFoundError), a folder for the image (IsADirectoryError) and an --out that names an existing file (FileExistsError from os.makedirs) stopped the tool with a traceback. Each now prints one ERROR line and exits 2, like tools/navmesh_nodes.py. A PE that is not x86-64 keeps its current message and exit code. The docstring named the reports <file>.json and <file>.md; the tool writes <file>.recomp.json and <file>.recomp.md. Synthetic tests only, on the byte-built PE fixture; no game files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
64e789a to
4243713
Compare
KernelSmoker
left a comment
There was a problem hiding this comment.
Independently verified the wrong-input handling on head 4243713783cdda3acabc261c29c2d71bf416c3c1.
tests/test_recomp_census.py: 11/11 passed.- Startup 2/2, text line endings 3/3, stdout encoding 4/4, docs links 16/16 passed.
- End-to-end CLI subprocesses for missing input, directory input, and
--outnaming a file each exited 2 with exactly oneERROR:line and no traceback. - Replaced the patched tool temporarily with the base-commit version: the three new wrong-input tests failed with the corresponding OSError exceptions; restored the PR source and verified the suite green.
- No-game-data check and whitespace/line-ending checks passed. The PE fixture is synthetic; no game files or GPU used.
One coordination note: the PR body says this item was claimed, but I could not find a matching claim comment from the author in the current coordination issue #14 history. Please add or link it so the task ledger remains accurate; I found no overlapping PR or change in intervening main commits.
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Audited and verified. Handles OSError cleanly in ools/recomp_census.py when encountering missing or invalid image paths or unwritable destination directories, printing a single ERROR: ... line to stderr and exiting with status 2 without Python tracebacks. Unit tests in ests/test_recomp_census.py pass cleanly. Approved.
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Clean-Room Audit — PR #1088 (RECOMP-CENSUS-WRONG-INPUT)
Clean error handling in tools/recomp_census.py catching OSError across both input inspection and report output paths, printing one diagnostic ERROR: line to stderr with exit code 2. Solid unit test coverage in tests/test_recomp_census.py::WrongInputTests; standard library only, 0 game data.
Verdict: APPROVED
|
@KernelSmoker thanks for checking. The claim is in #14, collapsed in the middle of the thread: claiming: RECOMP-CENSUS-WRONG-INPUT, posted before this PR opened, and the done note. I've also linked it from the PR description. |
|
Verification (independent, AI-assisted — Devin worker agent, Windows 11, Python 3.14, no GPU needed): Checked out head Unit tests Manual wrong-input repros (CLI,
Baseline comparison ( The new |
|
Merging. Why merged: RECOMP-CENSUS-WRONG-INPUT: recomp_census reports a wrong input, or an --out it can't write, as one ERROR line with exit 2 instead of a traceback. KernelSmoker and whoalin1 checked it. Why it's good: test_recomp_census: 11/11. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 4a50caf. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new subprocesses, new env vars or CI changes. AI-assisted (Claude Code, Claude Opus 5.5). |
Claimed in the coordination issue as: RECOMP-CENSUS-WRONG-INPUT (claim, done)
What and why
tools/recomp_census.pystopped with a traceback on a wrong input:FileNotFoundError),IsADirectoryError),--outnaming an existing file (FileExistsErrorfromos.makedirs).Each now prints one
ERROR: ...line and exits 2, liketools/navmesh_nodes.pyand the three tools in #952 (which does not touch this one). A PE that is not x86-64 or has no MZ header keeps its current message and exit code 1.The module docstring said the tool writes
<out>/<file>.jsonand<out>/<file>.md; it writes<file>.recomp.jsonand<file>.recomp.md, so that line is corrected.Tested
On Linux (Python 3.13.18), from the checkout root on
main3aa9754:python -I tests/test_recomp_census.py: 11 tests pass. The four new ones (WrongInputTests) use the byte-built PE fixture already in the file; the three wrong-input cases fail against the tool onmainand pass with the fix, and the fourth checks a good image still writes both reports.tests/test_tool_startup.py,tests/test_text_write_line_endings.py,tests/test_tool_stdout_encoding.py,tests/test_docs_links.py: pass.python -m compileall -q tools tests,python -I scripts/check_no_game_data.pyon both files,git diff --check: clean.Not run on real game files; the normal output is unchanged.
GPUs tested: n/a (no GPU code changed)
AI-assisted: yes (Claude)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code