Repository navigation
Fix corroborated series titles in downloaded-file review (NOR-87) - #69
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46b35a3493
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| group_evidence(row.snapshot, group), | ||
| series=catalog["series"], | ||
| ) | ||
| for conflict in (await file_match(db, work, selection, row, group)).conflicts |
There was a problem hiding this comment.
Reuse request identity across file groups
For a ready inspection containing many groups, this awaits file_match sequentially for every group. Each call unconditionally reloads the same user, catalog series, and metadata through identity, and a nonmatching title can trigger several additional queries in corroborated_titles; grouping permits inspections with thousands of files/groups. The previous implementation loaded identity once outside this loop, so opening a large download review now produces thousands of serial database round trips and can time out. Load the request-scoped identity once and reuse it, invoking the expensive corroboration only for groups that can qualify.
Useful? React with 👍 / 👎.
Downloaded audiobooks tagged only with a series and position, such as
Robert Langdon, Book 1, were rejected for the requested book even when the download and catalog identified it. A matching edition identifier also reintroduced a title conflict for otherwise accepted series annotations.Use one request-scoped title decision for download review, candidate matching, automatic import, edition creation, and plan confirmation. Series-only titles require a complete single-book transfer, matching source title/author/medium, matching file authors, and fresh, unique, published catalog membership. Wrong positions, conflicting membership, collections, partial files, and exact-edition requests retain their existing holds. Full-title annotations now accept equivalent
&/andspelling. File-created editions retain the canonical book title.Validation through the bounded workstation runner:
Integration coverage uses a disposable PostgreSQL database, real media files and filesystem publication, and fixture download/library services. It verifies preserved bytes, one publication on repeated confirmation, and rejection through both review and direct confirmation APIs. Live external services were not exercised.
Fixes NOR-87