Post-resolve dedupe: duplicate reads merge, review can veto
Rows resolving to the same (bgg_id, version_id — or both version-
unknown) are the same physical game read twice unless their extraction
cues conflict (two editions stay separate). The survivor is the read
whose transcription matches the BGG name; losers are marked
match_status=merged with a new merged_into column — no row is ever
deleted, and older matches.csv files without the column still read.
Downstream: diff skips merged rows but folds their photos into the
survivor's to_add provenance; enrich and the review passes ignore them.
The web UI gains a Merges section ("Jokin Ha... merged into Joking
Hazard") with a veto (v key) that restores the row as a distinct
approved match, plus a merged catalog chip and header tally.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -164,3 +164,17 @@ def test_pending_rejected_and_unseen_are_reported():
|
||||
assert result.rejected == 1
|
||||
assert [c.object_id for c in result.unseen] == [9209] # informational
|
||||
assert result.recognized == 1
|
||||
|
||||
|
||||
def test_merged_rows_are_skipped_but_photos_carry_to_survivor():
|
||||
matches = [
|
||||
_match("Joking Hazard", "193621"),
|
||||
{**_match("Jokin Ha...", "193621", status="merged"),
|
||||
"merged_into": "Joking Hazard", "source_photos": "other.jpg"},
|
||||
]
|
||||
result = compute_diff(matches, []) # empty collection -> to_add
|
||||
assert result.merged == 1
|
||||
assert result.pending == [] # merged is not "needs review"
|
||||
(row,) = result.to_add
|
||||
assert row["title_raw"] == "Joking Hazard"
|
||||
assert row["source_photos"] == "other.jpg;x.jpg" # combined
|
||||
|
||||
Reference in New Issue
Block a user