mobius-db 2.0.0__py3-none-any.whl

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.
mobius_db/__init__.py ADDED
@@ -0,0 +1,7 @@
1
+ from .cell import MobiusMemoryCell
2
+ from .topology import atualizar_pontes_inter_celulas, calcular_metrica_g55
3
+ from .kdtree import MobiusKDTree
4
+ from .storage import salvar_rede_em_json, carregar_rede_de_json
5
+
6
+ __version__ = "2.0.0"
7
+ __author__ = "José Joabio Bezerra Paiva"
mobius_db/cell.py ADDED
@@ -0,0 +1,54 @@
1
+ import threading
2
+ import numpy as np
3
+
4
+ class MobiusMemoryCell:
5
+ def __init__(self, cell_id="Cell_01", max_tension=6.0):
6
+ self.cell_id = cell_id
7
+ self.max_tension = max_tension
8
+ self.tension = 0.0
9
+ self.phase = 0.0
10
+ self.payload = []
11
+ self.generation = 0
12
+ self.lock = threading.Lock()
13
+ self.peer_links = []
14
+
15
+ def store_data(self, data, vector=None, verbose=False):
16
+ with self.lock:
17
+ self.phase = (self.phase + np.pi / 2) % (4 * np.pi)
18
+ tension_increment = 1.5 if self.phase > (2 * np.pi) else 1.0
19
+ self.tension += tension_increment
20
+
21
+ entry = {
22
+ "data": data,
23
+ "phase_state": float(self.phase),
24
+ "layer": "Face Externa" if self.phase <= 2 * np.pi else "Face Interna (Reversa)"
25
+ }
26
+ if vector is not None:
27
+ entry["vector"] = [float(x) for x in vector]
28
+ self.payload.append(entry)
29
+
30
+ if verbose:
31
+ print(f"[{self.cell_id}] Inserido: '{data}' | Fase: {np.degrees(self.phase):.1f}° | Tensão: {self.tension:.1f}/{self.max_tension}")
32
+
33
+ if self.tension >= self.max_tension:
34
+ return self.bifurcate(verbose=verbose)
35
+ return None
36
+
37
+ def bifurcate(self, verbose=False):
38
+ mid = len(self.payload) // 2
39
+ payload_left = self.payload[:mid]
40
+ payload_right = self.payload[mid:]
41
+
42
+ child_1 = MobiusMemoryCell(cell_id=f"{self.cell_id}.A", max_tension=self.max_tension)
43
+ child_1.payload = payload_left
44
+ child_1.tension = len(payload_left) * 1.0
45
+ child_1.phase = self.phase
46
+ child_1.generation = self.generation + 1
47
+
48
+ child_2 = MobiusMemoryCell(cell_id=f"{self.cell_id}.B", max_tension=self.max_tension)
49
+ child_2.payload = payload_right
50
+ child_2.tension = len(payload_right) * 1.0
51
+ child_2.phase = self.phase
52
+ child_2.generation = self.generation + 1
53
+
54
+ return [child_1, child_2]
mobius_db/kdtree.py ADDED
@@ -0,0 +1,26 @@
1
+ import numpy as np
2
+
3
+ class MobiusKDTreeNode:
4
+ def __init__(self, point, data_ref, left=None, right=None):
5
+ self.point = point
6
+ self.data_ref = data_ref
7
+ self.left = left
8
+ self.right = right
9
+
10
+ class MobiusKDTree:
11
+ def __init__(self, items):
12
+ self.root = self._build(items, depth=0)
13
+
14
+ def _build(self, points_list, depth):
15
+ if not points_list:
16
+ return None
17
+ k = len(points_list[0][0])
18
+ axis = depth % k
19
+ points_list.sort(key=lambda x: x[0][axis])
20
+ mid = len(points_list) // 2
21
+ return MobiusKDTreeNode(
22
+ point=points_list[mid][0],
23
+ data_ref=points_list[mid][1],
24
+ left=self._build(points_list[:mid], depth + 1),
25
+ right=self._build(points_list[mid+1:], depth + 1)
26
+ )
mobius_db/storage.py ADDED
@@ -0,0 +1,26 @@
1
+ import json
2
+
3
+ def salvar_rede_em_json(active_cells, filename="estado_rede_mobius.json"):
4
+ dados = {
5
+ "arquitetura": "Astral Intelligence - Mobius Topological Engine v2.0",
6
+ "autor": "José Joabio Bezerra Paiva",
7
+ "total_nos_ativos": len(active_cells),
8
+ "nos": []
9
+ }
10
+ for cell in active_cells:
11
+ dados["nos"].append({
12
+ "cell_id": cell.cell_id,
13
+ "generation": cell.generation,
14
+ "tension": cell.tension,
15
+ "max_tension": cell.max_tension,
16
+ "phase_rad": cell.phase,
17
+ "phase_deg": float(cell.phase * 180.0 / 3.1415926535),
18
+ "payload_count": len(cell.payload),
19
+ "payload": cell.payload
20
+ })
21
+ with open(filename, "w", encoding="utf-8") as f:
22
+ json.dump(dados, f, ensure_ascii=False, indent=4)
23
+
24
+ def carregar_rede_de_json(filename="estado_rede_mobius.json"):
25
+ with open(filename, "r", encoding="utf-8") as f:
26
+ return json.load(f)
mobius_db/topology.py ADDED
@@ -0,0 +1,14 @@
1
+ import numpy as np
2
+
3
+ def atualizar_pontes_inter_celulas(active_cells, threshold_fase=np.pi/4):
4
+ for cell in active_cells:
5
+ cell.peer_links = []
6
+ for other in active_cells:
7
+ if cell.cell_id != other.cell_id:
8
+ diff_fase = abs(cell.phase - other.phase)
9
+ if diff_fase <= threshold_fase:
10
+ cell.peer_links.append(other.cell_id)
11
+
12
+ def calcular_metrica_g55(stress, max_stress, phase):
13
+ ratio = min(1.0, stress / max_stress) if max_stress > 0 else 0.0
14
+ return 1.0 + ratio * (np.cos(2 * phase) ** 2)
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: mobius-db
3
+ Version: 2.0.0
4
+ Summary: Arquitetura de Memória Topológica Auto-Bifurcante baseada em Fita de Möbius (720°) - Astral Intelligence
5
+ Author-email: José Joabio Bezerra Paiva <contato@astralintelligence.com>
6
+ License: Proprietary / Commercial - All Rights Reserved
7
+ Project-URL: Homepage, https://github.com/astral-intelligence/mobius-db
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: Other/Proprietary License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: numpy>=1.20.0
15
+ Requires-Dist: torch>=2.0.0
16
+ Dynamic: license-file
17
+
18
+ # Mobius DB — Astral Intelligence
19
+ Arquitetura de Memória Topológica Auto-Bifurcante com simetria espinorial de 720°, thread-safety atômica, wormholes inter-células e tensor métrico riemanniano (g55).
20
+
21
+ **Autor / Proponente:** José Joabio Bezerra Paiva
22
+ **Ecossistema:** Astral Intelligence
@@ -0,0 +1,10 @@
1
+ mobius_db/__init__.py,sha256=H3KeoI93AoJ-ouXVgQ1kMzTvZm7dTszYfANR8zDT96s,272
2
+ mobius_db/cell.py,sha256=GQofNOdL6lwjl0TeEBNFVNNyqBbPKuMFcS8jTkcQhhU,2041
3
+ mobius_db/kdtree.py,sha256=7TgEhgaF7iBT6lhYD_GyOTluxVD5EzdSqAR1dXQL7rs,808
4
+ mobius_db/storage.py,sha256=ShmJLdc63-of7CYs1LSuYjotldZNYJbTxow475krI7I,976
5
+ mobius_db/topology.py,sha256=_acRpme4hrYMPGum9dhWaBqzH0-A8FSAQUkNwzoWmqU,571
6
+ mobius_db-2.0.0.dist-info/licenses/LICENSE,sha256=6Y4ERaKquHzegkaDMC8sb5mfGMK034QO5zU8BB3x3Bg,592
7
+ mobius_db-2.0.0.dist-info/METADATA,sha256=_8vNWERq9-mggC1PpbYYOY4USVLz3-NgrJqW22vxvzE,984
8
+ mobius_db-2.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
9
+ mobius_db-2.0.0.dist-info/top_level.txt,sha256=WCsoa7EzubXY-DUOP0T6sk256hCodMi2XKlvyIazfMU,10
10
+ mobius_db-2.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,12 @@
1
+ SOFTWARE LICENSE AGREEMENT (PROPRIETARY)
2
+
3
+ Copyright (c) 2026 José Joabio Bezerra Paiva. All Rights Reserved.
4
+
5
+ NOTICE: All information contained herein is, and remains the property of
6
+ José Joabio Bezerra Paiva (Astral Intelligence). The intellectual and
7
+ technical concepts contained herein are proprietary to the author and may
8
+ be covered by copyright laws.
9
+
10
+ Unauthorized copying of this file, via any medium, is strictly prohibited.
11
+ Commercial use, distribution, or modification of this code is strictly
12
+ forbidden without prior written permission and formal licensing from the author.
@@ -0,0 +1 @@
1
+ mobius_db