awc_names: fail on incomplete bank directory scans #2450

Merged
kirigayakazima merged 1 commit from upstream-pr/2450 into main 2026-11-28 19:42:43 +00:00
kirigayakazima commented 2026-11-27 10:34:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T10:34:27Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5525150993 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2450). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-27T10:34:27Z. --- 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 commented 2026-11-27 15:03:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-27T15:03:10Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6090067431 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2450#pullrequestreview-6090067431). Originally posted by [MSedgeMC](https://github.com/MSedgeMC) on 2026-11-27T15:03:10Z. **Review:** COMMENTED --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T06:52:19Z.


#2450 | head 9671df1ea9 (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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7235569921 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2450#issuecomment-7235569921). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T06:52:19Z. --- #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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:42:40Z.


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7244748026 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2450#issuecomment-7244748026). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T19:42:40Z. --- 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 reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2450
No description provided.