recomp_census: a wrong input is one ERROR line, not a traceback (RECOMP-CENSUS-WRONG-INPUT) #1088
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1088
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1088/head"
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?
@tiguan26 on GitHub · 2026-11-24 18:13 UTC · original
tiguan26:fix/recomp-census-wrong-input→main· +71 −7 · 2 files · 1 commits · merged 2026-11-24 22:19 UTCClaimed 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
@KernelSmoker on GitHub · 2026-11-24 18:33 UTC · original · approved these changes
Independently verified the wrong-input handling on head
4243713783cdda3acabc261c29c2d71bf416c3c1.tests/test_recomp_census.py: 11/11 passed.--outnaming a file each exited 2 with exactly oneERROR:line and no traceback.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 on GitHub · 2026-11-24 18:42 UTC · original · approved these changes
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 on GitHub · 2026-11-24 18:51 UTC · original · approved these changes
Clean-Room Audit — PR #1088 (
RECOMP-CENSUS-WRONG-INPUT)Clean error handling in
tools/recomp_census.pycatchingOSErroracross both input inspection and report output paths, printing one diagnosticERROR:line tostderrwith exit code 2. Solid unit test coverage intests/test_recomp_census.py::WrongInputTests; standard library only, 0 game data.Verdict: APPROVED
@tiguan26 on GitHub · 2026-11-24 18:58 UTC · original
@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.
@whoalin1 on GitHub · 2026-11-24 21:42 UTC · original
Verification (independent, AI-assisted — Devin worker agent, Windows 11, Python 3.14, no GPU needed):
Checked out head
4243713in a clean worktree.Unit tests
Manual wrong-input repros (CLI,
python -I tools/recomp_census.py):ERROR: [Errno 2] No such file or directory: ..., exit 2, no tracebackERROR: [Errno 13] Permission denied: ..., exit 2--outnaming an existing file (valid synthetic PE fixture) →ERROR: [WinError 183] Cannot create a file when that file already exists, exit 2; the existing file's contents were left untouchedgood.exe: 3 fns, 11 insns, 90.91% covered, 1 hazard kinds, exit 0, writes both.recomp.jsonand.recomp.mdBaseline comparison (
origin/maincopy oftools/recomp_census.py): missing image →FileNotFoundErrortraceback, confirming the fix changes the behavior as claimed.The new
WrongInputTestscover all three failure modes plus the happy path. No issues found.@QemmHD on GitHub · 2026-11-24 22:18 UTC · original
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
4a50cafc7. 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).