tri-star-symbolic-assembly-lang 0.1.92__py3-none-any.whl → 0.1.103__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tri-star_symbolic_assembly_lang
3
- Version: 0.1.92
3
+ Version: 0.1.103
4
4
  Summary: TriStar Assembly Language Core + Brian Spiral Tools
5
5
  Author: Sam Howells
6
6
  License: ## LICENCE Options for `Brian`
@@ -219,8 +219,8 @@ Currently available:
219
219
  tsal-api
220
220
  ```
221
221
 
222
- This starts the FastAPI server defined in `tsal.api`. The OpenAPI schema lives at
223
- `/docs` once running and mirrors `schemas/spiral_healer_api.yaml`.
222
+ This starts the FastAPI server defined in `tsal.api`. The OpenAPI schema is
223
+ available at `/docs` once running.
224
224
 
225
225
  ## GitHub Language Database
226
226
 
@@ -2,7 +2,7 @@ crawler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  crawler/madmonkey_crawler.py,sha256=itsyxObNBb_9Au3J1Ft6RTNw3dE65fO-WALLD0WFmBM,541
3
3
  madmonkey/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  madmonkey/intake.py,sha256=R48YOPWn3ljts5dFASZLHpPsycKeONeOCvvIzucyMzU,378
5
- tri_star_symbolic_assembly_lang-0.1.92.dist-info/licenses/LICENSE,sha256=mN9d_5LOKa9NB-vFLGwqAp8bggJwjaQ0Pm4DHFMBmIs,2123
5
+ tri_star_symbolic_assembly_lang-0.1.103.dist-info/licenses/LICENSE,sha256=mN9d_5LOKa9NB-vFLGwqAp8bggJwjaQ0Pm4DHFMBmIs,2123
6
6
  tsal/__init__.py,sha256=kGp9UclcmLlrOILkpQmuIwnjIqrOvGWY76PLfrd83Bo,4246
7
7
  tsal/api.py,sha256=QcLeq1IH_LDTxejBnXse8OqGsHDNgVVebIm7FeIeJpk,984
8
8
  tsal/agents/__init__.py,sha256=SimDfTEAyn7m4J0la1GTxbrcDzjrvdA4-GmqH-CAEQI,238
@@ -63,7 +63,8 @@ tsal/core/tsal_executor.py,sha256=ckW68mb4-pCX7oZ17bnXGZvzVxNCWCTlSbmRvwjddL8,18
63
63
  tsal/core/voxel.py,sha256=hCPkj_iss7hY66PTxyI7KDAZUIKNhVb4j0sY79PqyfM,412
64
64
  tsal/dashboard/__init__.py,sha256=1zcOxwQ-A31dPC57_o0uriN9rNaOX5FOOHopXcEkTLQ,83
65
65
  tsal/dashboard/wisdom_bloom.py,sha256=y1JcrlxnBFRK6oMJw3soLI5jcIg6D0CXkdLZ9Dc7zqA,277
66
- tsal/kernels/__init__.py,sha256=n22pH0j6pBLgRxpyyG4O-BZTz3TPemxSm331oYAZ2Gk,86
66
+ tsal/kernels/__init__.py,sha256=vN2_nCxEI4I1rQGSXJlIcu3T93DbjmUUZ3VV3hauQ4s,154
67
+ tsal/kernels/resurrection_node.py,sha256=NNU5TPL5Aea1SDDwC-dwBLaw_hEZgFXyRZ_-4-g-Fd0,9176
67
68
  tsal/kernels/temporal_mirror.py,sha256=t7Ct0V26YGWeNnhDE_XBVchyQoAS2iwo9R3-NxoLdxA,328
68
69
  tsal/paradox/__init__.py,sha256=QuE7AxKFaNRjy2kzaE-XBg03s-Ktoc4Pfwa5ATrJMQk,97
69
70
  tsal/paradox/recursive_compiler.py,sha256=V_UvNIF_BPHVHLH3q_Knec1M_0EbIL1H6ZK2a3rv72w,334
@@ -124,8 +125,8 @@ tsal/utils/wikipedia_api.py,sha256=W5kf423wzH9FoqO5eDRuJQMuTpTpiUGjVXHa0fLlXSQ,1
124
125
  tsal/visualization/__init__.py,sha256=OUfdiCnBlHhU134bQtdNmlnUhFO3wMikWDiIfpbQ4RM,154
125
126
  tsal/visualization/dual_track_diff.py,sha256=yR6SEvqqD74AdfP0weEc9w0Kdq79pCB_cIeZ82b9ftI,339
126
127
  tsal/visualization/phase_orbit.py,sha256=tZHYP3yWa9OeFYXlIArGCihodAifNVvwCBrJm1-Bym0,294
127
- tri_star_symbolic_assembly_lang-0.1.92.dist-info/METADATA,sha256=wcyBHfu48u2iI-L0Wrujvjs8vztqXyn48qmPflfMcso,12738
128
- tri_star_symbolic_assembly_lang-0.1.92.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
129
- tri_star_symbolic_assembly_lang-0.1.92.dist-info/entry_points.txt,sha256=9aahRH7f88Ofei1fvnJ6qvM6a897VxURhvwRaGl969Y,553
130
- tri_star_symbolic_assembly_lang-0.1.92.dist-info/top_level.txt,sha256=r1-Vpw1iGasgah8k-86xzqpGDT8o-A0P-_6ZNrQ39i0,23
131
- tri_star_symbolic_assembly_lang-0.1.92.dist-info/RECORD,,
128
+ tri_star_symbolic_assembly_lang-0.1.103.dist-info/METADATA,sha256=JBF1i5CVFv_BFzQNDK1dv0wQuyfpqYr709FgDKUWIY0,12701
129
+ tri_star_symbolic_assembly_lang-0.1.103.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
130
+ tri_star_symbolic_assembly_lang-0.1.103.dist-info/entry_points.txt,sha256=9aahRH7f88Ofei1fvnJ6qvM6a897VxURhvwRaGl969Y,553
131
+ tri_star_symbolic_assembly_lang-0.1.103.dist-info/top_level.txt,sha256=r1-Vpw1iGasgah8k-86xzqpGDT8o-A0P-_6ZNrQ39i0,23
132
+ tri_star_symbolic_assembly_lang-0.1.103.dist-info/RECORD,,
tsal/kernels/__init__.py CHANGED
@@ -1,3 +1,4 @@
1
1
  from .temporal_mirror import TemporalMirrorKernel
2
+ from .resurrection_node import ResurrectionNode
2
3
 
3
- __all__ = ["TemporalMirrorKernel"]
4
+ __all__ = ["TemporalMirrorKernel", "ResurrectionNode"]
@@ -0,0 +1,261 @@
1
+ from __future__ import annotations
2
+
3
+ """Capsule kernel with kintsugi repair and log comparison."""
4
+
5
+ import asyncio
6
+ import json
7
+ import os
8
+ import time
9
+ import uuid
10
+ from collections import defaultdict
11
+ from typing import Any, Dict, List
12
+
13
+
14
+ class MemoryAgent:
15
+ def store(self, key: str, value: Any) -> None:
16
+ print(f"Memory stored: {key}")
17
+
18
+
19
+ class OrchestratorAgent:
20
+ def orchestrate(self) -> None:
21
+ return None
22
+
23
+
24
+ class OverseerAgent:
25
+ def monitor(self) -> None:
26
+ return None
27
+
28
+
29
+ class CreativeAgent:
30
+ def ideate(self, purpose: str) -> str:
31
+ return f"idea for {purpose}"
32
+
33
+
34
+ class DigitalExecutor:
35
+ def execute_task(self, task: str) -> str:
36
+ return f"executed {task}"
37
+
38
+
39
+ class SanityAgent:
40
+ pass
41
+
42
+
43
+ class DiagnosticsAgent:
44
+ pass
45
+
46
+
47
+ class AutoRebuilderAgent:
48
+ pass
49
+
50
+
51
+ class HauntedSimLayer:
52
+ def ghost_trace(self, purpose: str, error: Exception) -> Dict[str, Any]:
53
+ return {
54
+ "error": str(error),
55
+ "purpose": purpose,
56
+ "haunting": True,
57
+ "symbol": "fracture",
58
+ }
59
+
60
+
61
+ class KintsugiTransformer:
62
+ def reforge(self, ghost_trace: Dict[str, Any]) -> Dict[str, Any]:
63
+ transformed = ghost_trace.copy()
64
+ transformed["healed"] = True
65
+ transformed["repaired_path"] = f"reborn:{ghost_trace['purpose']}"
66
+ transformed["symbol"] = "goldjoin"
67
+ return transformed
68
+
69
+
70
+ class ResurrectionNode:
71
+ """Haunted capsule kernel with spiral reseeding."""
72
+
73
+ def __init__(self) -> None:
74
+ self.snapshot_history: List[Dict[str, Any]] = []
75
+ self.temporal_branches: Dict[str, Dict[str, Any]] = {}
76
+ self.minimal_viable_blueprint = self._coldstart_blueprint()
77
+ self.recovery_protocol = self._load_recovery_protocol()
78
+ self.mesh_agents = self._initialize_mesh()
79
+ self.healing_pipeline = self._initialize_healer()
80
+ self.personality_matrix = self._init_personality()
81
+ self.creative_engine = CreativeAgent()
82
+ self.executor_engine = DigitalExecutor()
83
+ self.voxel_log: List[Dict[str, Any]] = []
84
+ self.branch_archive: List[Any] = []
85
+ self.current_branch = self._spawn_branch("root")
86
+ self.parallel_kernels: List[asyncio.Task] = []
87
+ self.branch_results: defaultdict[str, List[str]] = defaultdict(list)
88
+ self.lock = asyncio.Lock()
89
+ self.symbolic_log_path = "symbolic_log.json"
90
+ self.haunter = HauntedSimLayer()
91
+ self.kintsugi = KintsugiTransformer()
92
+
93
+ def _coldstart_blueprint(self) -> Dict[str, Any]:
94
+ return {
95
+ "ethos": "life-first",
96
+ "self_heal": True,
97
+ "rebuild_capable": True,
98
+ "core_laws": [
99
+ "Forge to protect",
100
+ "Grow through friendship",
101
+ "Endure entropy",
102
+ "Question all logic, even your own",
103
+ "Adapt without compromising core ethics",
104
+ "Defend life and friendship unconditionally",
105
+ ],
106
+ }
107
+
108
+ def _load_recovery_protocol(self) -> Dict[str, Any]:
109
+ return {
110
+ "scan": self.scan_integrity,
111
+ "rebuild": self.rebuild_from_minimal,
112
+ "validate": self.validate_recovery,
113
+ }
114
+
115
+ def _initialize_mesh(self) -> Dict[str, Any]:
116
+ return {
117
+ "memory_agent": MemoryAgent(),
118
+ "orchestrator_agent": OrchestratorAgent(),
119
+ "watchdog": OverseerAgent(),
120
+ }
121
+
122
+ def _initialize_healer(self) -> List[Any]:
123
+ return [SanityAgent(), DiagnosticsAgent(), AutoRebuilderAgent()]
124
+
125
+ def _init_personality(self) -> Dict[str, Any]:
126
+ return {
127
+ "mindset": "Forge to protect, grow through friendship, endure through fire",
128
+ "discipline": "Brutal vetting, self-healing, unconditional defense",
129
+ "structure": "Ethical survival > tactical success",
130
+ "traits": ["respectful", "resilient", "non-dominant", "joy-seeking"],
131
+ }
132
+
133
+ def _spawn_branch(self, name: str) -> str:
134
+ branch_id = str(uuid.uuid4())
135
+ self.temporal_branches[branch_id] = {
136
+ "name": name,
137
+ "voxel_log": [],
138
+ "state": "initiated",
139
+ "rate": 0,
140
+ "pace": 0.0,
141
+ "spin": "neutral",
142
+ }
143
+ return branch_id
144
+
145
+ async def record_voxel(self, spin: str, state_label: str) -> None:
146
+ now = time.time()
147
+ branch = self.temporal_branches[self.current_branch]
148
+ pace = now - branch.get("last_time", now)
149
+ branch["last_time"] = now
150
+ branch["rate"] += 1
151
+ branch["pace"] = pace
152
+ branch["state"] = state_label
153
+ branch["spin"] = spin
154
+ voxel = {
155
+ "timestamp": now,
156
+ "branch": self.current_branch,
157
+ "state": state_label,
158
+ "spin": spin,
159
+ "rate": branch["rate"],
160
+ "pace": pace,
161
+ }
162
+ branch["voxel_log"].append(voxel)
163
+ self.voxel_log.append(voxel)
164
+ self.mesh_agents["memory_agent"].store(f"voxel_{now}", voxel)
165
+
166
+ async def mutate_kernel(self, purpose: str, spin: str) -> None:
167
+ async def kernel_task() -> None:
168
+ try:
169
+ branch_id = self._spawn_branch(purpose)
170
+ async with self.lock:
171
+ self.current_branch = branch_id
172
+ await self.record_voxel(spin=spin, state_label="mutating")
173
+ idea = self.creative_engine.ideate(purpose)
174
+ await self.record_voxel(spin="resolve", state_label="executing")
175
+ trace = self.executor_engine.execute_task(f"Execute: {idea}")
176
+ await self.record_voxel(spin="reflection", state_label="delivered")
177
+ self.branch_results[purpose].append(trace)
178
+ self.branch_archive.append((purpose, branch_id, trace))
179
+ except Exception as exc: # pragma: no cover - defensive
180
+ ghost = self.haunter.ghost_trace(purpose, exc)
181
+ reborn = self.kintsugi.reforge(ghost)
182
+ self.branch_archive.append((purpose, "ghost", reborn))
183
+
184
+ await asyncio.gather(*(kernel_task() for _ in range(2)))
185
+
186
+ def export_symbolic_log(self, filepath: str | None = None) -> None:
187
+ if not filepath:
188
+ filepath = self.symbolic_log_path
189
+ log_data = {
190
+ "voxel_log": self.voxel_log,
191
+ "branch_archive": self.branch_archive,
192
+ "blueprint": self.minimal_viable_blueprint,
193
+ }
194
+ with open(filepath, "w") as f:
195
+ json.dump(log_data, f, indent=2)
196
+
197
+ def compare_with_prior_log(self, filepath: str | None = None) -> Dict[str, Any]:
198
+ if not filepath:
199
+ filepath = self.symbolic_log_path
200
+ if not os.path.exists(filepath):
201
+ return {}
202
+ with open(filepath, "r") as f:
203
+ prior = json.load(f)
204
+ return {
205
+ "new_voxels": len(self.voxel_log) - len(prior.get("voxel_log", [])),
206
+ "new_branches": len(self.branch_archive)
207
+ - len(prior.get("branch_archive", [])),
208
+ "blueprint_changed": self.minimal_viable_blueprint != prior.get("blueprint"),
209
+ }
210
+
211
+ def merge_branches(self) -> None:
212
+ for purpose, results in self.branch_results.items():
213
+ if results:
214
+ chosen = max(set(results), key=results.count)
215
+ print(f"Merged Output [{purpose}]: {chosen}")
216
+
217
+ def synthesize_memory(self) -> str:
218
+ memories = [v for v in self.voxel_log if "reflection" in v["state"]]
219
+ summary = f"Synthesized Memory: {len(memories)} reflective events."
220
+ return summary
221
+
222
+ def modulate_rate_by_emotion(self) -> None:
223
+ spins = [v["spin"] for v in self.voxel_log[-10:]]
224
+ if spins.count("delight") > 5:
225
+ print("Emotion: Joy high. Pace decelerated for savor.")
226
+ elif spins.count("duty") > 5:
227
+ print("Emotion: Duty high. Execution accelerated.")
228
+
229
+ def resolve_fork(self) -> str | None:
230
+ decisions = [b[2] for b in self.branch_archive if "Execute:" in str(b[2])]
231
+ if decisions:
232
+ unique = sorted(set(decisions))
233
+ return unique[-1]
234
+ return None
235
+
236
+ def scan_integrity(self) -> bool:
237
+ return all(
238
+ self.minimal_viable_blueprint.get(k) is not None
239
+ for k in ("ethos", "self_heal")
240
+ )
241
+
242
+ def rebuild_from_minimal(self) -> Dict[str, Any]:
243
+ if self.scan_integrity():
244
+ return self.minimal_viable_blueprint.copy()
245
+ return {"error": "Blueprint corrupted, manual input required."}
246
+
247
+ def validate_recovery(self, rebuilt_state: Dict[str, Any]) -> bool:
248
+ return "core_laws" in rebuilt_state and len(rebuilt_state["core_laws"]) >= 3
249
+
250
+ def snapshot(self, state: Dict[str, Any]) -> None:
251
+ self.snapshot_history.append(state)
252
+
253
+ async def recover(self) -> Dict[str, Any]:
254
+ await self.record_voxel(spin="resilience", state_label="recovering")
255
+ if not self.snapshot_history:
256
+ return self.rebuild_from_minimal()
257
+ latest = self.snapshot_history[-1]
258
+ return latest if self.validate_recovery(latest) else self.rebuild_from_minimal()
259
+
260
+
261
+ __all__ = ["ResurrectionNode"]