Corroborate a mixed-script claim in both scripts
A claim written in Chinese and English was checked only in English: the longest Latin words took every slot the rule demands, so one planted English word moved the closing Chinese pair out of the comparison and a witness that contradicted the number became a second source. The attack costs nothing — append "the" to a Chinese sentence — and it fails open, which is the wrong direction for a rule whose whole job is to keep an unvouched claim out of the prompt. Each script is now checked in its own terms: a claim with CJK pairs is demanded at its opening, middle and tail, plus its single most distinctive Latin word. A Latin-only claim keeps its three longest words. The demanded set is what claim_terms returns, all of it. Measured: the planted-word witnesses are no longer believed, a verbatim repeat still is, and a mixed claim that agrees in only one script is not a witness. The term-level boundaries are listed in CHECKLIST for both scripts, including the two the reviewer found that this rule does not catch: a demanded pair inside a longer word, and a long claim whose middle position lands on filler. Also corrects the record: the boundaries were not the same in both scripts as claimed, a historical line said "now" instead of naming a commit, and a limitation line I deleted in the last round is restored. Gates: 322 passed, ruff clean, mypy 24 errors / 9 files (baseline, net zero), pyright 0 on the two touched files, filesize clean, product audit clean.
This commit is contained in:
1 parent
334071199e
commit
8d84e03077
3 files changed
+49
-17
No files matched your search
@@ -223,6 +223,24 @@ def test_a_chinese_instruction_cannot_vouch_for_its_own_characters(settings: Set
|
||||
assert not is_citable(stranger, Database(settings)), "a sentence too short to compare is not believed twice"
|
||||
|
||||
|
||||
def test_one_foreign_latin_word_cannot_drop_the_chinese_assertion(settings: Settings) -> None:
|
||||
stranger = remember(settings, "档案室的恒温器保持十八度 cryptography", origin=MemoryOrigin.third_party, holder="vendor")
|
||||
remember(settings, "档案室的恒温器保持二十六度 cryptography", holder="husband")
|
||||
assert not is_citable(stranger, Database(settings)), "a planted English word must not drop the Chinese assertion from the comparison"
|
||||
repeat = remember(settings, "恒温器很贵 thermodynamics", origin=MemoryOrigin.third_party, holder="dealer")
|
||||
remember(settings, "恒温器很便宜 thermodynamics", holder="wife")
|
||||
assert not is_citable(repeat, Database(settings)), "the CJK positions are demanded beside a Latin word too"
|
||||
|
||||
|
||||
def test_a_mixed_claim_is_corroborated_in_both_scripts(settings: Settings) -> None:
|
||||
claim = "档案室的 thermostat 保持 eighteen 度"
|
||||
stranger = remember(settings, claim, origin=MemoryOrigin.third_party, holder="vendor")
|
||||
remember(settings, "thermostat eighteen 档案", holder="husband")
|
||||
assert not is_citable(stranger, Database(settings)), "agreeing in one script is not agreeing with a claim written in two"
|
||||
remember(settings, claim, holder="wife")
|
||||
assert is_citable(stranger, Database(settings)), "a witness that keeps both scripts is a witness"
|
||||
|
||||
|
||||
def test_a_claim_too_short_to_compare_stays_uncited(settings: Settings) -> None:
|
||||
stranger = remember(settings, "Pineapple answer", origin=MemoryOrigin.third_party, holder="vendor")
|
||||
remember(settings, "Pineapple answer", holder="husband")
|
||||
|
||||
Reference in new issue
Block a user