Repository navigation
Bulk matching: refresh matched books, and overwrite replaces series - #121
Merged
Merged
Conversation
Bulk matching only ran over books with no ASIN or ISBN, so books matched by an identifier alone (the manager's enrichment, an ids-only apply) never got their title, series, position, narrator, description or cover filled in. A new refresh run mode takes every book with an identifier, looks it up by that identifier alone (the ISBN when the ASIN finds nothing) and treats the record as confident. Applying fills or overwrites the details under the usual scopes but never writes an identifier, so matchrun.ScopesFor allows only fill and overwrite for it. Audited as book.match_refresh. The console adds a 'Fill in matched books' button beside Find matches.
A match wrote every series of a work, and overwrite only ever added: series the community has since deleted, merged or now leaves out (editions, translations) stayed. Plan now returns Writes: under overwrite, a series value the community wrote that it no longer offers is reverted (back to what the files say). An admin's own series stay; a community edit's revert never removes an edited override. The review shows a scope's series before and after (changes.series).
…t0y7m' into claude/trusting-rubin-qccgpl # Conflicts: # internal/matchrun/plan_test.go # internal/matchrun/runner.go
… cleanup - the review's change line for a scope shows the book's series before and after (changes.series), so a removal is visible - overwrite / refresh hints say series an earlier match added are cleaned (all six locales) - tests: overwrite replaces and reverts, an admin's series survive, a community revert keeps an edit, a refresh cleans a polluted book, a retired work slug is followed
- Writes.after is the one rule for a field's value once written; the review's series change builds on catalog.SeriesList (now exported) - a refresh's proposal carries no identifier, so planFor needs no case - a refresh records only books a scope would change - the community-revert guard is decided in Go - console: SeriesRef, one series formatter, one series line; the overwrite description no longer says the match dialog removes series
- overwrite puts the files' series position back only beside the files' series, and reverts other series only when the community lists none (not when its list is too long to store) - a refresh logs a book it couldn't read instead of passing it over - a refresh proposal names the identifier it was found by (found_by); applying it skips a book matched again since
This was referenced Oct 11, 2026
KodeStar
changed the base branch from
main
to
claude/admin-series-robustness-1t0y7m
October 11, 2026 12:31
Base automatically changed from
claude/admin-series-robustness-1t0y7m
to
main
October 11, 2026 13:00
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.
Stacked on #122 (series rules). The base is that branch so this diff shows only this PR's changes. Merge #122 first; GitHub then retargets this to
main. Docs: KodeStar/audiosilo-docs#121.Summary
A new refresh match-run mode looks up books that already have an ASIN or ISBN, by that identifier alone, to fill in or overwrite their details. Revised here so it also cleans up books an earlier match stamped with wrong series: every edition, variant and translation of a series, written as community overrides.
Refresh mode (the original PR, kept)
mode: "refresh", overcatalog.MatchedBooks(every book with an ASIN or ISBN).auto. An identifier the community doesn't know isnone/identifier_unknown, never a fuzzy match by title.fillandoverwriteapply (ScopesFor;ErrScopegives 400 forids).book.match_refresh; the button is Fill in matched books in Health > Not matched.Revisions in this round
Overwrite replaces series, never unions them.
PlanreturnsWrites(set, revert, cover).overwrite, a book's series become the community's for its recording, under Series robustness: series rules for matches and rails, Series page rail picking #122's series rules.series,series_indexormore_seriesvalue the community wrote earlier that it no longer offers is reverted to what the files say. This covers a series the community deleted or merged, and an edition or translation the rules leave out.fillandidsnever revert.Series the user typed survive.
source:editedvscommunity).plannever touches aneditedfield, and onlyoverwritereverts.editTxnow deletes onlycommunityrows when the edit's source iscommunity, so an admin edit made after the run looked survives a revert.Redirects.
TestCandidatesFollowARetiredSlug.The review shows removals.
changescarriesseries: {from, to}when it changes the book's series.Safety and efficiency.
found_by). Applying it does nothing on a book matched again since.Docs: CLAUDE.md, and the API reference plus User Guide in the docs PR. That docs PR covers what the original body listed as "Not in this PR": the refresh mode,
book.match_refresh, and repick items carrying onlychanges.ids.Re-review of the original PR
planFordeleted identifiers that the proposal never carried (dead code);Wire (additive; admin-only, so the frontend repo needs no type change)
GET /admin/match-runs/{id}/items:changes.<scope>.series{from, to};proposal.found_by;changeshas only the scopes the run's mode takes.POST /admin/match-runsacceptsmode: "refresh".PATCH /admin/libraries/{id}/bookwithsource: "community"andrevertnow removes only a community value. The console never sends that combination.Verified
npm run check(668 tests),go build ./...,go vet ./...,go test -race ./...,golangci-lint run(0 issues).Left for a human
scopeson the run would remove that copy.MatchItemsToApplyloads every pending item at once, which matters for very large refresh runs.