Keep confirmed detect cues from opening a second type-conflict review.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
011cc9dd81
commit
0277039b07
7 files changed
+33
-7
No files matched your search
@@ -209,10 +209,9 @@ def main() -> None:
|
||||
json={"body": "Hanna aß mit uns."},
|
||||
)
|
||||
status_ok(hanna_again, "second Hanna turn")
|
||||
hanna_conflict = hanna_again.json().get("pending_mask_review") or {}
|
||||
expect(
|
||||
bool(hanna_conflict.get("id")),
|
||||
"teacher PERSON versus stored not_identity cue stays a visible type conflict",
|
||||
not hanna_again.json().get("pending_mask_review"),
|
||||
"stored Hanna cue is not re-asked against teacher PERSON",
|
||||
)
|
||||
|
||||
record_sense(profile_id, "Clarissa", identity=True)
|
||||
@@ -382,9 +381,17 @@ def main() -> None:
|
||||
wrapped = MentionSpan("Frau Sushi", 15, 25, "PERSON", "identity", "teacher", False, "frau")
|
||||
expect(same_mention(person, wrapped), "contained Sushi matches Frau Sushi")
|
||||
expect(map_entity_type("person") == "PERSON", "GLiNER person maps to PERSON")
|
||||
review, counters = compare_mentions(profile_id, dish_line, [person], [food], dish_line)
|
||||
guessed = MentionSpan("Sushi", 20, 25, "PERSON", "identity", "candidate", False, "aß")
|
||||
review, counters = compare_mentions(profile_id, dish_line, [guessed], [food], dish_line)
|
||||
expect(counters["diff_type_conflict"] >= 1, "FOOD versus PERSON is a type conflict")
|
||||
expect(any(item.get("reason") == "type_conflict" for item in review), "type conflict is offered")
|
||||
expect(any(item.get("reason") == "type_conflict" for item in review), "unconfirmed type conflict is offered")
|
||||
confirmed_dish = MentionSpan("Sushi", 20, 25, "FOOD", "not_identity", "cue", True, "rohan")
|
||||
teacher_person = MentionSpan("Sushi", 20, 25, "PERSON", "identity", "teacher", False, "rohan")
|
||||
kept, kept_counters = compare_mentions(
|
||||
profile_id, dish_line, [confirmed_dish], [teacher_person], dish_line
|
||||
)
|
||||
expect(kept_counters["diff_type_conflict"] >= 1, "confirmed cue still counts the type conflict")
|
||||
expect(not kept, "confirmed cue is not re-asked on type conflict")
|
||||
compact = compact_diff_counters(counters)
|
||||
dumped = str(compact)
|
||||
expect("Sushi" not in dumped and "Frau" not in dumped, "compact diff counters carry no plaintext")
|
||||
|
||||
Reference in new issue
Block a user