"Local" stops being a one-way door, and the head search stops skipping
Answering Eric's question — no, a local game never looks itself up again — by making it possible. A local row's Titles line gains "look it up", reopening it through the SAME cascade resolve uses (board games, truncation heads, then RPGGeek) rather than the partial re-implementation reopen_match had; that cascade is now one shared find_candidates() instead of two drifting copies. Review's manual (f) re-search falls back to RPGGeek too. That exposed a real matcher gap: truncation heads jumped from "drop the last word" straight to "first two words", so a printed title that buries the real name in the middle was unreachable — "ALICE IS MISSING A SILENT ROLE PLAYING GAME" never tried "ALICE IS MISSING". Heads now shrink from the right, longest first (bounded at six, since each is a rate-limited request); only exact normalized matches count for heads, so shorter heads cannot match loosely. Both of Eric's Alice Is Missing rows now find their RPGGeek entries (311654, and 380459 for Silent Falls) and await his picks in review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g
This commit is contained in:
co-authored by
Claude Fable 5
parent
7e95ed607d
commit
50a710ce99
@@ -213,7 +213,8 @@ def test_truncation_heads_order_and_dedupe():
|
||||
heads = _truncation_heads(CIV_TITLE)
|
||||
assert heads[0] == "CIVILIZATION Game of the Heroic Age" # before separator
|
||||
assert heads[1] == "CIVILIZATION" # before the "Game ..." descriptor
|
||||
assert len(heads) <= 3
|
||||
assert len(heads) <= 6 # bounded: each head is a rate-limited request
|
||||
assert "CIVILIZATION Game" in heads # shrinks from the right, longest first
|
||||
|
||||
|
||||
def test_truncation_heads_game_word_without_separator():
|
||||
|
||||
@@ -647,3 +647,27 @@ def test_reopen_match_returns_a_fresh_ballot(tmp_path):
|
||||
dead.reopen_match(row2)
|
||||
assert row2["match_status"] == "unmatched"
|
||||
assert dead.warnings # the degradation is visible
|
||||
|
||||
|
||||
def test_local_rows_can_be_looked_up_again_on_rpggeek(tmp_path):
|
||||
""" "Local" means BGG has no board game by that name — but RPGGeek,
|
||||
the same database under type=rpgitem, often does. A local row must not
|
||||
be a one-way door."""
|
||||
cfg = _setup(
|
||||
tmp_path,
|
||||
[
|
||||
_row(
|
||||
title_raw="ALICE IS MISSING: A SILENT ROLE PLAYING GAME",
|
||||
match_status="local",
|
||||
)
|
||||
],
|
||||
)
|
||||
session = ReviewSession(
|
||||
cfg, console=quiet_console(), input_fn=scripted(), client=fixture_client()
|
||||
)
|
||||
row = session.rows[0]
|
||||
session.reopen_match(row)
|
||||
assert row["match_status"] == "ambiguous"
|
||||
candidates = json.loads(row["candidates_json"])
|
||||
assert any(c["type"] == "rpgitem" for c in candidates)
|
||||
assert any("Alice is Missing" in c["name"] for c in candidates)
|
||||
|
||||
Reference in New Issue
Block a user