refactor: read hashes and the registry one way

Hash fields go through core.hashing.parse_hash_list, which also splits comma-joined list items: the truth model compared a comma-joined sha256 list as one value. _registry.yml goes through load_platform_registry (required= where an absent file must stop the run), database.json through load_database, file and member digests through file_digest and stream_hashes. download.py and check_release read SHA256SUMS.txt with one parser: a sha256sum -b line matched nothing in download.py and the pack went unchecked.
This commit is contained in:
Abdessamad Derraz committed 2026-11-20 18:28:40 +01:00
1 parent 7cd499531d
commit 348d5b51c3
32 files changed
+130 -217

No files matched your search

+2 -2
View File
@@ -7,6 +7,7 @@ import textwrap
from dataclasses import dataclass, fields
from pathlib import Path
from model.registry import load_platform_registry
from core.paths import REPO_ROOT
from model.safeparse import require_yaml
@@ -344,8 +345,7 @@ def load_guides(path: Path = GUIDES_FILE, registry: dict | None = None) -> dict:
"""
yaml = require_yaml()
if registry is None:
with open(PLATFORMS_DIR / "_registry.yml", encoding="utf-8") as handle:
registry = (yaml.safe_load(handle) or {}).get("platforms", {})
registry = load_platform_registry(PLATFORMS_DIR, required=True)
with open(path, encoding="utf-8") as handle:
data = yaml.safe_load(handle) or {}
if not isinstance(data, dict):