Repository navigation
Fix name_usage index defects found reviewing #712's fixes - #714
Merged
Merged
Conversation
- A batch that overran under a new listing and was cached as halves left the old whole-batch file beside them, and that file was read first: a complete index loaded as missing offline and re-sent the overrunning query on every run. The halved marker is read first now, and the old file is removed when a batch is halved. - Batches were keyed by their first and last item, so a re-listing that changed an item in between raised "unusable" or silently missed the new item. Each batch file now carries a digest of its whole membership and is fetched again when that changes. - --refresh-index with only Latin words deleted the index and, if the rebuild failed, exited 0 with nothing said. The failure is printed and the exit status is 2. - HTTPErrors are closed wherever the report lets go of one (the Wikidata row, the ends-with row, a pairing, a source loader), not only in the retry and overrun paths; 3.14 warns on one left open. - _CJK_CHARS reaches Extension H; the separate compatibility-supplement range sat inside it. INDEX_VERSION 3, so the cache is rebuilt. Tests: a pre-versioning cache (no version file), each end and the middle of a batch changing, the stale whole batch beside its halves, corrupt batch shapes ([] and short or non-string rows), a listing with no item column, the pairing union with the larger chunk first, closed HTTPErrors on each path, and the refresh failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #714 +/- ##
=======================================
Coverage 99.03% 99.03%
=======================================
Files 46 46
Lines 4557 4557
=======================================
Hits 4513 4513
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #712, which was merged before this round so another session could proceed. A second review of #712's fix commits found these defects in
tools/name_usage.py's CJK index. All are in the dev tool; none changes parsing.Fixes
--refresh-indexfailed silently with only Latin words. It deleted the index and, if the rebuild failed, exited 0 with nothing said. The failure is now printed and the exit status is 2._CJK_CHARSnow reaches Extension H, and a redundant range is dropped.INDEX_VERSIONis now 3, so an existing cache is rebuilt.Tests
The new tests cover:
Results:
Index rebuild
The version-3 rebuild ran clean: it detected the old cache and rebuilt it, and one batch that timed out was split in half. The results match #712's: 215,820 entries; 殿 ends 13 name items; the only name item ending in any #707 word is 二世's mislabel 厄德二世 (Q18339792); and every family/given pair counts 0 people.
🤖 Generated with Claude Code