From c13d5c5368d246f547b1d69c81904283965a32d3 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 9 Oct 2026 22:57:15 +0200 Subject: [PATCH] fix: slots read the one gap scope rule --- scripts/slots.py | 9 +++++---- tests/test_slots.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/scripts/slots.py b/scripts/slots.py index 71c7c77c..02c99db1 100644 --- a/scripts/slots.py +++ b/scripts/slots.py @@ -28,6 +28,7 @@ from common import ( resolve_local_file, runs_standalone, ) +from validation import outside_gap_scope # A profile entry can prove a slot without declaring a hash: Dolphin names no # checksum for the GameCube boot ROM because its source names none, and the @@ -155,10 +156,10 @@ def profile_claims( for entry in profile.get("files") or []: if not isinstance(entry, dict): continue - entry_mode = entry.get("mode") - if entry_mode == "standalone" and not is_standalone: - continue - if entry_mode == "libretro" and is_standalone: + # The same rule as the gap report and the builder: an entry the + # pack never carries (read from the save directory, a + # placeholder, a filename-agnostic scan) arbitrates nothing. + if outside_gap_scope(entry, is_standalone): continue # A member of a romset is not a file at the BIOS root: the archive # holding it is what occupies a destination, and it is declared diff --git a/tests/test_slots.py b/tests/test_slots.py index a2494899..e6e85a94 100644 --- a/tests/test_slots.py +++ b/tests/test_slots.py @@ -183,6 +183,20 @@ class TestConflicts(unittest.TestCase): conflicts = slots.find_conflicts(self._config("m" * 32), profile, REGIONS_DB) self.assertEqual(conflicts, []) + def test_an_entry_the_pack_never_carries_claims_nothing(self): + """A file read from the save directory, declared with the sha1 of + another dump, arbitrated the platform's file off its own path.""" + profile = { + "core": { + "files": [ + {"name": "IPL.bin", "path": "GC/JAP/IPL.bin", "md5": "n" * 32, + "load_from": "save_dir"}, + ] + } + } + conflicts = slots.find_conflicts(self._config("m" * 32), profile, REGIONS_DB) + self.assertEqual(conflicts, []) + def test_a_name_only_resolution_asserts_nothing(self): # No hash and no path that the repository carries: the entry is # answered by filename alone and cannot contradict anything.