From a82e9b6f7f7141e50567d7d70a1554fe168e0124 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 03:42:42 +0100 Subject: [PATCH] fix: system report reads the claims the pack reads --- scripts/packextras.py | 12 ++++++++++-- tests/test_system_selection.py | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/scripts/packextras.py b/scripts/packextras.py index 0ff7ec119..343827316 100644 --- a/scripts/packextras.py +++ b/scripts/packextras.py @@ -1552,11 +1552,19 @@ def extras_for_systems(extras: list[dict], system_ids: list[str]) -> list[dict]: def report_owned_by_systems(report: list[dict], system_ids: list[str]) -> list[dict]: - """Gap report entries whose extra a pack built with --system carries.""" + """Gap report entries whose extra a pack built with --system carries. + + The other cores whose claim rides on the entry count, as the builder + counts them: MAME 2009's taitofx1.zip went into a --system + panasonic-3do pack for MAME 2016 and was missing from the report. + """ + def owner(entry: dict) -> dict: + return {"source_system": entry.get("system"), "source_systems": entry.get("systems", [])} + return [ u for u in report if extras_for_systems( - [{"source_system": u.get("system"), "source_systems": u.get("systems", [])}], + [{**owner(u), "other_claims": [owner(c) for c in u.get("other_claims", [])]}], system_ids, ) ] diff --git a/tests/test_system_selection.py b/tests/test_system_selection.py index 48ad9eefa..b70436947 100644 --- a/tests/test_system_selection.py +++ b/tests/test_system_selection.py @@ -404,6 +404,32 @@ class AMissingInputFileIsNamed(unittest.TestCase): self._refused(argv, "ERROR: Registry not found: nosuch.yml") +class ASystemReportCountsTheClaimsThePackCounts(unittest.TestCase): + """`--platform retroarch --system panasonic-3do` packed MAME 2009's + taitofx1.zip, which MAME 2016 claims for that system, and the report's + core coverage did not name it: the builder read other_claims, verify + read only the entry's own system.""" + + def test_a_claim_riding_on_an_entry_selects_it(self): + from packextras import extras_for_systems, report_owned_by_systems + + entry = { + "name": "taitofx1.zip", "system": "arcade", "systems": ["arcade"], + "other_claims": [{"name": "taitofx1.zip", "system": None, + "systems": ["arcade", "panasonic-3do"]}], + } + extra = {"source_system": "arcade", "source_systems": ["arcade"], + "other_claims": [{"source_system": None, + "source_systems": ["arcade", "panasonic-3do"]}]} + for system in ("panasonic-3do", "arcade", "sony-playstation"): + with self.subTest(system=system): + self.assertEqual( + bool(report_owned_by_systems([entry], [system])), + bool(extras_for_systems([extra], [system])), + ) + self.assertEqual(report_owned_by_systems([entry], ["panasonic-3do"]), [entry]) + + class StrictVerifyFailsOnACriticalMiss(unittest.TestCase): """verify exited 0 with a required file missing on an md5 platform, so the pipeline printed "verify OK" over a pack the frontend rejects."""