|
1 | | -"""Canonical grammar and sequence validation for structural operators.""" |
| 1 | +"""Canonical grammar and sequence validation for structural operators. |
| 2 | +
|
| 3 | +This module enforces TNFR canonical grammar rules (R1-R5) to ensure that |
| 4 | +operator sequences respect the fundamental physics of the nodal equation: |
| 5 | +
|
| 6 | + ∂EPI/∂t = νf · ΔNFR(t) |
| 7 | +
|
| 8 | +Grammar Rules (R1-R5) |
| 9 | +--------------------- |
| 10 | +R1: Start operators - Must be able to generate or activate EPI |
| 11 | +R2: Stabilizer requirement - Must contain IL (coherence) or THOL (self-organization) |
| 12 | +R3: End operators - Must stabilize reorganization or achieve operational closure |
| 13 | +R4: Bifurcation control - Transformers (ZHIR/THOL) require recent destabilizer |
| 14 | +R5: Frequency transitions - Must respect structural frequency harmonics |
| 15 | +
|
| 16 | +Physics-Based Operator Derivation |
| 17 | +---------------------------------- |
| 18 | +Unlike earlier versions with arbitrary operator lists, VALID_START_OPERATORS |
| 19 | +and VALID_END_OPERATORS are now derived from TNFR physical principles: |
| 20 | +
|
| 21 | +Start operators can: |
| 22 | +- Generate EPI from null state (emission) |
| 23 | +- Activate latent/dormant EPI (recursivity, transition) |
| 24 | +
|
| 25 | +End operators can: |
| 26 | +- Stabilize reorganization: ∂EPI/∂t → 0 (silence) |
| 27 | +- Achieve operational closure (transition, recursivity, dissonance) |
| 28 | +
|
| 29 | +For detailed physics derivation, see: |
| 30 | +- src/tnfr/config/physics_derivation.py - Derivation functions |
| 31 | +- src/tnfr/config/operator_names.py - Physics rationale |
| 32 | +
|
| 33 | +References |
| 34 | +---------- |
| 35 | +TNFR.pdf: Section 2.1 (Nodal Equation) |
| 36 | +AGENTS.md: Section 3 (Canonical Invariants) |
| 37 | +""" |
| 38 | + |
2 | 39 |
|
3 | 40 | from __future__ import annotations |
4 | 41 |
|
@@ -445,6 +482,12 @@ def __init__( |
445 | 482 | self.health_metrics = health_metrics |
446 | 483 |
|
447 | 484 |
|
| 485 | +# Canonical operator sets are derived from TNFR physics principles. |
| 486 | +# See src/tnfr/config/physics_derivation.py for detailed derivation logic |
| 487 | +# and src/tnfr/config/operator_names.py for the physics-based rationale. |
| 488 | +# |
| 489 | +# VALID_START_OPERATORS: Operators that can generate EPI from null or activate latent EPI |
| 490 | +# VALID_END_OPERATORS: Operators that stabilize reorganization (∂EPI/∂t → 0) or achieve closure |
448 | 491 | _CANONICAL_START = tuple(sorted(VALID_START_OPERATORS)) |
449 | 492 | _CANONICAL_INTERMEDIATE = tuple(sorted(INTERMEDIATE_OPERATORS)) |
450 | 493 | _CANONICAL_END = tuple(sorted(VALID_END_OPERATORS)) |
|
0 commit comments