Repository navigation
Expand file tree
/
Copy path_thol_config.py
More file actions
49 lines (40 loc) · 1.75 KB
/
Copy path_thol_config.py
File metadata and controls
49 lines (40 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""Shared configured THOL policies for execution and detached admission."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from ..config.defaults_core import CORE_DEFAULTS
from ._argument_validation import finite_real
def resolve_thol_min_epi(graph_data: Mapping[str, Any]) -> float:
"""Admit the configured nonnegative minimum form for the strict THOL gate.
A present invalid value rejects instead of falling back to the core default.
This is an execution policy, not a threshold derived from the nodal law or
a complete birth-admission certificate.
"""
return finite_real(
graph_data.get("THOL_MIN_EPI", CORE_DEFAULTS["THOL_MIN_EPI"]),
operator="Self-organization",
label="THOL_MIN_EPI",
lower=0.0,
)
def resolve_thol_bifurcation_threshold(
graph_data: Mapping[str, Any],
requested: Any = None,
*,
operator: str = "Self-organization",
) -> float:
"""Resolve explicit tau, generic alias, THOL alias, then the core default.
``None`` means no explicit/generic override. A present THOL-specific value
must itself be valid; invalid values never silently fall through. The
threshold is nonnegative, finite and non-boolean. This resolves configured
policy, not a threshold derived from the nodal equation or a birth promise.
OZ and ZHIR have different contracts and are outside this resolver.
"""
value = requested
if value is None:
value = graph_data.get("BIFURCATION_THRESHOLD_TAU")
if value is None:
value = graph_data.get(
"THOL_BIFURCATION_THRESHOLD",
CORE_DEFAULTS["THOL_BIFURCATION_THRESHOLD"],
)
return finite_real(value, operator=operator, label="tau", lower=0.0)