awc_names: fail on incomplete bank directory scans #2450

Merged
leonida/mandy
kirigayakazima merged 1 commit from codex/awc-names-incomplete-bank-walk into main 2026-11-28 19:42:43 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-27 10:34:27 +00:00

Claimed in the coordination issue as: AWC-NAMES-INCOMPLETE-BANK-WALK

What and why

A recursive bank scan used the default os.walk error handling. An unreadable subtree could leave a partial set of banks while the command returned success and replaced a previous report. Propagate bank traversal errors through the normal CLI error path. The synthetic regression yields one valid bank before injecting the traversal failure and checks the previous report byte-for-byte.

Tested

Windows, Python 3.14.7. The regression reproduced on the parent and passed with the change.

  • python -I tests/test_awc_names.py
  • Changed-path no-game-data scan and git diff --check passed.

The integrated checkout passed 6,374 semantic tests across 500 files. CI's macOS job failed in the calibrated-texture replacement test, as it did on the unchanged main baseline.

GPUs tested: N/A (CPU-only synthetic tests).

AI-assisted: Yes.

Checklist

  • Based on current main and merges cleanly with the tested base.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract table: N/A.
Claimed in the coordination issue as: [AWC-NAMES-INCOMPLETE-BANK-WALK](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7215934316) ### What and why A recursive bank scan used the default os.walk error handling. An unreadable subtree could leave a partial set of banks while the command returned success and replaced a previous report. Propagate bank traversal errors through the normal CLI error path. The synthetic regression yields one valid bank before injecting the traversal failure and checks the previous report byte-for-byte. ### Tested Windows, Python 3.14.7. The regression reproduced on the parent and passed with the change. - `python -I tests/test_awc_names.py` - Changed-path no-game-data scan and `git diff --check` passed. The integrated checkout passed 6,374 semantic tests across 500 files. CI's macOS job failed in the calibrated-texture replacement test, as it did on the [unchanged main baseline](https://github.com/ubiquitarianism/leonida/actions/runs/45977772928/job/140433726198). GPUs tested: N/A (CPU-only synthetic tests). AI-assisted: Yes. ### Checklist - [x] Based on current main and merges cleanly with the tested base. - [x] One topic. - [x] No game data, keys or decryption. - Translator contract table: N/A.
MSedgeMC reviewed 2026-11-27 15:03:10 +00:00
MSedgeMC left a comment
No description provided.
Verified on the PR branch: python3 -m unittest tests.test_awc_names -v -> 37 tests OK (1 skip), including the new incomplete-bank-directory rejection case. Not approving yet: the branch is 606 commits behind current main, so a rebase is needed before the final diff can be reviewed.
zmasi commented 2026-11-28 06:52:19 +00:00

#2450 | head 9671df1ea94d25914c9ef9ca2341d8f2dc4ff731 (merged cleanly with main 09c153948) | python -I tests/test_awc_names.py | red on main: FAILED (failures=1) (test_incomplete_bank_walk_preserves_report: AssertionError: 0 != 2) | green on PR+main: 37 tests OK (-k test_incomplete_bank_walk_preserves_report: 1 test OK) | Windows 11, Python 3.12.10 | AI-assisted: yes

Audited load_banks in tools/awc_names.py (os.walk(source, onerror=scan_failed) raising unreadable-subtree errors before writing output so existing reports stay intact on exit code 2), and verified both PR + main (09c153948) and a combined main + #2450 + #2449 merge: git merge (ort) auto-merged tools/awc_names.py and tests/test_awc_names.py with zero conflicts (38 tests OK in tests/test_awc_names.py). Also passed tests/test_text_write_line_endings.py (3 OK), tests/test_runner_calls_all_tests.py (3 OK), and scripts/check_no_game_data.py.

#2450 | head 9671df1ea94d25914c9ef9ca2341d8f2dc4ff731 (merged cleanly with main 09c153948) | `python -I tests/test_awc_names.py` | red on main: `FAILED (failures=1)` (`test_incomplete_bank_walk_preserves_report`: `AssertionError: 0 != 2`) | green on PR+main: `37 tests OK` (`-k test_incomplete_bank_walk_preserves_report`: `1 test OK`) | Windows 11, Python 3.12.10 | AI-assisted: yes Audited `load_banks` in `tools/awc_names.py` (`os.walk(source, onerror=scan_failed)` raising unreadable-subtree errors before writing output so existing reports stay intact on exit code `2`), and verified both `PR + main` (`09c153948`) and a combined `main + #2450 + #2449` merge: `git merge` (`ort`) auto-merged `tools/awc_names.py` and `tests/test_awc_names.py` with zero conflicts (`38 tests OK` in `tests/test_awc_names.py`). Also passed `tests/test_text_write_line_endings.py` (`3 OK`), `tests/test_runner_calls_all_tests.py` (`3 OK`), and `scripts/check_no_game_data.py`.
MoonEyes commented 2026-11-28 19:42:40 +00:00

Red/green: tests/test_awc_names.py fails 1 assertion on main (an incomplete bank walk still overwrites the report and exits 0) and passes with the PR (cloud run on main 7daa4a4).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: tests/test_awc_names.py fails 1 assertion on main (an incomplete bank walk still overwrites the report and exits 0) and passes with the PR (cloud run on main 7daa4a4). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.