Repository navigation
fix: veto identity matches when titles disagree and no id links them - #62
Merged
Merged
Conversation
The composite score gives 0.25 for author overlap and 0.10 for the same year, so a co-authored pair from one year starts at 0.35 of the 0.60 threshold with no title evidence. Two different Bodorik papers (Liu 2021 and Liu 2022, title score 0.654, composite 0.641) and two different Matwin papers (Ferreira 2022, 0.656, 0.612) scored as one work on disk and in enrichment, so a refresh could delete either. With no arXiv id on either side, the disk preprint-pair, same-key, composite and relaxed-preprint paths and the enrichment composite gate now need the titles to agree: a score of at least SIM_TITLE_SIM_MIN, or one normalized title occurring whole inside the other, which keeps Scholar's both-ends truncation (Alhasani 2025, 0.737) matching. Equal arXiv ids and the one-sided arXiv rule are unchanged, as are DOI, DOI-version, external-id, high-title and truncated-title matches.
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
Two pairs of different papers by the same team were scored as one work, both on disk and in enrichment, so a refresh with slightly different metadata could delete one of each pair:
Liu2021-BlockchainPrivacyvsLiu2022-AutomatingSmartFerreira2022-SemiSupervisedvsFerreira2022-SemiSupervisedGeometricRoot cause
compute_dedup_scoregives 0.25 for author overlap and 0.10 for the same year, or 0.05 for one year apart (citeforge/text_utils.py:654-664). A co-authored pair from one year therefore starts at 0.30 to 0.35 of the 0.60 threshold with no title evidence at all.The composite paths only required a title score of 0.55 to 0.6 before the composite could decide. In enrichment the floor was 0.35.
Fix
_titles_agree(citeforge/identity.py:106) accepts titles that score at leastSIM_TITLE_SIM_MIN(0.8), or where one normalized title occurs whole inside the other, because Scholar truncates long titles from both ends. When neither record carries an arXiv id, the following now require it::250-255);:208).Equal arXiv ids, the one-sided arXiv rule from #61, and DOI, DOI-version, external-id, high-title and truncated-title matches are unchanged.
Effect on the committed corpus
Every same-directory pair evaluated under
DISK_SURVIVORbefore and after: three pairs flip from "same work" to "distinct".D2025-DevelopingInteractive.bib(medRxiv10.1101/2025.10.07.25337102) vsEtienne2025-DevelopingInteractive.bib(JMIR Human Factors10.2196/86283). It is the same author list, retitled, at a title score of 0.773. Crossref has no relation between the two DOIs, so the preprint is now kept instead of removed as superseded.Reilly's Porcino2022 pair is unchanged: both files are kept.
Verification
pytest -m 'not live' --cov=citeforge --cov=main --cov-fail-under=68on Python 3.12, macOS: 2083 passed, 2 skipped (the documented cutover contracts), 7 deselected, coverage 84.14%.ruff checkandmypyare clean.test_shared_authors_and_year_never_merge_different_titlesuses the committed Liu and Ferreira records. Onmainboth cases fail, with one file left on disk. Both pass with the fix, and enrichment also rejects both pairs.TestStrongAuthorDedupGate::test_same_authors_moderate_title_sim_matchesstill passes. Alhasani 2025 scores 0.737, and its Scholar title is a both-ends truncation of the published one.Enrichment-context verdicts on every same-directory corpus pair:
mainaccepts 11 pairs and this branch accepts 2. Besides Liu, Ferreira and Orji,mainalso accepted six pairs of different Neethirajan papers at title scores of 0.48 to 0.53, with a preprint/published split opening the gate. The 2 that remain are prefix truncations (TRUNCATED_TITLE).Refresh replay on
mainplus this change: the realrun_allover a copy of the committed corpus, with live Crossref, arXiv, OpenAlex and DOI enrichment of shared-DOI records (Scholar and Gemini not used), thenfinalize_run. 9 authors were forced, 0 DOI conflicts remained, and finalization completed with 3691 files and 1105 in a2i2. Against the committed corpus, 0 of 58 directories changed file count or publication set. Liu, Ferreira, Porcino, Orji and VISLA are all present.