From cd92fe5b4db806aebb164ae688c51907ae90787d Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 27 Oct 2026 21:27:16 +0100 Subject: [PATCH] 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. --- schemas/emulator.schema.json | 3 ++- tests/test_campaign.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/schemas/emulator.schema.json b/schemas/emulator.schema.json index cada7d28d..bd8cdf9a4 100644 --- a/schemas/emulator.schema.json +++ b/schemas/emulator.schema.json @@ -487,7 +487,8 @@ "required": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}-[0-9a-f]{12}$"}}, "hle_fallback": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}-[0-9a-f]{12}$"}}, "path": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}-[0-9a-f]{12}$"}}, - "aliases": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}-[0-9a-f]{12}$"}} + "aliases": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}-[0-9a-f]{12}$"}}, + "validation": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}-[0-9a-f]{12}$"}} } }, "adler32_byteswap": { diff --git a/tests/test_campaign.py b/tests/test_campaign.py index e32d5f422..5a5d21343 100644 --- a/tests/test_campaign.py +++ b/tests/test_campaign.py @@ -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, "", ())))