refactor: read a platform's check mode one way

nativemode.platform_mode(config) replaces the inline
config.get("verification_mode", "existence") of the builder, the
manifest, slots, integrity, extras, gaps, coverage and review. A value
outside the schema enum now falls back to the default everywhere, as
coverage already did. Every platform declares a valid mode.
This commit is contained in:
Abdessamad Derraz committed 2026-11-20 20:03:26 +01:00
1 parent 200f785f67
commit 8f153e2b89
9 files changed
+25 -17

No files matched your search

+5
View File
@@ -57,6 +57,11 @@ def normalize(mode: str | None) -> str:
return mode if mode in MODES else DEFAULT_MODE
def platform_mode(config: dict) -> str:
"""The mode a platform config declares, the schema default when it declares none."""
return normalize(config.get("verification_mode"))
def reads_file_contents(mode: str | None) -> bool:
"""Whether the frontend opens the file rather than just finding it."""
return normalize(mode) in MODE_DIGEST