fix: the path step checks the size the code reads

The name step refuses a candidate outside the size an entry validates, but the path step returned any hashless file at the tail as path_exact, a proof slots arbitration trusts. A 32 KB cpc6128.rom at ZEsarUX's tail would have been served for its 48 KB composite. No profile hits it today.
This commit is contained in:
Abdessamad Derraz committed 2026-10-19 23:14:47 +02:00
1 parent adaa1eba87
commit f50773a89f
2 files changed
+30 -1

No files matched your search

+6 -1
View File
@@ -1346,7 +1346,12 @@ def resolve_local_file(
if not os.path.exists(path):
continue
if not has_strong_hash:
if not adler32_fits(file_entry, path, db):
# A path names the file, the size the code checks still
# bounds it, as on the name step: ZEsarUX's 48 KB
# cpc6128.rom is not cap32's 32 KB one at the same tail.
if not name_match_size_ok(
file_entry, files_db[match_sha1].get("size")
) or not adler32_fits(file_entry, path, db):
continue
return path, "path_exact"
status = _record_match_status(match_sha1)