awc_names: recognize BOM-prefixed and whitespace-prefixed word dictionaries #2449
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!2449
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/awc-names-word-dictionary-detection"
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
Claimed in the coordination issue as: AWC-NAMES-WORD-DICTIONARY-DETECTION
What and why
An optional UTF-8 BOM could become part of the first plain-text word, cause a JSON file to fail parsing, or hide the opening brace of an extensionless hash dictionary. Skip a UTF-8 BOM in both input modes and detect the first non-whitespace character across read blocks. Explicit JSON inputs retain strict decoding. Tests cover a typed list, a plain word list and an extensionless hash dictionary with more than 8 KiB of leading whitespace.
Tested
Windows, Python 3.14.7. The regression reproduced on the parent and passed with the change.
python -I tests/test_awc_names.pygit diff --checkpassed.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
#2449 | head 484d1e7179ee511bbfa98728c2e59a71514c54d1 (merged cleanly with main 09c153948) |
python -I tests/test_awc_names.py| red on main:FAILED (failures=2, errors=1)(test_word_dictionary_preamblesacrosswords.json, UTF-8 BOMhashdict, and UTF-8 BOMwords.txt) | green on PR+main:37 tests OK(-k test_word_dictionary_preambles:1 test OK) | Windows 11, Python 3.12.10 | AI-assisted: yesAudited
read_wordsintools/awc_names.py(utf-8-sigdecoding + chunked leading-whitespace scan for{beforeseek(0)plain-text fallback so.jsonword lists and BOM/whitespace-prefixed hash maps or word lists parse cleanly), and verified bothPR + main(09c153948) and a combinedmain + #2450 + #2449merge:git merge(ort) auto-mergedtools/awc_names.pyandtests/test_awc_names.pywith zero conflicts (38 tests OKintests/test_awc_names.py). Also passedtests/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 oreo-lot3 (red on main b1619e0a3, green on head merged with main); head 484d1e7179ee unchanged since 2026-11-27, 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)