Conversation
Follow-up to Listenarrs#784. The book-boundary matcher compares a normalized author directory name against expected author tokens; a professional or generational post-nominal on either side (metadata "Jane Doe, PhD" vs a "Jane Doe" folder, or a "Martin King Jr" folder vs "Martin King" metadata) previously blocked the match. BuildExpectedAuthorTokens now also emits a post-nominal-stripped variant, and HasAuthorContext strips post-nominals from the directory token, making the match symmetric. Changes are additive (no existing token is removed). Scope is deliberately narrow, per @m4bard's over-matching concern on Listenarrs#784: - Post-nominals only. Initials are NOT expanded ("L. M." stays distinct from "Lucy Maud"), which would over-match otherwise-distinct authors. - The suffix set excludes short degree abbreviations that collide with real name words (e.g. "ma" as in Yo-Yo Ma), so surnames are never dropped. - Stripping always leaves at least one word. Tests: post-nominal in metadata matches a clean folder; a generational-suffix folder matches clean metadata; an ambiguous "ma" surname is not stripped; initials are not expanded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I ran it rather than leave you waiting on the offer. Built your branch at Folder side: the record is clean, the author folder carries the credential
Record side: the folder is clean, the record carries the credential
Both directions work, which is the symmetry your description claims, and I could not get it to over-reach: not one run on either image claimed a file belonging to the sibling. On the two linking folder rows Three cells are zero on your branch, so worth saying why they are not just a broken harness. The no-variant row links on the same image with the same command, so the apparatus reaches the author folder. And the CFP row differs from the PhD row by three characters in one folder name, on the same image, where PhD links. So the nulls are about the credential rather than about the run. Where the tolerance stopsThe curated list is the boundary, and #784's own examples sit outside it. The list in that report is PhD, MD, M.Ed., CFP and Jr. Three of those are in the set at I am not arguing for a wider list. A curated list is defensible and the alternative rule, "strip any short trailing token", is exactly the kind of widening that caused the misattributions I measured on the first revision. But there are two reasonable shapes here and they read differently to a reviewer: the PR as it stands, which covers the common trailing credentials and leaves both of #784's worked examples unmatched, or the same mechanism with the list grown and the leading position handled, which closes #784's examples and needs its own argument about where stripping stops. Which one you want this PR to be is your call, and I would rather ask than assume, because either answer changes what the description should say. There is also an asymmetry I read but did not run. One more from reading rather than running, and I want to be careful with it because I could not measure it: Running it yourselfThe variants are on the public generator now, so none of this depends on me: Swap the variant key for Disclosure: drafted with Claude Code at my direction; I read the cited code at the stated commit and reviewed this before posting. |
|
Thank you for building it rather than waiting on me — the two-image table with the sibling-attribution column is exactly the confirmation the diff can't give, and the BasePath row (variant author folder over the book's own title folder) is the specific thing I most wanted to see not regress. On the scope question: A — I want this PR to stay the trailing-post-nominal shape, and I've rewritten the description to say so in as many words. Both of #784's worked examples stay out by design: The two reads you flagged from code rather than runtime:
Disclosure: drafted with Claude Code at my direction; I made the scope call and reviewed this before posting. |
|
Scope A works for me, and keeping the leading-credential case for its own PR with its own evidence is the right call. The tag-state offer still stands whenever you want it, no pushing it from my side. Worth saying: A is the narrower option and the harder one to show off, and you've picked it twice on this thread. Disclosure: drafted with Claude Code at my direction; reviewed this before posting. |
Summary
Follow-up to #784. The book-boundary scan matcher compares a normalized author directory name against the audiobook's expected author tokens. When a professional or generational post-nominal appears on only one side — metadata
Jane Doe, PhDvs aJane Doefolder, or aMartin King Jrfolder vsMartin Kingmetadata — the author context previously failed to match.Change
BuildExpectedAuthorTokensnow also emits a post-nominal-stripped variant of each author.HasAuthorContextstrips post-nominals from the directory token before comparing.Together these make the match symmetric in either direction. The change is additive — no previously-produced token is removed, so nothing that matched before stops matching.
Deliberately narrow (per @m4bard's over-matching concern on #784)
L. M.stays distinct fromLucy Maud, avoiding the genuine widening that initials matching would introduce.maas in Yo-Yo Ma,do,ba,bs), so a surname is never silently dropped.Suffix set:
phd md dds dvm dpt edd psyd jd esq mba cpa llm llb mfa jr sr ii iii iv.Scope boundary — what this intentionally does not cover
This is deliberately the narrow, trailing-post-nominal shape, not a general credential/name normalizer. Out of scope by design:
Dr. Jane DoeorM.Ed. Karla McLarenfolder against a clean record. Stripping only walks backward from the end and stops at the first non-post-nominal word, so a credential in front of the name is never reached.John M. GottmanvsJohn Gottman, orL. M.vsLucy Maud. These are a genuine widening (any author whose initials collide gets accepted) and stay out for the same reason initials matching does.So the two worked examples in #784 are not closed by this PR — they need leading-position and initial handling, which carries the widening risk we agreed to avoid. Growing the list and reaching the leading position would be a separate change with its own argument about where stripping stops.
Known, accepted trade-off:
Jr/Srboth strip, soMartin King JrandMartin King Srreduce to the same token. Exposure is negligible — author context only corroborates after a full title-segment match.Tests (in the
ScanFileDiscoveryTestsharness)masurname is not stripped (no false match)All
ScanFileDiscoveryTestsgreen; architecture gates (file-focus, test conventions) green.Coordination
@m4bard validated this against his public generator (both directions link, no over-reach, and the #784-v1 BasePath-collapse failure did not return). Thanks for running it.
🤖 Generated with Claude Code