Skip to content

Commit bf3595d

Browse files
authored
Merge pull request #2842 from fermga/copilot/add-canonical-validation-delta-nfr
Add VAL canonical ΔNFR validation configuration defaults
2 parents 06452c1 + 0c6d0f2 commit bf3595d

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- Added canonical ΔNFR validation to VAL (Expansion) operator preconditions.
2+
- Implemented three-tier validation for VAL: νf < max, ΔNFR > 0, and EPI >= min.
3+
- Added configuration parameters: `VAL_MAX_VF`, `VAL_MIN_DNFR`, `VAL_MIN_EPI`, `VAL_CHECK_NETWORK_CAPACITY`, `VAL_MAX_NETWORK_SIZE`.
4+
- Set `VAL_MIN_DNFR` default to `1e-6` (very low threshold to minimize breaking changes while ensuring physical correctness).
5+
- Enhanced error messages to suggest alternative operators (OZ for ΔNFR generation, AL for EPI activation).
6+
- Aligned implementation with TNFR nodal equation ∂EPI/∂t = νf · ΔNFR(t) requiring both νf > 0 and ΔNFR > 0 for coherent expansion.

src/tnfr/config/defaults_core.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ class CoreDefaults:
154154
THOL_MIN_HISTORY_LENGTH: int = 3 # Minimum EPI history for acceleration computation
155155
THOL_ALLOW_ISOLATED: bool = False # Require network context by default
156156

157+
# VAL (Expansion) precondition thresholds
158+
VAL_MAX_VF: float = 10.0 # Maximum structural frequency threshold
159+
VAL_MIN_DNFR: float = 1e-6 # Minimum positive ΔNFR for coherent expansion (very low to minimize breaking changes)
160+
VAL_MIN_EPI: float = 0.2 # Minimum EPI for coherent expansion base
161+
VAL_CHECK_NETWORK_CAPACITY: bool = False # Optional network capacity validation
162+
VAL_MAX_NETWORK_SIZE: int = 1000 # Maximum network size if capacity checking enabled
163+
157164

158165
@dataclass(frozen=True, slots=True)
159166
class RemeshDefaults:

src/tnfr/operators/preconditions/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ def validate_expansion(G: "TNFRGraph", node: "NodeId") -> None:
525525
------------------------
526526
VAL_MAX_VF : float, default 10.0
527527
Maximum structural frequency threshold
528-
VAL_MIN_DNFR : float, default 0.01
529-
Minimum ΔNFR for expansion (must be positive)
528+
VAL_MIN_DNFR : float, default 1e-6
529+
Minimum ΔNFR for expansion (must be positive, very low to minimize breaking changes)
530530
VAL_MIN_EPI : float, default 0.2
531531
Minimum EPI for coherent expansion
532532
VAL_CHECK_NETWORK_CAPACITY : bool, default False
@@ -570,7 +570,7 @@ def validate_expansion(G: "TNFRGraph", node: "NodeId") -> None:
570570

571571
# 2. ΔNFR positivity check (NEW - CRITICAL)
572572
dnfr = _get_node_attr(G, node, ALIAS_DNFR)
573-
min_dnfr = float(G.graph.get("VAL_MIN_DNFR", 0.01))
573+
min_dnfr = float(G.graph.get("VAL_MIN_DNFR", 1e-6))
574574
if dnfr < min_dnfr:
575575
raise OperatorPreconditionError(
576576
"Expansion",

0 commit comments

Comments
 (0)