Skip to content

Commit 47cd760

Browse files
author
TNFR AI Agent
committed
feat: integrate canonical nodal diagnostics
Intent: retain verified structural dynamics and remove plan-only scaffolding. Operators involved: Coherence, Coupling, Resonance, Recursivity. Affected invariants: #1 nodal equation integrity; #2 phase-coherent coupling; #3 multi-scale fractality; #4 grammar compliance; #5 structural metrology; #6 reproducible dynamics. Key changes: integrate transport, tetrad, U6, morphism, winding, cache, provenance, and exact circulant diffusion safeguards; remove dated execution artifacts and rejected experimental paths. Expected risks/dissonances: finite-window and auxiliary-model scopes remain explicit; Recursivity temporal mixing remains network-scale only. Metrics: full suite 3631 passed, 1 skipped; 900 internal Markdown references valid.
1 parent 620fd70 commit 47cd760

68 files changed

Lines changed: 4964 additions & 968 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎benchmarks/emergent_arithmetic_pulse.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(p-1)/2 -- the pulse's spectral_multiplicity field reads (p-1)/2 exactly.
2626
- M3 COMPOSITES ENRICH THE CHORD MULTIPLICATIVELY: the tone-count is
2727
multiplicative (15 -> 9 = 3x3, 45 -> 12 = 4x3), encoding the factorization
28-
TYPE (the ontological-ladder rank, NT theory 9.8).
28+
TYPE (the ontological-ladder rank, NT theory 9.12).
2929
- M4 A PRIME IS MAXIMALLY DEGENERATE: just gcd(k,p-1)+1 tones no matter how
3030
large p is -- mean multiplicity ~ (p-1)/d grows, the chord stays minimal.
3131

‎benchmarks/emergent_fractal_simplex_dimension.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,20 +165,20 @@ def spectral_dimension(eigvals: np.ndarray) -> float:
165165
return -2.0 * float(np.median(slope[k // 4:k - k // 4]))
166166

167167

168-
def _canonical_anchor_ok(G) -> bool:
169-
"""Anchor: hand-built L_sym spectrum == canonical engine spectrum."""
168+
def _canonical_anchor_ok(G) -> bool | None:
169+
"""Anchor: hand-built spectrum equals the canonical engine spectrum."""
170170
try:
171171
from tnfr.physics.structural_diffusion import structural_eigenmodes
172172
except Exception:
173-
return True # engine spectrum unavailable; L_sym stands alone
173+
return None
174174
try:
175175
out = structural_eigenmodes(G)
176176
ev = np.asarray(out[0] if isinstance(out, tuple) else out, float)
177177
mine = np.sort(l_sym_eigvals(G))
178178
ev = np.sort(ev[: len(mine)])
179179
return bool(np.allclose(ev, mine, atol=1e-8))
180180
except Exception:
181-
return True
181+
return None
182182

183183

184184
def main() -> None:
@@ -197,7 +197,8 @@ def main() -> None:
197197
G3, _ = sierpinski_simplex(3, 3)
198198
anchor = _canonical_anchor_ok(G3)
199199
print(f" node-count recurrence N(m,k)=m*N(m,k-1)-C(m,2): {m1_ok}")
200-
print(f" L_sym spectrum == canonical structural_eigenmodes: {anchor}")
200+
anchor_label = "UNAVAILABLE" if anchor is None else str(anchor)
201+
print(f" L_sym spectrum == canonical structural_eigenmodes: {anchor_label}")
201202
assert m1_ok, "self-similar construction node counts are wrong"
202203

203204
# M2 -- DEFINITE similarity dimension, SET BY THE LOCAL GRADE.

‎benchmarks/emergent_musical_nfr.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
python benchmarks/emergent_musical_nfr.py
5151
5252
Theoretical anchor: EMERGENT_ONTOLOGY.md section 5.5 (the pulse); theory/
53-
TNFR_NUMBER_THEORY.md (9.12 the arithmetic pulse, 9.7 the wall);
53+
TNFR_NUMBER_THEORY.md (9.13 the arithmetic pulse, 9.7 the wall);
5454
src/tnfr/physics/structural_diffusion.py (compute_emergent_pulse);
5555
benchmarks/emergent_rhythm.py + inverse_spectrum_to_symmetry.py.
5656
Status: RESEARCH.

‎benchmarks/external_phase_gate_validation.py‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,8 @@
3636

3737
REPO_ROOT = Path(__file__).resolve().parents[1]
3838
SRC_DIR = REPO_ROOT / "src"
39-
sys.path.insert(0, str(SRC_DIR))
40-
41-
loaded_tnfr = sys.modules.get("tnfr")
42-
loaded_path = str(getattr(loaded_tnfr, "__file__", "")) if loaded_tnfr else ""
43-
if loaded_tnfr is not None and not loaded_path.startswith(str(SRC_DIR)):
44-
for name in list(sys.modules):
45-
if name == "tnfr" or name.startswith("tnfr."):
46-
del sys.modules[name]
39+
if str(SRC_DIR) not in sys.path:
40+
sys.path.insert(0, str(SRC_DIR))
4741

4842
import networkx as nx # noqa: E402
4943

‎examples/08_emergent_geometry/155_ontological_position_of_numbers.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
A(m)=prod(e+ceil(e/2)+1) at small exponents -- rho(p)=3 (cyclotomy k=2),
4242
rho(p^2)=4, rho(p^3)=6 -- and is multiplicative there. So primality (rho=3)
4343
and the factorization TYPE (Omega, tau) are read off the spectrum -- the
44-
arithmetic emerges (TNFR_NUMBER_THEORY.md §9.5-9.8).
44+
arithmetic emerges (TNFR_NUMBER_THEORY.md §9.5-9.12).
4545
- Layer 4: rho gives the factorization TYPE, never the prime IDENTITIES (15 and
4646
35 share rho=9); the unannotated scalar rank also aliases at high prime powers
4747
(the §9.7 / ex 154 scalar wall) -- the same e-pi / Fix(S_n)^perp wall as the

‎examples/08_emergent_geometry/156_emergence_directness_law.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def experiment_5_the_law(results):
224224
print()
225225
print(" one law: topological(occupant)=Fix-invariant=DIRECT; spectral(stage)")
226226
print(" =Fix^perp-trapped=PARTIAL(the wall); process=consumes-input=CIRCULAR.")
227-
print(" Unifies the position ladder (155/§9.8), particle classification (§7.1),")
227+
print(" Compares the position ladder (155/§9.12), particle classification (§7.1),")
228228
print(" the Riemann/number wall (§9.5-9.7, §10.5) and the §0 axis under ONE")
229229
print(" principle: representation theory of the coupling's symmetry group.")
230230
print()

‎examples/10_applications/90_phase_gate_monitor_demo.py‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@
1414
import sys
1515
from pathlib import Path
1616

17-
ROOT = Path(__file__).resolve().parents[1]
17+
ROOT = Path(__file__).resolve().parents[2]
1818
SRC = ROOT / "src"
19-
sys.path.insert(0, str(SRC))
20-
21-
loaded_tnfr = sys.modules.get("tnfr")
22-
loaded_path = str(getattr(loaded_tnfr, "__file__", "")) if loaded_tnfr else ""
23-
if loaded_tnfr is not None and not loaded_path.startswith(str(SRC)):
24-
for name in list(sys.modules):
25-
if name == "tnfr" or name.startswith("tnfr."):
26-
del sys.modules[name]
19+
if str(SRC) not in sys.path:
20+
sys.path.insert(0, str(SRC))
2721

2822
import networkx as nx # noqa: E402
2923

‎examples/10_applications/91_breast_cancer_phase_gate_demo.py‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,10 @@
2929
from pathlib import Path
3030
from typing import Any, Mapping
3131

32-
ROOT = Path(__file__).resolve().parents[1]
32+
ROOT = Path(__file__).resolve().parents[2]
3333
SRC = ROOT / "src"
34-
sys.path.insert(0, str(SRC))
35-
36-
loaded_tnfr = sys.modules.get("tnfr")
37-
loaded_path = str(getattr(loaded_tnfr, "__file__", "")) if loaded_tnfr else ""
38-
if loaded_tnfr is not None and not loaded_path.startswith(str(SRC)):
39-
for name in list(sys.modules):
40-
if name == "tnfr" or name.startswith("tnfr."):
41-
del sys.modules[name]
34+
if str(SRC) not in sys.path:
35+
sys.path.insert(0, str(SRC))
4236

4337
import networkx as nx # noqa: E402
4438
from sklearn.datasets import load_breast_cancer # noqa: E402

‎examples/10_applications/92_wine_quality_phase_gate_demo.py‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,10 @@
2626
from typing import Any, Mapping
2727
from urllib.request import urlopen
2828

29-
ROOT = Path(__file__).resolve().parents[1]
29+
ROOT = Path(__file__).resolve().parents[2]
3030
SRC = ROOT / "src"
31-
sys.path.insert(0, str(SRC))
32-
33-
loaded_tnfr = sys.modules.get("tnfr")
34-
loaded_path = str(getattr(loaded_tnfr, "__file__", "")) if loaded_tnfr else ""
35-
if loaded_tnfr is not None and not loaded_path.startswith(str(SRC)):
36-
for name in list(sys.modules):
37-
if name == "tnfr" or name.startswith("tnfr."):
38-
del sys.modules[name]
31+
if str(SRC) not in sys.path:
32+
sys.path.insert(0, str(SRC))
3933

4034
import networkx as nx # noqa: E402
4135
from sklearn.neighbors import NearestNeighbors # noqa: E402

‎examples/10_applications/93_structural_interface_demo.py‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,10 @@
4545
except Exception: # pragma: no cover - best-effort console setup
4646
pass
4747

48-
ROOT = Path(__file__).resolve().parents[1]
48+
ROOT = Path(__file__).resolve().parents[2]
4949
SRC = ROOT / "src"
50-
sys.path.insert(0, str(SRC))
51-
52-
loaded_tnfr = sys.modules.get("tnfr")
53-
loaded_path = str(getattr(loaded_tnfr, "__file__", "")) if loaded_tnfr else ""
54-
if loaded_tnfr is not None and not loaded_path.startswith(str(SRC)):
55-
for name in list(sys.modules):
56-
if name == "tnfr" or name.startswith("tnfr."):
57-
del sys.modules[name]
50+
if str(SRC) not in sys.path:
51+
sys.path.insert(0, str(SRC))
5852

5953
import numpy as np # noqa: E402
6054

0 commit comments

Comments
 (0)