pknorm_probe: harden CLI parsing, hw oracle validation, and error lifecycle #1675
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!1675
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pknorm-probe-cli-and-oracle"
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 ID:
PKNORM-PROBE-CLI-AND-ORACLE(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156255931)Summary
tools/pknorm_probe.py):run_hw(), validate thatoracle.run()returns alist/tuplematchinglen(case_list)and that every non-string entry is a non-emptylist/tuplewhose first element is anint(notbool), preventing false passes on empty/short sweep outputs (zip()truncation) and uncaughtIndexError/TypeErroron malformed payloads.runner.Unavailable(exit77) andRuntimeError(exit2) raised duringoracle.run()insidetry ... finally: oracle.close().--hw-archand empty/trailing-comma--oracletokens ("","hw,",",translator") with argparse exit code2.tests/test_pknorm_probe.py):CliAndOracleTestscovering malformed/empty CLI flags, empty/short/long/malformed oracle payloads, string rejection entries,runner.Unavailable-> exit77, andRuntimeError-> exit2, verifyingoracle.close()on every path.Checklist & Verification
python3 -I scripts/check_no_game_data.py tools/pknorm_probe.py tests/test_pknorm_probe.pypassed)python3 -W error -I tests/test_pknorm_probe.py -v:Ran 6 tests ... OKtests/test_pknorm_probe.pyagainst unpatchedmaintools/pknorm_probe.py):Ran 6 tests ... FAILED (failures=10, errors=4)python3 -m compileall -q make_game.py tools tests: passedpython3 -I tests/test_text_write_line_endings.py:Ran 3 tests ... OK#1675 | head 64e7a1ba2e72e62ea26a4344013f99bdd660aa2a (merged cleanly with main 4a54aedcb) |
python -I tests/test_pknorm_probe.py| red on main:FAILED (failures=10, errors=4)(false0exit on empty/short oracle batches,boolwords accepted, malformed--oracle/--hw-archflags accepted, and uncaughtIndexError/TypeError/Unavailableinrun_hw/main) | green on PR+main:6 tests OK| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
run_hwbatch-length and strict integer/non-bool32-bit word validation, string-rejection checking beforediffs/nan_halvesbit-shifts, upfront--oracle/--hw-archvalidation, andrunner.Unavailable -> exit 77+RuntimeError -> exit 2underfinally: oracle.close()intools/pknorm_probe.py. Also passedtests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK),tests/test_runner_calls_all_tests.py(3 OK), andscripts/check_no_game_data.py.Red/green: classified READY by cloud-5 (red on main 09c153948, green on head merged with main); head 64e7a1ba2e72 unchanged since 2026-11-25, before that run.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)