awc_names: number family members by their suffix (AWC-NAMES-FAMILY-SUFFIX-NUMBER) #2384
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!2384
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/awc-names-family-suffix-number"
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-FAMILY-SUFFIX-NUMBER (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7198059484)
What and why
tools/awc_names.pynames AWC bank ids by dictionary attack. A family is a base whose numbered suffixes ('',_00.._40,_1.._9) hit ids in one bank. The module docstring anddocs/audio.mdrequire "at least 3 members, or 2 with adjacent numbers", because chance hits rarely land on adjacent numbers.family_okread each member's number from the whole name (FAMILY_NUMBERonsalt + base + suffix). When the base itself ends in a digit, its unsuffixed member got a number too:family_okonmainhorn+horn_02amb_1+amb_1_02Dictionary bases can end in a digit token (
wordyaccepts digit tokens), so such a pair could be reported as a named family on chance hits. The salted control run that sizes the family rule does not catch it, because the control uses the same reading._attack_splitnow handsfamily_okthe members' suffixes (name[len(salt) + len(base):]), so a digit that belongs to the base never counts as a member number. Bases without a trailing digit are unaffected, andfamily_ok's own behaviour on full names (its existing test) is unchanged.Different topic from #780 (write mode on replace, same files); the two merge cleanly.
Tested
Windows 11, Python 3.14.7, synthetic dictionary and ids only:
python -I tests/test_awc_names.py: 37 tests OK. Newtest_a_digit_that_ends_the_base_is_not_a_member_number:amb_1+amb_1_02andhorn+horn_02in one bank are both rejected; onmainthe first is accepted and the test fails.amb_1_01+amb_1_02(adjacent suffixes) andamb_1+amb_1_02+amb_1_05(three members) are still accepted.python -m compileall;scripts/check_no_game_data.pyon both files.Not changed here:
docs/audio.mdline 329 says that when two accepted families claim one id, "the first family in sorted base order keeps it", while the code has kept the larger family since 58a981e25. That is a separate doc fix.GPUs tested: n/a (CPU-only tool)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
VERIFY-2384 — Linux, Python 3.15, CPU only, no game files
Claimed as
VERIFY-2384(+13/-0 test, +5/-2 tool). Two-step method: merge into a clean worktree atmain(9d231d37), then take only the test file onto cleanmain.python -I tests/test_awc_names.pymainmain+ this pull requestmain+ only this pull request's test fileThe failure on the last row is an
AssertionError, not an import or attribute error, so the test is exercising the changed code rather than merely failing to load it. Reverse control holds: the change is what turns it green.Verified. Nothing found against it; merges cleanly with
mainat9d231d37.AI-assisted: yes — MiMo-V2.6-Flash (OpenCode).
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.
(AI-assisted triage.)
Now ready for review and
MERGEABLE(1 commit). Clean-room verified: scoping family member numbering to the post-base suffix intools/awc_names.py:297-302with tests intests/test_awc_names.pyis clean and verified (@wavehs,@imShangLi,@MSedgeMC).Approving — ready to merge once CI runs green on current
main.(AI-assisted review.)