fix(maf): harden phase 5 approval safety

This commit is contained in:
董宏凯 committed 2026-08-02 14:32:49 +08:00
1 parent f82363d81f
commit a55992e31c
11 files changed
+489 -146

No files matched your search

@@ -223,7 +223,11 @@ def derive_target_key(
def _is_stable_scalar(value: Any) -> bool:
"""Whether a configured target field can safely identify one target."""
if value is None or isinstance(value, (str, bool, int)):
if isinstance(value, str):
return bool(value.strip())
if value is None:
return False
if isinstance(value, (bool, int)):
return True
return isinstance(value, float) and isfinite(value)