tnfr 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (535) hide show
  1. tnfr-0.0.1/.env.example +59 -0
  2. tnfr-0.0.1/.github/EXTENSION_TEMPLATE.md +405 -0
  3. tnfr-0.0.1/.github/ISSUE_TEMPLATE/domain_extension.yml +146 -0
  4. tnfr-0.0.1/.github/ISSUE_TEMPLATE/new_domain_pattern.yml +113 -0
  5. tnfr-0.0.1/.github/ISSUE_TEMPLATE/performance_issue.yml +143 -0
  6. tnfr-0.0.1/.github/WORKFLOWS.md +152 -0
  7. tnfr-0.0.1/.github/agents/my-agent.md +792 -0
  8. tnfr-0.0.1/.github/dependabot.yml +131 -0
  9. tnfr-0.0.1/.github/pull_request_template.md +121 -0
  10. tnfr-0.0.1/.github/todo_list.json +28 -0
  11. tnfr-0.0.1/.github/workflows/ci.yml +148 -0
  12. tnfr-0.0.1/.github/workflows/code-review.yml +67 -0
  13. tnfr-0.0.1/.github/workflows/codeql-analysis.yml +54 -0
  14. tnfr-0.0.1/.github/workflows/copilot-setup-steps.yml +38 -0
  15. tnfr-0.0.1/.github/workflows/deploy-docs.yml +61 -0
  16. tnfr-0.0.1/.github/workflows/docs.yml +70 -0
  17. tnfr-0.0.1/.github/workflows/lint-workflows.yml +48 -0
  18. tnfr-0.0.1/.github/workflows/performance-regression.yml +39 -0
  19. tnfr-0.0.1/.github/workflows/pip-audit.yml +88 -0
  20. tnfr-0.0.1/.github/workflows/pypi-zenodo.yml +52 -0
  21. tnfr-0.0.1/.github/workflows/regression-smoke.yml +63 -0
  22. tnfr-0.0.1/.github/workflows/release.yml +226 -0
  23. tnfr-0.0.1/.github/workflows/reproducibility.yml +75 -0
  24. tnfr-0.0.1/.github/workflows/sast-lint.yml +118 -0
  25. tnfr-0.0.1/.github/workflows/tests.yml +28 -0
  26. tnfr-0.0.1/.github/workflows/verify-references.yml +48 -0
  27. tnfr-0.0.1/.semgrep.yaml +15 -0
  28. tnfr-0.0.1/.vscode/settings.json +3 -0
  29. tnfr-0.0.1/.vscode/tasks.json +313 -0
  30. tnfr-0.0.1/.zenodo.json +60 -0
  31. tnfr-0.0.1/CITATION.cff +42 -0
  32. tnfr-0.0.1/LICENSE.md +97 -0
  33. tnfr-0.0.1/MANIFEST.in +66 -0
  34. tnfr-0.0.1/PKG-INFO +649 -0
  35. tnfr-0.0.1/README.md +520 -0
  36. tnfr-0.0.1/examples/01_hello_world.py +162 -0
  37. tnfr-0.0.1/examples/02_musical_resonance.py +294 -0
  38. tnfr-0.0.1/examples/03_network_formation.py +290 -0
  39. tnfr-0.0.1/examples/04_operator_sequences.py +242 -0
  40. tnfr-0.0.1/examples/05_coherence_evolution.py +223 -0
  41. tnfr-0.0.1/examples/06_network_topologies.py +347 -0
  42. tnfr-0.0.1/examples/07_phase_transitions.py +496 -0
  43. tnfr-0.0.1/examples/08_emergent_phenomena.py +526 -0
  44. tnfr-0.0.1/examples/09_visualization_suite.py +596 -0
  45. tnfr-0.0.1/examples/10_simplified_sdk_showcase.py +178 -0
  46. tnfr-0.0.1/examples/README.md +176 -0
  47. tnfr-0.0.1/make.cmd +4 -0
  48. tnfr-0.0.1/optimized_self_engine.py +349 -0
  49. tnfr-0.0.1/pyproject.toml +301 -0
  50. tnfr-0.0.1/scripts/README.md +254 -0
  51. tnfr-0.0.1/scripts/check_changelog.py +142 -0
  52. tnfr-0.0.1/scripts/check_language.py +267 -0
  53. tnfr-0.0.1/scripts/compare_manifests.py +62 -0
  54. tnfr-0.0.1/scripts/generate_stubs.py +249 -0
  55. tnfr-0.0.1/scripts/run_reproducible_benchmarks.py +346 -0
  56. tnfr-0.0.1/scripts/run_tests.sh +14 -0
  57. tnfr-0.0.1/scripts/sync-readme-docs.py +78 -0
  58. tnfr-0.0.1/scripts/tnfr_is_prime.py +92 -0
  59. tnfr-0.0.1/scripts/verify_internal_references.py +162 -0
  60. tnfr-0.0.1/scripts/windows_make.py +200 -0
  61. tnfr-0.0.1/setup.cfg +4 -0
  62. tnfr-0.0.1/src/tnfr/__init__.py +428 -0
  63. tnfr-0.0.1/src/tnfr/__init__.pyi +33 -0
  64. tnfr-0.0.1/src/tnfr/_compat.py +10 -0
  65. tnfr-0.0.1/src/tnfr/_generated_version.py +34 -0
  66. tnfr-0.0.1/src/tnfr/_version.py +3 -0
  67. tnfr-0.0.1/src/tnfr/_version.pyi +7 -0
  68. tnfr-0.0.1/src/tnfr/alias.py +704 -0
  69. tnfr-0.0.1/src/tnfr/alias.pyi +108 -0
  70. tnfr-0.0.1/src/tnfr/backends/README.md +26 -0
  71. tnfr-0.0.1/src/tnfr/backends/__init__.py +350 -0
  72. tnfr-0.0.1/src/tnfr/backends/jax_backend.py +172 -0
  73. tnfr-0.0.1/src/tnfr/backends/numpy_backend.py +238 -0
  74. tnfr-0.0.1/src/tnfr/backends/optimized_numpy.py +420 -0
  75. tnfr-0.0.1/src/tnfr/backends/torch_backend.py +381 -0
  76. tnfr-0.0.1/src/tnfr/cache.py +174 -0
  77. tnfr-0.0.1/src/tnfr/cache.pyi +13 -0
  78. tnfr-0.0.1/src/tnfr/cli/README.md +22 -0
  79. tnfr-0.0.1/src/tnfr/cli/__init__.py +110 -0
  80. tnfr-0.0.1/src/tnfr/cli/__init__.pyi +26 -0
  81. tnfr-0.0.1/src/tnfr/cli/arguments.py +482 -0
  82. tnfr-0.0.1/src/tnfr/cli/arguments.pyi +27 -0
  83. tnfr-0.0.1/src/tnfr/cli/execution.py +891 -0
  84. tnfr-0.0.1/src/tnfr/cli/execution.pyi +70 -0
  85. tnfr-0.0.1/src/tnfr/cli/interactive_validator.py +605 -0
  86. tnfr-0.0.1/src/tnfr/cli/utils.py +51 -0
  87. tnfr-0.0.1/src/tnfr/cli/utils.pyi +7 -0
  88. tnfr-0.0.1/src/tnfr/cli/validate.py +0 -0
  89. tnfr-0.0.1/src/tnfr/compat/README.md +13 -0
  90. tnfr-0.0.1/src/tnfr/compat/__init__.py +85 -0
  91. tnfr-0.0.1/src/tnfr/compat/dataclass.py +136 -0
  92. tnfr-0.0.1/src/tnfr/compat/jsonschema_stub.py +57 -0
  93. tnfr-0.0.1/src/tnfr/compat/matplotlib_stub.py +73 -0
  94. tnfr-0.0.1/src/tnfr/compat/numpy_stub.py +145 -0
  95. tnfr-0.0.1/src/tnfr/config/README.md +13 -0
  96. tnfr-0.0.1/src/tnfr/config/__init__.py +243 -0
  97. tnfr-0.0.1/src/tnfr/config/__init__.pyi +10 -0
  98. tnfr-0.0.1/src/tnfr/config/constants.py +104 -0
  99. tnfr-0.0.1/src/tnfr/config/constants.pyi +12 -0
  100. tnfr-0.0.1/src/tnfr/config/defaults.py +54 -0
  101. tnfr-0.0.1/src/tnfr/config/defaults_core.py +278 -0
  102. tnfr-0.0.1/src/tnfr/config/defaults_init.py +34 -0
  103. tnfr-0.0.1/src/tnfr/config/defaults_metric.py +104 -0
  104. tnfr-0.0.1/src/tnfr/config/feature_flags.py +79 -0
  105. tnfr-0.0.1/src/tnfr/config/feature_flags.pyi +16 -0
  106. tnfr-0.0.1/src/tnfr/config/glyph_constants.py +31 -0
  107. tnfr-0.0.1/src/tnfr/config/init.py +77 -0
  108. tnfr-0.0.1/src/tnfr/config/init.pyi +8 -0
  109. tnfr-0.0.1/src/tnfr/config/operator_names.py +250 -0
  110. tnfr-0.0.1/src/tnfr/config/operator_names.pyi +36 -0
  111. tnfr-0.0.1/src/tnfr/config/physics_derivation.py +354 -0
  112. tnfr-0.0.1/src/tnfr/config/precision_modes.py +164 -0
  113. tnfr-0.0.1/src/tnfr/config/presets.py +83 -0
  114. tnfr-0.0.1/src/tnfr/config/presets.pyi +7 -0
  115. tnfr-0.0.1/src/tnfr/config/security.py +918 -0
  116. tnfr-0.0.1/src/tnfr/config/thresholds.py +120 -0
  117. tnfr-0.0.1/src/tnfr/config/tnfr_config.py +492 -0
  118. tnfr-0.0.1/src/tnfr/constants/__init__.py +92 -0
  119. tnfr-0.0.1/src/tnfr/constants/__init__.pyi +90 -0
  120. tnfr-0.0.1/src/tnfr/constants/aliases.py +33 -0
  121. tnfr-0.0.1/src/tnfr/constants/aliases.pyi +27 -0
  122. tnfr-0.0.1/src/tnfr/constants/canonical.py +941 -0
  123. tnfr-0.0.1/src/tnfr/constants/init.py +33 -0
  124. tnfr-0.0.1/src/tnfr/constants/init.pyi +12 -0
  125. tnfr-0.0.1/src/tnfr/constants/metric.py +104 -0
  126. tnfr-0.0.1/src/tnfr/constants/metric.pyi +19 -0
  127. tnfr-0.0.1/src/tnfr/core/README.md +13 -0
  128. tnfr-0.0.1/src/tnfr/core/__init__.py +33 -0
  129. tnfr-0.0.1/src/tnfr/core/container.py +224 -0
  130. tnfr-0.0.1/src/tnfr/core/default_implementations.py +327 -0
  131. tnfr-0.0.1/src/tnfr/core/interfaces.py +279 -0
  132. tnfr-0.0.1/src/tnfr/dynamics/README.md +45 -0
  133. tnfr-0.0.1/src/tnfr/dynamics/__init__.py +238 -0
  134. tnfr-0.0.1/src/tnfr/dynamics/__init__.pyi +83 -0
  135. tnfr-0.0.1/src/tnfr/dynamics/adaptation.py +263 -0
  136. tnfr-0.0.1/src/tnfr/dynamics/adaptation.pyi +7 -0
  137. tnfr-0.0.1/src/tnfr/dynamics/adaptive_sequences.py +185 -0
  138. tnfr-0.0.1/src/tnfr/dynamics/adaptive_sequences.pyi +14 -0
  139. tnfr-0.0.1/src/tnfr/dynamics/adelic.py +357 -0
  140. tnfr-0.0.1/src/tnfr/dynamics/advanced_cache_optimizer.py +630 -0
  141. tnfr-0.0.1/src/tnfr/dynamics/advanced_fft_arithmetic.py +656 -0
  142. tnfr-0.0.1/src/tnfr/dynamics/aliases.py +23 -0
  143. tnfr-0.0.1/src/tnfr/dynamics/aliases.pyi +19 -0
  144. tnfr-0.0.1/src/tnfr/dynamics/bifurcation.py +240 -0
  145. tnfr-0.0.1/src/tnfr/dynamics/cache_aware_fft_engine.py +528 -0
  146. tnfr-0.0.1/src/tnfr/dynamics/canonical.py +484 -0
  147. tnfr-0.0.1/src/tnfr/dynamics/canonical.pyi +48 -0
  148. tnfr-0.0.1/src/tnfr/dynamics/computational_hub.py +571 -0
  149. tnfr-0.0.1/src/tnfr/dynamics/coordination.py +377 -0
  150. tnfr-0.0.1/src/tnfr/dynamics/coordination.pyi +25 -0
  151. tnfr-0.0.1/src/tnfr/dynamics/dnfr.py +3035 -0
  152. tnfr-0.0.1/src/tnfr/dynamics/dnfr.pyi +26 -0
  153. tnfr-0.0.1/src/tnfr/dynamics/dynamic_limits.py +240 -0
  154. tnfr-0.0.1/src/tnfr/dynamics/emergent_centralization.py +615 -0
  155. tnfr-0.0.1/src/tnfr/dynamics/emergent_integration_engine.py +685 -0
  156. tnfr-0.0.1/src/tnfr/dynamics/emergent_mathematical_patterns.py +636 -0
  157. tnfr-0.0.1/src/tnfr/dynamics/feedback.py +270 -0
  158. tnfr-0.0.1/src/tnfr/dynamics/feedback.pyi +24 -0
  159. tnfr-0.0.1/src/tnfr/dynamics/fft_cache_coordinator.py +293 -0
  160. tnfr-0.0.1/src/tnfr/dynamics/fft_engine.py +410 -0
  161. tnfr-0.0.1/src/tnfr/dynamics/fused_dnfr.py +411 -0
  162. tnfr-0.0.1/src/tnfr/dynamics/homeostasis.py +156 -0
  163. tnfr-0.0.1/src/tnfr/dynamics/homeostasis.pyi +14 -0
  164. tnfr-0.0.1/src/tnfr/dynamics/integrators.py +1179 -0
  165. tnfr-0.0.1/src/tnfr/dynamics/integrators.pyi +36 -0
  166. tnfr-0.0.1/src/tnfr/dynamics/learning.py +308 -0
  167. tnfr-0.0.1/src/tnfr/dynamics/learning.pyi +33 -0
  168. tnfr-0.0.1/src/tnfr/dynamics/metabolism.py +263 -0
  169. tnfr-0.0.1/src/tnfr/dynamics/multi_modal_cache.py +551 -0
  170. tnfr-0.0.1/src/tnfr/dynamics/nbody.py +790 -0
  171. tnfr-0.0.1/src/tnfr/dynamics/nbody_tnfr.py +762 -0
  172. tnfr-0.0.1/src/tnfr/dynamics/nodal_optimizer.py +393 -0
  173. tnfr-0.0.1/src/tnfr/dynamics/optimization_orchestrator.py +562 -0
  174. tnfr-0.0.1/src/tnfr/dynamics/propagation.py +317 -0
  175. tnfr-0.0.1/src/tnfr/dynamics/runtime.py +888 -0
  176. tnfr-0.0.1/src/tnfr/dynamics/runtime.pyi +77 -0
  177. tnfr-0.0.1/src/tnfr/dynamics/sampling.py +36 -0
  178. tnfr-0.0.1/src/tnfr/dynamics/sampling.pyi +7 -0
  179. tnfr-0.0.1/src/tnfr/dynamics/selectors.py +671 -0
  180. tnfr-0.0.1/src/tnfr/dynamics/selectors.pyi +83 -0
  181. tnfr-0.0.1/src/tnfr/dynamics/self_optimizing_engine.py +740 -0
  182. tnfr-0.0.1/src/tnfr/dynamics/spectral_structural_fusion.py +131 -0
  183. tnfr-0.0.1/src/tnfr/dynamics/structural_cache.py +474 -0
  184. tnfr-0.0.1/src/tnfr/dynamics/structural_clip.py +215 -0
  185. tnfr-0.0.1/src/tnfr/dynamics/unified_backend.py +508 -0
  186. tnfr-0.0.1/src/tnfr/dynamics/unified_mathematical_cache_orchestrator.py +469 -0
  187. tnfr-0.0.1/src/tnfr/engines/README.md +79 -0
  188. tnfr-0.0.1/src/tnfr/engines/__init__.py +71 -0
  189. tnfr-0.0.1/src/tnfr/engines/computation/__init__.py +28 -0
  190. tnfr-0.0.1/src/tnfr/engines/computation/fft_engine.py +410 -0
  191. tnfr-0.0.1/src/tnfr/engines/computation/gpu_engine.py +413 -0
  192. tnfr-0.0.1/src/tnfr/engines/integration/__init__.py +21 -0
  193. tnfr-0.0.1/src/tnfr/engines/integration/emergent_integration.py +685 -0
  194. tnfr-0.0.1/src/tnfr/engines/pattern_discovery/__init__.py +28 -0
  195. tnfr-0.0.1/src/tnfr/engines/pattern_discovery/mathematical_patterns.py +636 -0
  196. tnfr-0.0.1/src/tnfr/engines/pattern_discovery/operator_patterns.py +632 -0
  197. tnfr-0.0.1/src/tnfr/engines/self_optimization/__init__.py +19 -0
  198. tnfr-0.0.1/src/tnfr/engines/self_optimization/engine.py +740 -0
  199. tnfr-0.0.1/src/tnfr/errors/__init__.py +37 -0
  200. tnfr-0.0.1/src/tnfr/errors/contextual.py +486 -0
  201. tnfr-0.0.1/src/tnfr/examples_utils/README.md +13 -0
  202. tnfr-0.0.1/src/tnfr/examples_utils/__init__.py +23 -0
  203. tnfr-0.0.1/src/tnfr/examples_utils/demo_sequences.py +383 -0
  204. tnfr-0.0.1/src/tnfr/examples_utils/html.py +64 -0
  205. tnfr-0.0.1/src/tnfr/execution.py +219 -0
  206. tnfr-0.0.1/src/tnfr/execution.pyi +41 -0
  207. tnfr-0.0.1/src/tnfr/flatten/README.md +13 -0
  208. tnfr-0.0.1/src/tnfr/flatten.py +261 -0
  209. tnfr-0.0.1/src/tnfr/flatten.pyi +21 -0
  210. tnfr-0.0.1/src/tnfr/gamma/README.md +10 -0
  211. tnfr-0.0.1/src/tnfr/gamma.py +406 -0
  212. tnfr-0.0.1/src/tnfr/gamma.pyi +30 -0
  213. tnfr-0.0.1/src/tnfr/glyph_history/README.md +9 -0
  214. tnfr-0.0.1/src/tnfr/glyph_history.py +377 -0
  215. tnfr-0.0.1/src/tnfr/glyph_history.pyi +31 -0
  216. tnfr-0.0.1/src/tnfr/glyph_runtime/README.md +9 -0
  217. tnfr-0.0.1/src/tnfr/glyph_runtime.py +19 -0
  218. tnfr-0.0.1/src/tnfr/glyph_runtime.pyi +8 -0
  219. tnfr-0.0.1/src/tnfr/immutable/README.md +9 -0
  220. tnfr-0.0.1/src/tnfr/immutable.py +211 -0
  221. tnfr-0.0.1/src/tnfr/immutable.pyi +36 -0
  222. tnfr-0.0.1/src/tnfr/initialization/README.md +10 -0
  223. tnfr-0.0.1/src/tnfr/initialization.py +203 -0
  224. tnfr-0.0.1/src/tnfr/initialization.pyi +65 -0
  225. tnfr-0.0.1/src/tnfr/io/README.md +9 -0
  226. tnfr-0.0.1/src/tnfr/io.py +10 -0
  227. tnfr-0.0.1/src/tnfr/io.pyi +13 -0
  228. tnfr-0.0.1/src/tnfr/locking.py +37 -0
  229. tnfr-0.0.1/src/tnfr/locking.pyi +7 -0
  230. tnfr-0.0.1/src/tnfr/math/README.md +301 -0
  231. tnfr-0.0.1/src/tnfr/math/__init__.py +53 -0
  232. tnfr-0.0.1/src/tnfr/math/fields_symbolic.py +202 -0
  233. tnfr-0.0.1/src/tnfr/math/grammar_validators.py +217 -0
  234. tnfr-0.0.1/src/tnfr/math/optimizer.py +100 -0
  235. tnfr-0.0.1/src/tnfr/math/symbolic.py +388 -0
  236. tnfr-0.0.1/src/tnfr/mathematics/README.md +359 -0
  237. tnfr-0.0.1/src/tnfr/mathematics/__init__.py +143 -0
  238. tnfr-0.0.1/src/tnfr/mathematics/backend.py +441 -0
  239. tnfr-0.0.1/src/tnfr/mathematics/backend.pyi +91 -0
  240. tnfr-0.0.1/src/tnfr/mathematics/dynamics.py +404 -0
  241. tnfr-0.0.1/src/tnfr/mathematics/dynamics.pyi +90 -0
  242. tnfr-0.0.1/src/tnfr/mathematics/epi.py +371 -0
  243. tnfr-0.0.1/src/tnfr/mathematics/epi.pyi +65 -0
  244. tnfr-0.0.1/src/tnfr/mathematics/generators.py +226 -0
  245. tnfr-0.0.1/src/tnfr/mathematics/generators.pyi +27 -0
  246. tnfr-0.0.1/src/tnfr/mathematics/liouville.py +284 -0
  247. tnfr-0.0.1/src/tnfr/mathematics/metrics.py +120 -0
  248. tnfr-0.0.1/src/tnfr/mathematics/metrics.pyi +16 -0
  249. tnfr-0.0.1/src/tnfr/mathematics/number_theory.py +1632 -0
  250. tnfr-0.0.1/src/tnfr/mathematics/operators.py +236 -0
  251. tnfr-0.0.1/src/tnfr/mathematics/operators.pyi +59 -0
  252. tnfr-0.0.1/src/tnfr/mathematics/operators_factory.py +123 -0
  253. tnfr-0.0.1/src/tnfr/mathematics/operators_factory.pyi +11 -0
  254. tnfr-0.0.1/src/tnfr/mathematics/projection.py +85 -0
  255. tnfr-0.0.1/src/tnfr/mathematics/projection.pyi +33 -0
  256. tnfr-0.0.1/src/tnfr/mathematics/runtime.py +176 -0
  257. tnfr-0.0.1/src/tnfr/mathematics/runtime.pyi +64 -0
  258. tnfr-0.0.1/src/tnfr/mathematics/spaces.py +248 -0
  259. tnfr-0.0.1/src/tnfr/mathematics/spaces.pyi +83 -0
  260. tnfr-0.0.1/src/tnfr/mathematics/spectral.py +189 -0
  261. tnfr-0.0.1/src/tnfr/mathematics/transforms.py +303 -0
  262. tnfr-0.0.1/src/tnfr/mathematics/transforms.pyi +62 -0
  263. tnfr-0.0.1/src/tnfr/mathematics/zeta.py +133 -0
  264. tnfr-0.0.1/src/tnfr/metrics/README.md +14 -0
  265. tnfr-0.0.1/src/tnfr/metrics/__init__.py +91 -0
  266. tnfr-0.0.1/src/tnfr/metrics/__init__.pyi +20 -0
  267. tnfr-0.0.1/src/tnfr/metrics/buffer_cache.py +163 -0
  268. tnfr-0.0.1/src/tnfr/metrics/buffer_cache.pyi +24 -0
  269. tnfr-0.0.1/src/tnfr/metrics/cache_utils.py +214 -0
  270. tnfr-0.0.1/src/tnfr/metrics/coherence.py +1983 -0
  271. tnfr-0.0.1/src/tnfr/metrics/coherence.pyi +127 -0
  272. tnfr-0.0.1/src/tnfr/metrics/common.py +156 -0
  273. tnfr-0.0.1/src/tnfr/metrics/common.pyi +35 -0
  274. tnfr-0.0.1/src/tnfr/metrics/core.py +316 -0
  275. tnfr-0.0.1/src/tnfr/metrics/core.pyi +13 -0
  276. tnfr-0.0.1/src/tnfr/metrics/diagnosis.py +817 -0
  277. tnfr-0.0.1/src/tnfr/metrics/diagnosis.pyi +84 -0
  278. tnfr-0.0.1/src/tnfr/metrics/emergence.py +243 -0
  279. tnfr-0.0.1/src/tnfr/metrics/export.py +173 -0
  280. tnfr-0.0.1/src/tnfr/metrics/export.pyi +7 -0
  281. tnfr-0.0.1/src/tnfr/metrics/glyph_timing.py +371 -0
  282. tnfr-0.0.1/src/tnfr/metrics/glyph_timing.pyi +81 -0
  283. tnfr-0.0.1/src/tnfr/metrics/learning_metrics.py +277 -0
  284. tnfr-0.0.1/src/tnfr/metrics/learning_metrics.pyi +21 -0
  285. tnfr-0.0.1/src/tnfr/metrics/local_coherence.py +50 -0
  286. tnfr-0.0.1/src/tnfr/metrics/phase_coherence.py +349 -0
  287. tnfr-0.0.1/src/tnfr/metrics/phase_compatibility.py +349 -0
  288. tnfr-0.0.1/src/tnfr/metrics/reporting.py +179 -0
  289. tnfr-0.0.1/src/tnfr/metrics/reporting.pyi +23 -0
  290. tnfr-0.0.1/src/tnfr/metrics/sense_index.py +1192 -0
  291. tnfr-0.0.1/src/tnfr/metrics/sense_index.pyi +9 -0
  292. tnfr-0.0.1/src/tnfr/metrics/telemetry.py +542 -0
  293. tnfr-0.0.1/src/tnfr/metrics/tetrad.py +192 -0
  294. tnfr-0.0.1/src/tnfr/metrics/trig.py +359 -0
  295. tnfr-0.0.1/src/tnfr/metrics/trig.pyi +13 -0
  296. tnfr-0.0.1/src/tnfr/metrics/trig_cache.py +233 -0
  297. tnfr-0.0.1/src/tnfr/metrics/trig_cache.pyi +10 -0
  298. tnfr-0.0.1/src/tnfr/multiscale/README.md +10 -0
  299. tnfr-0.0.1/src/tnfr/multiscale/__init__.py +32 -0
  300. tnfr-0.0.1/src/tnfr/multiscale/hierarchical.py +505 -0
  301. tnfr-0.0.1/src/tnfr/node/README.md +9 -0
  302. tnfr-0.0.1/src/tnfr/node.py +737 -0
  303. tnfr-0.0.1/src/tnfr/node.pyi +139 -0
  304. tnfr-0.0.1/src/tnfr/observers/README.md +10 -0
  305. tnfr-0.0.1/src/tnfr/observers.py +272 -0
  306. tnfr-0.0.1/src/tnfr/observers.pyi +31 -0
  307. tnfr-0.0.1/src/tnfr/ontosim.py +142 -0
  308. tnfr-0.0.1/src/tnfr/ontosim.pyi +28 -0
  309. tnfr-0.0.1/src/tnfr/operators/README.md +143 -0
  310. tnfr-0.0.1/src/tnfr/operators/__init__.py +1636 -0
  311. tnfr-0.0.1/src/tnfr/operators/__init__.pyi +31 -0
  312. tnfr-0.0.1/src/tnfr/operators/algebra.py +287 -0
  313. tnfr-0.0.1/src/tnfr/operators/canonical_patterns.py +163 -0
  314. tnfr-0.0.1/src/tnfr/operators/cascade.py +306 -0
  315. tnfr-0.0.1/src/tnfr/operators/coherence.py +299 -0
  316. tnfr-0.0.1/src/tnfr/operators/contraction.py +49 -0
  317. tnfr-0.0.1/src/tnfr/operators/coupling.py +63 -0
  318. tnfr-0.0.1/src/tnfr/operators/cycle_detection.py +357 -0
  319. tnfr-0.0.1/src/tnfr/operators/definitions.py +76 -0
  320. tnfr-0.0.1/src/tnfr/operators/definitions.py.CRITICAL_BACKUP +4119 -0
  321. tnfr-0.0.1/src/tnfr/operators/definitions.pyi +78 -0
  322. tnfr-0.0.1/src/tnfr/operators/definitions_base.py +203 -0
  323. tnfr-0.0.1/src/tnfr/operators/dissonance.py +103 -0
  324. tnfr-0.0.1/src/tnfr/operators/emission.py +318 -0
  325. tnfr-0.0.1/src/tnfr/operators/expansion.py +57 -0
  326. tnfr-0.0.1/src/tnfr/operators/grammar.py +280 -0
  327. tnfr-0.0.1/src/tnfr/operators/grammar.pyi +138 -0
  328. tnfr-0.0.1/src/tnfr/operators/grammar_application.py +196 -0
  329. tnfr-0.0.1/src/tnfr/operators/grammar_context.py +147 -0
  330. tnfr-0.0.1/src/tnfr/operators/grammar_core.py +967 -0
  331. tnfr-0.0.1/src/tnfr/operators/grammar_error_factory.py +260 -0
  332. tnfr-0.0.1/src/tnfr/operators/grammar_memoization.py +256 -0
  333. tnfr-0.0.1/src/tnfr/operators/grammar_patterns.py +868 -0
  334. tnfr-0.0.1/src/tnfr/operators/grammar_telemetry.py +260 -0
  335. tnfr-0.0.1/src/tnfr/operators/grammar_types.py +541 -0
  336. tnfr-0.0.1/src/tnfr/operators/grammar_u6.py +148 -0
  337. tnfr-0.0.1/src/tnfr/operators/grammar_validate.py +114 -0
  338. tnfr-0.0.1/src/tnfr/operators/hamiltonian.py +708 -0
  339. tnfr-0.0.1/src/tnfr/operators/health_analyzer.py +796 -0
  340. tnfr-0.0.1/src/tnfr/operators/introspection.py +209 -0
  341. tnfr-0.0.1/src/tnfr/operators/jitter.py +270 -0
  342. tnfr-0.0.1/src/tnfr/operators/jitter.pyi +11 -0
  343. tnfr-0.0.1/src/tnfr/operators/lifecycle.py +315 -0
  344. tnfr-0.0.1/src/tnfr/operators/metabolism.py +617 -0
  345. tnfr-0.0.1/src/tnfr/operators/metrics.py +63 -0
  346. tnfr-0.0.1/src/tnfr/operators/metrics_basic.py +522 -0
  347. tnfr-0.0.1/src/tnfr/operators/metrics_core.py +89 -0
  348. tnfr-0.0.1/src/tnfr/operators/metrics_network.py +692 -0
  349. tnfr-0.0.1/src/tnfr/operators/metrics_structural.py +1091 -0
  350. tnfr-0.0.1/src/tnfr/operators/metrics_u6.py +185 -0
  351. tnfr-0.0.1/src/tnfr/operators/mutation.py +164 -0
  352. tnfr-0.0.1/src/tnfr/operators/network_analysis/__init__.py +27 -0
  353. tnfr-0.0.1/src/tnfr/operators/network_analysis/source_detection.py +188 -0
  354. tnfr-0.0.1/src/tnfr/operators/nodal_equation.py +391 -0
  355. tnfr-0.0.1/src/tnfr/operators/pattern_detection.py +632 -0
  356. tnfr-0.0.1/src/tnfr/operators/patterns.py +656 -0
  357. tnfr-0.0.1/src/tnfr/operators/postconditions/__init__.py +38 -0
  358. tnfr-0.0.1/src/tnfr/operators/postconditions/mutation.py +244 -0
  359. tnfr-0.0.1/src/tnfr/operators/preconditions/__init__.py +1222 -0
  360. tnfr-0.0.1/src/tnfr/operators/preconditions/coherence.py +301 -0
  361. tnfr-0.0.1/src/tnfr/operators/preconditions/dissonance.py +234 -0
  362. tnfr-0.0.1/src/tnfr/operators/preconditions/emission.py +126 -0
  363. tnfr-0.0.1/src/tnfr/operators/preconditions/mutation.py +573 -0
  364. tnfr-0.0.1/src/tnfr/operators/preconditions/reception.py +125 -0
  365. tnfr-0.0.1/src/tnfr/operators/preconditions/resonance.py +361 -0
  366. tnfr-0.0.1/src/tnfr/operators/reception.py +71 -0
  367. tnfr-0.0.1/src/tnfr/operators/recursivity.py +49 -0
  368. tnfr-0.0.1/src/tnfr/operators/registry.py +155 -0
  369. tnfr-0.0.1/src/tnfr/operators/registry.pyi +9 -0
  370. tnfr-0.0.1/src/tnfr/operators/remesh.py +1802 -0
  371. tnfr-0.0.1/src/tnfr/operators/remesh.pyi +26 -0
  372. tnfr-0.0.1/src/tnfr/operators/resonance.py +50 -0
  373. tnfr-0.0.1/src/tnfr/operators/self_organization.py +333 -0
  374. tnfr-0.0.1/src/tnfr/operators/silence.py +78 -0
  375. tnfr-0.0.1/src/tnfr/operators/structural_units.py +268 -0
  376. tnfr-0.0.1/src/tnfr/operators/transition.py +233 -0
  377. tnfr-0.0.1/src/tnfr/operators/unified_grammar.py +113 -0
  378. tnfr-0.0.1/src/tnfr/parallel/README.md +9 -0
  379. tnfr-0.0.1/src/tnfr/parallel/__init__.py +50 -0
  380. tnfr-0.0.1/src/tnfr/parallel/auto_scaler.py +223 -0
  381. tnfr-0.0.1/src/tnfr/parallel/distributed.py +375 -0
  382. tnfr-0.0.1/src/tnfr/parallel/engine.py +243 -0
  383. tnfr-0.0.1/src/tnfr/parallel/gpu_engine.py +413 -0
  384. tnfr-0.0.1/src/tnfr/parallel/monitoring.py +241 -0
  385. tnfr-0.0.1/src/tnfr/parallel/partitioner.py +450 -0
  386. tnfr-0.0.1/src/tnfr/performance/guardrails.py +136 -0
  387. tnfr-0.0.1/src/tnfr/physics/README.md +282 -0
  388. tnfr-0.0.1/src/tnfr/physics/__init__.py +143 -0
  389. tnfr-0.0.1/src/tnfr/physics/calibration.py +268 -0
  390. tnfr-0.0.1/src/tnfr/physics/canonical.py +818 -0
  391. tnfr-0.0.1/src/tnfr/physics/cell.py +461 -0
  392. tnfr-0.0.1/src/tnfr/physics/extended.py +459 -0
  393. tnfr-0.0.1/src/tnfr/physics/extended_canonical_fields.py +341 -0
  394. tnfr-0.0.1/src/tnfr/physics/fields.py +1186 -0
  395. tnfr-0.0.1/src/tnfr/physics/interactions.py +461 -0
  396. tnfr-0.0.1/src/tnfr/physics/life.py +214 -0
  397. tnfr-0.0.1/src/tnfr/physics/patterns.py +346 -0
  398. tnfr-0.0.1/src/tnfr/physics/signatures.py +264 -0
  399. tnfr-0.0.1/src/tnfr/physics/spectral_metrics.py +184 -0
  400. tnfr-0.0.1/src/tnfr/physics/telemetry.py +145 -0
  401. tnfr-0.0.1/src/tnfr/physics/unified.py +549 -0
  402. tnfr-0.0.1/src/tnfr/physics/vectorized_ops.py +621 -0
  403. tnfr-0.0.1/src/tnfr/py.typed +0 -0
  404. tnfr-0.0.1/src/tnfr/recipes/README.md +266 -0
  405. tnfr-0.0.1/src/tnfr/recipes/__init__.py +22 -0
  406. tnfr-0.0.1/src/tnfr/recipes/cookbook.py +735 -0
  407. tnfr-0.0.1/src/tnfr/rng.py +176 -0
  408. tnfr-0.0.1/src/tnfr/rng.pyi +24 -0
  409. tnfr-0.0.1/src/tnfr/schemas/README.md +14 -0
  410. tnfr-0.0.1/src/tnfr/schemas/__init__.py +8 -0
  411. tnfr-0.0.1/src/tnfr/schemas/grammar.json +94 -0
  412. tnfr-0.0.1/src/tnfr/sdk/README.md +381 -0
  413. tnfr-0.0.1/src/tnfr/sdk/__init__.py +111 -0
  414. tnfr-0.0.1/src/tnfr/sdk/__init__.pyi +19 -0
  415. tnfr-0.0.1/src/tnfr/sdk/adaptive_system.py +177 -0
  416. tnfr-0.0.1/src/tnfr/sdk/adaptive_system.pyi +21 -0
  417. tnfr-0.0.1/src/tnfr/sdk/builders.py +383 -0
  418. tnfr-0.0.1/src/tnfr/sdk/builders.pyi +51 -0
  419. tnfr-0.0.1/src/tnfr/sdk/fluent.py +1560 -0
  420. tnfr-0.0.1/src/tnfr/sdk/fluent.pyi +74 -0
  421. tnfr-0.0.1/src/tnfr/sdk/simple.py +358 -0
  422. tnfr-0.0.1/src/tnfr/sdk/templates.py +346 -0
  423. tnfr-0.0.1/src/tnfr/sdk/templates.pyi +41 -0
  424. tnfr-0.0.1/src/tnfr/sdk/utils.py +337 -0
  425. tnfr-0.0.1/src/tnfr/secure_config.py +46 -0
  426. tnfr-0.0.1/src/tnfr/security/README.md +9 -0
  427. tnfr-0.0.1/src/tnfr/security/__init__.py +70 -0
  428. tnfr-0.0.1/src/tnfr/security/database.py +497 -0
  429. tnfr-0.0.1/src/tnfr/security/subprocess.py +498 -0
  430. tnfr-0.0.1/src/tnfr/security/validation.py +288 -0
  431. tnfr-0.0.1/src/tnfr/selector.py +243 -0
  432. tnfr-0.0.1/src/tnfr/selector.pyi +19 -0
  433. tnfr-0.0.1/src/tnfr/sense.py +372 -0
  434. tnfr-0.0.1/src/tnfr/sense.pyi +21 -0
  435. tnfr-0.0.1/src/tnfr/sequencing/README.md +10 -0
  436. tnfr-0.0.1/src/tnfr/sequencing/__init__.py +10 -0
  437. tnfr-0.0.1/src/tnfr/sequencing/patterns.py +5 -0
  438. tnfr-0.0.1/src/tnfr/services/README.md +6 -0
  439. tnfr-0.0.1/src/tnfr/services/__init__.py +17 -0
  440. tnfr-0.0.1/src/tnfr/services/orchestrator.py +319 -0
  441. tnfr-0.0.1/src/tnfr/sparse/README.md +8 -0
  442. tnfr-0.0.1/src/tnfr/sparse/__init__.py +39 -0
  443. tnfr-0.0.1/src/tnfr/sparse/representations.py +481 -0
  444. tnfr-0.0.1/src/tnfr/structural/README.md +8 -0
  445. tnfr-0.0.1/src/tnfr/structural.py +741 -0
  446. tnfr-0.0.1/src/tnfr/structural.pyi +83 -0
  447. tnfr-0.0.1/src/tnfr/telemetry/README.md +9 -0
  448. tnfr-0.0.1/src/tnfr/telemetry/__init__.py +44 -0
  449. tnfr-0.0.1/src/tnfr/telemetry/cache_metrics.py +222 -0
  450. tnfr-0.0.1/src/tnfr/telemetry/cache_metrics.pyi +60 -0
  451. tnfr-0.0.1/src/tnfr/telemetry/constants.py +53 -0
  452. tnfr-0.0.1/src/tnfr/telemetry/constants.py.backup +28 -0
  453. tnfr-0.0.1/src/tnfr/telemetry/emit.py +465 -0
  454. tnfr-0.0.1/src/tnfr/telemetry/nu_f.py +418 -0
  455. tnfr-0.0.1/src/tnfr/telemetry/nu_f.pyi +104 -0
  456. tnfr-0.0.1/src/tnfr/telemetry/verbosity.py +34 -0
  457. tnfr-0.0.1/src/tnfr/telemetry/verbosity.pyi +15 -0
  458. tnfr-0.0.1/src/tnfr/tokens.py +58 -0
  459. tnfr-0.0.1/src/tnfr/tokens.pyi +36 -0
  460. tnfr-0.0.1/src/tnfr/tools/README.md +9 -0
  461. tnfr-0.0.1/src/tnfr/tools/__init__.py +20 -0
  462. tnfr-0.0.1/src/tnfr/tools/domain_templates.py +474 -0
  463. tnfr-0.0.1/src/tnfr/tools/sequence_generator.py +821 -0
  464. tnfr-0.0.1/src/tnfr/tools/tnfr_is_prime_cli.py +85 -0
  465. tnfr-0.0.1/src/tnfr/topology/README.md +9 -0
  466. tnfr-0.0.1/src/tnfr/topology/__init__.py +13 -0
  467. tnfr-0.0.1/src/tnfr/topology/asymmetry.py +151 -0
  468. tnfr-0.0.1/src/tnfr/trace.py +541 -0
  469. tnfr-0.0.1/src/tnfr/trace.pyi +42 -0
  470. tnfr-0.0.1/src/tnfr/types.py +790 -0
  471. tnfr-0.0.1/src/tnfr/types.pyi +351 -0
  472. tnfr-0.0.1/src/tnfr/units.py +66 -0
  473. tnfr-0.0.1/src/tnfr/units.pyi +13 -0
  474. tnfr-0.0.1/src/tnfr/utils/README.md +6 -0
  475. tnfr-0.0.1/src/tnfr/utils/__init__.py +291 -0
  476. tnfr-0.0.1/src/tnfr/utils/__init__.pyi +215 -0
  477. tnfr-0.0.1/src/tnfr/utils/cache.py +4294 -0
  478. tnfr-0.0.1/src/tnfr/utils/cache.pyi +460 -0
  479. tnfr-0.0.1/src/tnfr/utils/callbacks.py +371 -0
  480. tnfr-0.0.1/src/tnfr/utils/callbacks.pyi +49 -0
  481. tnfr-0.0.1/src/tnfr/utils/chunks.py +108 -0
  482. tnfr-0.0.1/src/tnfr/utils/chunks.pyi +22 -0
  483. tnfr-0.0.1/src/tnfr/utils/data.py +422 -0
  484. tnfr-0.0.1/src/tnfr/utils/data.pyi +74 -0
  485. tnfr-0.0.1/src/tnfr/utils/fast_diameter.py +271 -0
  486. tnfr-0.0.1/src/tnfr/utils/graph.py +129 -0
  487. tnfr-0.0.1/src/tnfr/utils/graph.pyi +10 -0
  488. tnfr-0.0.1/src/tnfr/utils/init.py +809 -0
  489. tnfr-0.0.1/src/tnfr/utils/init.pyi +78 -0
  490. tnfr-0.0.1/src/tnfr/utils/io.py +559 -0
  491. tnfr-0.0.1/src/tnfr/utils/io.pyi +66 -0
  492. tnfr-0.0.1/src/tnfr/utils/numeric.py +114 -0
  493. tnfr-0.0.1/src/tnfr/utils/numeric.pyi +21 -0
  494. tnfr-0.0.1/src/tnfr/utils/topology.py +273 -0
  495. tnfr-0.0.1/src/tnfr/validation/README.md +9 -0
  496. tnfr-0.0.1/src/tnfr/validation/__init__.py +212 -0
  497. tnfr-0.0.1/src/tnfr/validation/__init__.pyi +83 -0
  498. tnfr-0.0.1/src/tnfr/validation/aggregator.py +382 -0
  499. tnfr-0.0.1/src/tnfr/validation/base.py +48 -0
  500. tnfr-0.0.1/src/tnfr/validation/compatibility.py +532 -0
  501. tnfr-0.0.1/src/tnfr/validation/compatibility.pyi +6 -0
  502. tnfr-0.0.1/src/tnfr/validation/config.py +72 -0
  503. tnfr-0.0.1/src/tnfr/validation/graph.py +137 -0
  504. tnfr-0.0.1/src/tnfr/validation/graph.pyi +18 -0
  505. tnfr-0.0.1/src/tnfr/validation/health.py +126 -0
  506. tnfr-0.0.1/src/tnfr/validation/input_validation.py +755 -0
  507. tnfr-0.0.1/src/tnfr/validation/invariants.py +702 -0
  508. tnfr-0.0.1/src/tnfr/validation/rules.py +254 -0
  509. tnfr-0.0.1/src/tnfr/validation/rules.pyi +40 -0
  510. tnfr-0.0.1/src/tnfr/validation/runtime.py +267 -0
  511. tnfr-0.0.1/src/tnfr/validation/runtime.pyi +26 -0
  512. tnfr-0.0.1/src/tnfr/validation/sequence_validator.py +158 -0
  513. tnfr-0.0.1/src/tnfr/validation/soft_filters.py +170 -0
  514. tnfr-0.0.1/src/tnfr/validation/soft_filters.pyi +32 -0
  515. tnfr-0.0.1/src/tnfr/validation/spectral.py +158 -0
  516. tnfr-0.0.1/src/tnfr/validation/spectral.pyi +42 -0
  517. tnfr-0.0.1/src/tnfr/validation/validator.py +1226 -0
  518. tnfr-0.0.1/src/tnfr/validation/window.py +39 -0
  519. tnfr-0.0.1/src/tnfr/validation/window.pyi +1 -0
  520. tnfr-0.0.1/src/tnfr/visualization/README.md +6 -0
  521. tnfr-0.0.1/src/tnfr/visualization/__init__.py +97 -0
  522. tnfr-0.0.1/src/tnfr/visualization/cascade_viz.py +304 -0
  523. tnfr-0.0.1/src/tnfr/visualization/hierarchy.py +367 -0
  524. tnfr-0.0.1/src/tnfr/visualization/sequence_plotter.py +737 -0
  525. tnfr-0.0.1/src/tnfr.egg-info/PKG-INFO +649 -0
  526. tnfr-0.0.1/src/tnfr.egg-info/SOURCES.txt +533 -0
  527. tnfr-0.0.1/src/tnfr.egg-info/dependency_links.txt +1 -0
  528. tnfr-0.0.1/src/tnfr.egg-info/entry_points.txt +4 -0
  529. tnfr-0.0.1/src/tnfr.egg-info/requires.txt +132 -0
  530. tnfr-0.0.1/src/tnfr.egg-info/top_level.txt +1 -0
  531. tnfr-0.0.1/theory/FUNDAMENTAL_TNFR_THEORY_UNIVERSAL_TETRAHEDRAL_CORRESPONDENCE.md +339 -0
  532. tnfr-0.0.1/theory/GLOSSARY.md +656 -0
  533. tnfr-0.0.1/theory/README.md +99 -0
  534. tnfr-0.0.1/theory/TNFR.pdf +0 -0
  535. tnfr-0.0.1/theory/UNIFIED_GRAMMAR_RULES.md +1744 -0
@@ -0,0 +1,59 @@
1
+ # TNFR Engine Environment Configuration
2
+ # Copy this file to .env and fill in your actual values
3
+ # NEVER commit .env files with real credentials to version control
4
+
5
+ # ============================================================================
6
+ # Development Configuration
7
+ # ============================================================================
8
+
9
+ # PyPI Publishing Configuration (for release scripts)
10
+ # Use API tokens for enhanced security: https://pypi.org/help/#apitoken
11
+ PYPI_USERNAME=__token__
12
+ PYPI_PASSWORD=pypi-XXXXXXXXXXXXXXXXXXXXXXXX # Your PyPI API token
13
+ PYPI_API_TOKEN=pypi-XXXXXXXXXXXXXXXXXXXXXXXX # Alternative name
14
+ TWINE_USERNAME=__token__
15
+ TWINE_PASSWORD=pypi-XXXXXXXXXXXXXXXXXXXXXXXX # Your PyPI API token
16
+ PYPI_REPOSITORY=pypi # or 'testpypi' for testing
17
+
18
+ # GitHub Configuration (for security dashboard and CI scripts)
19
+ GITHUB_TOKEN=ghp_XXXXXXXXXXXXXXXXXXXXXXXX # GitHub Personal Access Token
20
+ GITHUB_REPOSITORY=fermga/TNFR-Python-Engine # Format: owner/repo
21
+
22
+ # Redis Configuration (for RedisCacheLayer with authentication)
23
+ REDIS_HOST=localhost
24
+ REDIS_PORT=6379
25
+ REDIS_PASSWORD=your-redis-password-here
26
+ REDIS_DB=0
27
+ REDIS_USE_TLS=false
28
+
29
+ # Cache Signing Configuration (for hardened cache security)
30
+ # Generate a strong random secret: python -c "import secrets; print(secrets.token_hex(32))"
31
+ TNFR_CACHE_SECRET= # 64-character hex string recommended
32
+
33
+ # ============================================================================
34
+ # TNFR Engine Configuration
35
+ # ============================================================================
36
+
37
+ # Logging Configuration
38
+ TNFR_LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
39
+
40
+ # Reproducibility Configuration
41
+ TNFR_RANDOM_SEED=42 # For deterministic simulations
42
+
43
+ # Performance Configuration
44
+ TNFR_BACKEND=numpy # numpy, jax, or torch
45
+ TNFR_CACHE_ENABLED=true
46
+
47
+ # ============================================================================
48
+ # Security Best Practices
49
+ # ============================================================================
50
+ #
51
+ # 1. NEVER commit this file with real credentials
52
+ # 2. Use API tokens instead of passwords where possible
53
+ # 3. Rotate credentials regularly
54
+ # 4. Use different credentials for development, staging, and production
55
+ # 5. Store production secrets in secure secret management systems
56
+ # 6. Grant minimal necessary permissions to all tokens
57
+ # 7. Revoke tokens immediately if compromised
58
+ #
59
+ # For more information, see SECURITY.md
@@ -0,0 +1,405 @@
1
+ # TNFR Domain Extension Template
2
+
3
+ This template guides you through creating a new domain extension for TNFR Grammar 2.0.
4
+
5
+ ## Extension Overview
6
+
7
+ **Domain Name**: `your_domain_name`
8
+ **Description**: Brief description of the domain and its TNFR applications
9
+ **Maintainer**: Your GitHub username
10
+ **Status**: `draft` | `review` | `stable`
11
+
12
+ ---
13
+
14
+ ## 1. Extension Structure
15
+
16
+ Your extension should follow this structure:
17
+
18
+ ```
19
+ src/tnfr/extensions/your_domain_name/
20
+ ├── __init__.py # Extension registration and exports
21
+ ├── patterns.py # Domain-specific pattern definitions
22
+ ├── health_analyzers.py # Specialized health metrics
23
+ ├── visualizers.py # Domain-specific visualizations (optional)
24
+ ├── cookbook.py # Validated recipes for common scenarios
25
+ └── README.md # Domain documentation
26
+ ```
27
+
28
+ ---
29
+
30
+ ## 2. Base Extension Class
31
+
32
+ All extensions must inherit from `TNFRExtension`:
33
+
34
+ ```python
35
+ from tnfr.extensions.base import TNFRExtension, PatternDefinition
36
+ from typing import Dict, List, Type
37
+
38
+ class YourDomainExtension(TNFRExtension):
39
+ """Extension for [your domain] applications.
40
+
41
+ This extension provides specialized patterns and health analyzers
42
+ for [describe domain purpose and value].
43
+ """
44
+
45
+ def get_domain_name(self) -> str:
46
+ """Return domain name identifier."""
47
+ return "your_domain_name"
48
+
49
+ def get_pattern_definitions(self) -> Dict[str, PatternDefinition]:
50
+ """Return pattern definitions for this domain.
51
+
52
+ Returns
53
+ -------
54
+ Dict[str, PatternDefinition]
55
+ Mapping of pattern names to their definitions.
56
+ """
57
+ from .patterns import PATTERNS
58
+ return PATTERNS
59
+
60
+ def get_health_analyzers(self) -> Dict[str, Type]:
61
+ """Return domain-specific health analyzers.
62
+
63
+ Returns
64
+ -------
65
+ Dict[str, Type]
66
+ Mapping of analyzer names to analyzer classes.
67
+ """
68
+ from .health_analyzers import DomainHealthAnalyzer
69
+ return {
70
+ "domain_health": DomainHealthAnalyzer,
71
+ }
72
+
73
+ def get_cookbook_recipes(self) -> Dict[str, Dict]:
74
+ """Return validated recipes for common scenarios.
75
+
76
+ Returns
77
+ -------
78
+ Dict[str, Dict]
79
+ Mapping of recipe names to recipe definitions.
80
+ """
81
+ from .cookbook import RECIPES
82
+ return RECIPES
83
+
84
+ def get_visualization_tools(self) -> Dict[str, Type]:
85
+ """Return domain-specific visualizers (optional).
86
+
87
+ Returns
88
+ -------
89
+ Dict[str, Type]
90
+ Mapping of visualizer names to visualizer classes.
91
+ """
92
+ # Optional - return {} if no visualizations
93
+ return {}
94
+ ```
95
+
96
+ ---
97
+
98
+ ## 3. Pattern Definitions
99
+
100
+ Define your domain patterns in `patterns.py`:
101
+
102
+ ```python
103
+ from tnfr.extensions.base import PatternDefinition
104
+
105
+ PATTERNS = {
106
+ "pattern_name": PatternDefinition(
107
+ name="pattern_name",
108
+ sequence=["emission", "reception", "coherence", "resonance"],
109
+ description="What this pattern represents in your domain",
110
+ use_cases=[
111
+ "Use case 1: Specific scenario",
112
+ "Use case 2: Another scenario",
113
+ "Use case 3: Third scenario",
114
+ ],
115
+ health_requirements={
116
+ "min_coherence": 0.75,
117
+ "min_sense_index": 0.70,
118
+ },
119
+ domain_context={
120
+ "real_world_mapping": "How this maps to domain concepts",
121
+ "expected_outcomes": "What happens when pattern succeeds",
122
+ "failure_modes": "Common failure patterns",
123
+ },
124
+ examples=[
125
+ {
126
+ "name": "Example 1",
127
+ "context": "Specific situation",
128
+ "sequence": ["emission", "reception", "coherence"],
129
+ "health_metrics": {"C_t": 0.82, "Si": 0.76},
130
+ },
131
+ {
132
+ "name": "Example 2",
133
+ "context": "Another situation",
134
+ "sequence": ["emission", "reception", "coherence", "resonance"],
135
+ "health_metrics": {"C_t": 0.85, "Si": 0.81},
136
+ },
137
+ ],
138
+ ),
139
+ }
140
+ ```
141
+
142
+ ---
143
+
144
+ ## 4. Health Analyzers
145
+
146
+ Create specialized health metrics in `health_analyzers.py`:
147
+
148
+ ```python
149
+ from tnfr.metrics import SequenceHealthAnalyzer
150
+ from typing import Dict, Any
151
+ import networkx as nx
152
+
153
+ class DomainHealthAnalyzer(SequenceHealthAnalyzer):
154
+ """Specialized health analyzer for [your domain].
155
+
156
+ Computes domain-specific health dimensions beyond standard
157
+ coherence and sense index metrics.
158
+ """
159
+
160
+ def analyze_domain_health(
161
+ self,
162
+ G: nx.Graph,
163
+ sequence: List[str],
164
+ **kwargs: Any
165
+ ) -> Dict[str, float]:
166
+ """Compute domain-specific health metrics.
167
+
168
+ Parameters
169
+ ----------
170
+ G : nx.Graph
171
+ Network graph
172
+ sequence : List[str]
173
+ Operator sequence to analyze
174
+ **kwargs : Any
175
+ Additional analysis parameters
176
+
177
+ Returns
178
+ -------
179
+ Dict[str, float]
180
+ Domain-specific health metrics with values in [0, 1]
181
+ """
182
+ # Implement your domain-specific metrics
183
+ metrics = {}
184
+
185
+ # Example metric
186
+ metrics["domain_quality"] = self._compute_domain_quality(G, sequence)
187
+ metrics["domain_stability"] = self._compute_domain_stability(G, sequence)
188
+ metrics["domain_effectiveness"] = self._compute_effectiveness(G, sequence)
189
+
190
+ return metrics
191
+
192
+ def _compute_domain_quality(self, G: nx.Graph, sequence: List[str]) -> float:
193
+ """Compute domain-specific quality metric."""
194
+ # Your implementation
195
+ pass
196
+
197
+ def _compute_domain_stability(self, G: nx.Graph, sequence: List[str]) -> float:
198
+ """Compute domain-specific stability metric."""
199
+ # Your implementation
200
+ pass
201
+
202
+ def _compute_effectiveness(self, G: nx.Graph, sequence: List[str]) -> float:
203
+ """Compute domain-specific effectiveness metric."""
204
+ # Your implementation
205
+ pass
206
+ ```
207
+
208
+ ---
209
+
210
+ ## 5. Cookbook Recipes
211
+
212
+ Provide validated recipes in `cookbook.py`:
213
+
214
+ ```python
215
+ RECIPES = {
216
+ "common_scenario_1": {
217
+ "name": "Common Scenario Name",
218
+ "description": "What this recipe achieves",
219
+ "sequence": ["emission", "reception", "coherence"],
220
+ "parameters": {
221
+ "suggested_nf": 1.5, # Hz_str
222
+ "suggested_phase": 0.0,
223
+ },
224
+ "expected_health": {
225
+ "min_C_t": 0.75,
226
+ "min_Si": 0.70,
227
+ },
228
+ "validation": {
229
+ "tested_cases": 20,
230
+ "success_rate": 0.95,
231
+ "notes": "Validated on real-world data",
232
+ },
233
+ },
234
+ }
235
+ ```
236
+
237
+ ---
238
+
239
+ ## 6. Validation Requirements
240
+
241
+ Your extension must pass these validation checks:
242
+
243
+ ### Pattern Validation
244
+ - ✅ All patterns use canonical English operator identifiers
245
+ - ✅ All examples achieve health score > 0.75
246
+ - ✅ Minimum 3 validated use cases per pattern
247
+ - ✅ Clear domain mapping documented
248
+
249
+ ### Code Quality
250
+ - ✅ Type annotations complete (mypy passes)
251
+ - ✅ Docstrings follow NumPy style guide
252
+ - ✅ Integration tests included
253
+ - ✅ All tests pass
254
+
255
+ ### TNFR Compliance
256
+ - ✅ Maintains operator closure
257
+ - ✅ Preserves structural invariants
258
+ - ✅ Follows domain neutrality in core
259
+ - ✅ Uses Hz_str units for frequencies
260
+
261
+ ---
262
+
263
+ ## 7. Testing Your Extension
264
+
265
+ Create tests in `tests/extensions/test_your_domain.py`:
266
+
267
+ ```python
268
+ import pytest
269
+ from tnfr.extensions.your_domain import YourDomainExtension
270
+
271
+ def test_extension_registration():
272
+ """Test extension can be registered."""
273
+ ext = YourDomainExtension()
274
+ assert ext.get_domain_name() == "your_domain_name"
275
+
276
+ def test_pattern_health_scores():
277
+ """Test all patterns meet health requirements."""
278
+ ext = YourDomainExtension()
279
+ patterns = ext.get_pattern_definitions()
280
+
281
+ for pattern_name, pattern_def in patterns.items():
282
+ for example in pattern_def.examples:
283
+ assert example["health_metrics"]["C_t"] > 0.75
284
+ assert example["health_metrics"]["Si"] > 0.70
285
+
286
+ def test_health_analyzer():
287
+ """Test domain health analyzer."""
288
+ from tnfr.extensions.your_domain.health_analyzers import DomainHealthAnalyzer
289
+ import networkx as nx
290
+
291
+ G = nx.Graph()
292
+ # Set up test network
293
+
294
+ analyzer = DomainHealthAnalyzer()
295
+ metrics = analyzer.analyze_domain_health(G, ["emission", "coherence"])
296
+
297
+ assert 0.0 <= metrics["domain_quality"] <= 1.0
298
+ assert 0.0 <= metrics["domain_stability"] <= 1.0
299
+ ```
300
+
301
+ ---
302
+
303
+ ## 8. Documentation
304
+
305
+ Create `README.md` in your extension directory:
306
+
307
+ ```markdown
308
+ # Your Domain Extension
309
+
310
+ ## Overview
311
+ Brief description of the domain and how TNFR applies.
312
+
313
+ ## Patterns
314
+
315
+ ### Pattern 1: pattern_name
316
+ - **Sequence**: `["emission", "reception", "coherence"]`
317
+ - **Use Cases**:
318
+ 1. Use case 1
319
+ 2. Use case 2
320
+ - **Domain Mapping**: How this maps to domain concepts
321
+
322
+ ## Health Analyzers
323
+
324
+ ### DomainHealthAnalyzer
325
+ Computes:
326
+ - `domain_quality`: Description of metric
327
+ - `domain_stability`: Description of metric
328
+
329
+ ## Usage Examples
330
+
331
+ ```python
332
+ from tnfr.extensions.your_domain import YourDomainExtension
333
+ from tnfr.extensions import registry
334
+
335
+ # Register extension
336
+ ext = YourDomainExtension()
337
+ registry.register_extension(ext)
338
+
339
+ # Use domain patterns
340
+ patterns = registry.get_domain_patterns("your_domain_name")
341
+ ```
342
+
343
+ ## Validation
344
+ - Tested on X real-world cases
345
+ - Average health score: Y
346
+ - Success rate: Z%
347
+
348
+ ## References
349
+ - Domain-specific papers/resources
350
+ - Validation studies
351
+ ```
352
+
353
+ ---
354
+
355
+ ## 9. Submission Process
356
+
357
+ 1. **Fork the repository**
358
+ 2. **Create your extension** following this template
359
+ 3. **Run validation**: `python tools/community/extension_validator.py your_domain_name`
360
+ 4. **Run tests**: `pytest tests/extensions/test_your_domain.py`
361
+ 5. **Create PR** using the PR template
362
+ 6. **Respond to reviews** and iterate
363
+
364
+ ---
365
+
366
+ ## 10. Example Extensions
367
+
368
+ Study these reference implementations:
369
+
370
+ - **Medical Extension**: `src/tnfr/extensions/medical/`
371
+ - Therapeutic patterns
372
+ - Clinical health analyzers
373
+ - Treatment journey visualizations
374
+
375
+ - **Business Extension**: `src/tnfr/extensions/business/`
376
+ - Process patterns
377
+ - KPI analyzers
378
+ - Organizational change tracking
379
+
380
+ ---
381
+
382
+ ## Questions?
383
+
384
+ - **Documentation**: See main docs at `docs/extensions/`
385
+ - **Issues**: Use issue template "Domain Extension"
386
+ - **Community**: Join discussions in GitHub Discussions
387
+
388
+ ---
389
+
390
+ ## Validation Checklist
391
+
392
+ Before submitting, verify:
393
+
394
+ - [ ] Extension class implements all required methods
395
+ - [ ] All patterns have >= 3 validated use cases
396
+ - [ ] All examples achieve health score > 0.75
397
+ - [ ] Health analyzers return values in [0, 1]
398
+ - [ ] Type annotations complete
399
+ - [ ] Docstrings follow NumPy style
400
+ - [ ] Integration tests pass
401
+ - [ ] Documentation complete
402
+ - [ ] Validation script passes
403
+ - [ ] PR template filled out completely
404
+
405
+ **Ready?** Submit your extension and help grow the TNFR ecosystem! 🚀
@@ -0,0 +1,146 @@
1
+ name: 🌐 Domain Extension
2
+ description: Propose a complete extension for a new application domain
3
+ title: "[EXTENSION] <Domain Name>"
4
+ labels: ["enhancement", "extension", "community", "major"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ ## Propose a Domain Extension
10
+
11
+ Submit a complete extension package for a new application domain.
12
+
13
+ **Includes**:
14
+ - Domain-specific patterns
15
+ - Specialized health analyzers
16
+ - Visualization tools (optional)
17
+ - Cookbook recipes
18
+
19
+ - type: input
20
+ id: domain_name
21
+ attributes:
22
+ label: Domain Name
23
+ description: Name of the domain (lowercase, underscore-separated)
24
+ placeholder: "medical_therapy"
25
+ validations:
26
+ required: true
27
+
28
+ - type: textarea
29
+ id: domain_description
30
+ attributes:
31
+ label: Domain Description
32
+ description: What is this domain and why is TNFR valuable here?
33
+ placeholder: |
34
+ Medical therapy domain focuses on therapeutic interactions, patient progress
35
+ tracking, and intervention planning. TNFR provides structured analysis of
36
+ therapeutic dynamics and healing trajectories...
37
+ validations:
38
+ required: true
39
+
40
+ - type: textarea
41
+ id: patterns
42
+ attributes:
43
+ label: Core Patterns
44
+ description: List the main patterns included in this extension
45
+ placeholder: |
46
+ 1. therapeutic_alliance: ["emission", "reception", "coherence", "resonance"]
47
+ 2. crisis_intervention: ["dissonance", "silence", "coherence", "stabilization"]
48
+ 3. integration_phase: ["coupling", "self_organization", "expansion"]
49
+ validations:
50
+ required: true
51
+
52
+ - type: textarea
53
+ id: health_analyzers
54
+ attributes:
55
+ label: Specialized Health Analyzers
56
+ description: Describe domain-specific health metrics and analyzers
57
+ placeholder: |
58
+ - TherapeuticHealthAnalyzer: measures healing_potential, trauma_safety, alliance_strength
59
+ - ProgressAnalyzer: tracks patient trajectory over time
60
+ - InterventionQualityAnalyzer: evaluates intervention effectiveness
61
+ validations:
62
+ required: true
63
+
64
+ - type: textarea
65
+ id: use_cases
66
+ attributes:
67
+ label: Target Use Cases
68
+ description: What real-world problems does this extension solve?
69
+ placeholder: |
70
+ - Clinical therapy session planning
71
+ - Patient progress monitoring
72
+ - Treatment outcome prediction
73
+ - Intervention strategy optimization
74
+ validations:
75
+ required: true
76
+
77
+ - type: textarea
78
+ id: cookbook_recipes
79
+ attributes:
80
+ label: Cookbook Recipes
81
+ description: Validated recipes for common domain scenarios
82
+ placeholder: |
83
+ - crisis_stabilization: Sequence for acute crisis intervention
84
+ - trust_building: Pattern for establishing therapeutic trust
85
+ - breakthrough_facilitation: Sequence for supporting insights
86
+
87
+ - type: textarea
88
+ id: visualization
89
+ attributes:
90
+ label: Visualization Tools (Optional)
91
+ description: Any domain-specific visualizations?
92
+ placeholder: |
93
+ - Therapeutic journey maps
94
+ - Progress timeline visualizations
95
+ - Intervention effectiveness charts
96
+
97
+ - type: textarea
98
+ id: integration
99
+ attributes:
100
+ label: External Integrations (Optional)
101
+ description: Connections to external systems or tools
102
+ placeholder: |
103
+ - Electronic Health Records (EHR) integration
104
+ - Therapy notes parsing
105
+ - Assessment tools compatibility
106
+
107
+ - type: textarea
108
+ id: validation_approach
109
+ attributes:
110
+ label: Validation Approach
111
+ description: How will you validate this extension?
112
+ placeholder: |
113
+ - Real clinical data testing
114
+ - Expert practitioner review
115
+ - Comparative analysis with existing methods
116
+ - Minimum 20 validated cases per pattern
117
+ validations:
118
+ required: true
119
+
120
+ - type: input
121
+ id: maintainer
122
+ attributes:
123
+ label: Proposed Maintainer
124
+ description: Who will maintain this extension?
125
+ placeholder: "@username"
126
+ validations:
127
+ required: true
128
+
129
+ - type: checkboxes
130
+ id: checklist
131
+ attributes:
132
+ label: Extension Checklist
133
+ description: Please confirm the following
134
+ options:
135
+ - label: Extension follows TNFRExtension base class structure
136
+ required: true
137
+ - label: All patterns achieve health score > 0.75
138
+ required: true
139
+ - label: Documentation includes real-world domain mapping
140
+ required: true
141
+ - label: Integration tests are included
142
+ required: true
143
+ - label: Code follows TNFR canonical conventions
144
+ required: true
145
+ - label: I am committed to maintaining this extension
146
+ required: true