A family is a base whose numbered suffixes hit ids in one bank: at
least 3 members, or 2 with adjacent numbers (docs/audio.md, the module
docstring). family_ok took each member's trailing number from the whole
name, so when the base itself ends in a digit its unsuffixed member got
a number too: amb_1 + amb_1_02 counted as the adjacent pair 1/2 and was
accepted, while the same shape on a base without a digit (horn +
horn_02) is rejected. Dictionary bases can end in a digit token.
Pass family_ok the members' suffixes, so the base's own digits never
count.
Tested: new test_a_digit_that_ends_the_base_is_not_a_member_number
(fails before for amb_1; two adjacent suffixes and three members on the
same base are still families).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Publish CSV and JSON name reports through a temp file + replace so a mid-write OSError leaves any prior complete report intact.
Co-authored-by: Cursor <cursoragent@cursor.com>
Guard the remaining unguarded os.link() calls in test_awc_names.py, test_gamedata_graph.py, test_navmesh_decode.py, test_restofworld_index.py, test_rtti_scan.py, test_save_keys.py, test_swizzle_search.py, and test_tex_headers_report_paths.py with try/except (OSError, NotImplementedError) so only the hard-link subtest/check is skipped when hard links are unavailable and the rest of each test still runs.
A --words .json file holding a JSON scalar (42, null, true) raised a
TypeError traceback from read_words and exited 1, because main() only
turns OSError/ValueError into the one-line exit-2 error. A JSON string
was read as one word per character. read_words now raises ValueError
for anything but an object or a list, so all of them take the existing
error path.
load_banks() now raises ValueError when the banks JSON is not a list of
objects, so main() prints one error line and exits 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AWC stream tables keep only joaat(lowercase name) & 0x1FFFFFFF. With ~1.8M
distinct ids in a 2^29 space, ~0.3% of arbitrary words collide, so
awc_names.py accepts a hit only as an exact dialogue-wave word
(<root>au_<4 letters>_<NN>) or as a numbered family in one bank (3+
members or 2 adjacent, common-token base, one member a dictionary word).
A salted control run estimates the false names and sets each rule's
threshold per source.
The dictionary takes word lists or a hashdict.py JSON, and builds dialogue
wave names from conversation key/label pairs (<key>_01.._N per label).
Banks come from .awc files, directories or rpf9dump's audio_manifest.json.
On 1.0.2.1: 266,781 of 1.85M ids named (story000 73.7%, audio 5.7%),
with 417 control hits. Standard library only; tests are synthetic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>