feat: let validation carry campaign evidence

The emulator schema allows evidence under validation, and a test holds the settled fields of the rule table to the schema's evidence keys.
This commit is contained in:
Abdessamad Derraz committed 2026-10-27 21:27:16 +01:00
1 parent e370970363
commit cd92fe5b4d
2 files changed
+7 -1

No files matched your search

+5
View File
@@ -240,6 +240,11 @@ class RuleTable(unittest.TestCase):
verdict = rules.rule_variants([run(rules.BOOTS, "b"), run(rules.HANG, "a")], self.ENTRY)
self.assertEqual((verdict.value, verdict.apply), (["a", "b"], False))
def test_every_settled_field_can_carry_evidence(self) -> None:
schema = json.loads((REPO_ROOT / "schemas" / "emulator.schema.json").read_text())
evidence = schema["properties"]["files"]["items"]["properties"]["evidence"]["properties"]
self.assertEqual(set(rules.SETTLED_FIELDS), set(evidence))
def test_agreement_and_evidence(self) -> None:
self.assertTrue(rules.agrees({"name": "a"}, rules.Verdict("r", "hle_fallback", False, "", ())))
self.assertFalse(rules.agrees({"name": "a"}, rules.Verdict("r", "hle_fallback", True, "", ())))