Conversation
The Hardcover diff let a local whose best catalogue entry was already taken fall through to its next best on title similarity alone. With two rows for The Way of Kings, an ebook and an audiobook, the second bound to The Way of Kings Prime at 0.90, so Prime showed as owned and dropped out of Missing and series fill. #2553's position rule only caught this when both the row and Prime carried different stored positions: 45 of the 54 variants in the new test still misbound on main. Title matches now bind strongest first, and a local only falls through to an entry it scores exactly as well as the one it lost. Otherwise it is Local only, the outcome #2553 already gives a duplicate at one stored position. An equal score still falls through, which is the #2343 tie. Output order and thresholds are unchanged. Signed-off-by: vavallee <vavallee@protonmail.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fJcCVbNnKsmj2MAAMwWj9
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
The previous commit listed a local as Local only whenever its best catalogue entry was taken and its fallback scored lower. On libraries without stored positions that starved real books: each bare "He Who Fights with Monsters N" scores 0.96 against the umbrella entry volume 1 holds and 0.90 against its own, so 11 of 13 rows went Local only, 10 owned volumes showed as Missing, and a real Fill created Wanted copies of volumes 2 and 9. A local is now Local only just when a bound entry it scores above its fallback is held by a local with the same title: both titles carry the same set of numbers, and their TitleScore is at least the local's score on that entry. Every such entry is checked, not only the local's best. Otherwise it falls through exactly as on main. The identity pass, bestCatalogMatch, thresholds and output order are unchanged. TestHardcoverDiffRealisticSeriesNeverStarves runs the #2553 library, a full He Who Fights with Monsters library, Defiance of the Fall, The Primal Hunter and Stormlight, with and without positions, in both library orders, plus a real Fill that must create nothing. It fails 8 diff subtests and both fill subtests on the previous rule, and 4 diff subtests on main. The wiki no longer claims order independence. Exact ties still bind in library order, and a second copy with a different title still takes Prime when the position floor lifts Prime to a tie. Signed-off-by: vavallee <vavallee@protonmail.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fJcCVbNnKsmj2MAAMwWj9
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.
Summary
A second local row for a book that already bound in the Hardcover diff could fall through to a similarly titled catalogue entry. Two rows for The Way of Kings (ebook and audiobook) left the second one bound to The Way of Kings Prime at 0.90, so Prime showed as owned and dropped out of Missing and series fill. #2557's position rule only covered this when both the row and Prime carried different stored positions. Closes #2410.
The rule
buildHardcoverDiffininternal/api/series.go, title pass only. The identity pass from #2557,bestCatalogMatch, thresholds and the output order of every list are unchanged.boundCopyOf): some bound entry it scores above that fallback is held by a local with the same title, meaning both titles carry the same set of numbers andTitleScore(local, holder)is at least the local's score on that entry. Then it is Local only, logged at DEBUG asseries diff: local book is a second copy of a book already bound, left Local only.The first version of this PR refused any weaker fallback. Review showed that starved real books on libraries without stored positions, which is worse than the bug: each bare "He Who Fights with Monsters N" scores 0.96 against the umbrella entry volume 1 holds and 0.90 against its own, so 11 of 13 rows went Local only, 10 owned volumes showed as Missing, and a real Fill created Wanted copies of volumes 2 and 9.
Results
TestHardcoverDiffRealisticSeriesNeverStarves, every series in both library orders, counts summed over both orders. Cells are misbound / starved / owned entries listed Missing. Starved means Local only with no other copy of the same book bound.The test asserts starved and owned Missing, not misbound. It fails 4 diff subtests on main (#2553 without positions in library order, both id variants; HWFWM without positions reversed; Primal Hunter without positions in library order) and 8 diff subtests plus both fill subtests on the previous rule.
TestHardcoverDiffDuplicateRowNeverBindsANeighbour(60 subtests) and the #2553 test pass unchanged.Known limits, also on main
Still misbound after this change, all from title similarity, all misbound on main too:
Other shapes probed but not committed: Defiance with bare local titles, Defiance with an umbrella volume 1 entry, and Stormlight with a Prime row owned all show zero starved and zero owned Missing here. HWFWM with volume 1 titled "He Who Fights with Monsters 1", no positions, reversed, gives 3 misbound here against 1 misbound plus 1 starved on main: every bare title ties on the umbrella entry and library order decides.
Checklist
docs/Hardcover-Series-Wiki.md, binding section, now states the limits instead of order independence)changelog.d/2410-series-diff-duplicates.mdTest plan
go build ./... && go vet ./...go test ./internal/api -count=1golangci-lint run ./internal/api/...(v2.11.4, 0 issues)go test -overlay(results above)cd web && npm run build(no web change)🤖 Generated with Claude Code
https://claude.ai/code/session_016fJcCVbNnKsmj2MAAMwWj9