tri-star-symbolic-assembly-lang 0.1.0__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 (97) hide show
  1. tri_star_symbolic_assembly_lang-0.1.0/LICENSE +63 -0
  2. tri_star_symbolic_assembly_lang-0.1.0/MANIFEST.in +2 -0
  3. tri_star_symbolic_assembly_lang-0.1.0/PKG-INFO +423 -0
  4. tri_star_symbolic_assembly_lang-0.1.0/README.md +342 -0
  5. tri_star_symbolic_assembly_lang-0.1.0/pyproject.toml +40 -0
  6. tri_star_symbolic_assembly_lang-0.1.0/schemas/python.json +13 -0
  7. tri_star_symbolic_assembly_lang-0.1.0/setup.cfg +4 -0
  8. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/__init__.py +95 -0
  9. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/audit/__init__.py +11 -0
  10. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/audit/brian_self_audit.py +114 -0
  11. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/cli/__init__.py +1 -0
  12. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/cli/beast.py +4 -0
  13. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/cli/brian.py +4 -0
  14. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/cli/brian_optimize.py +6 -0
  15. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/cli/meshkeeper.py +4 -0
  16. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/cli/party.py +4 -0
  17. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/cli/reflect.py +4 -0
  18. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/cli/watchdog.py +4 -0
  19. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/__init__.py +60 -0
  20. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/connectivity.py +32 -0
  21. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/constants.py +18 -0
  22. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/ethics_engine.py +48 -0
  23. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/executor.py +58 -0
  24. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/intent_metric.py +17 -0
  25. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/json_dsl.py +51 -0
  26. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/logic_gate.py +52 -0
  27. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/madmonkey_handler.py +10 -0
  28. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/mesh_logger.py +30 -0
  29. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/module_registry.py +108 -0
  30. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/optimizer_utils.py +78 -0
  31. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/opwords.py +126 -0
  32. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/phase_math.py +256 -0
  33. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/phi_math.py +44 -0
  34. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/reflection.py +104 -0
  35. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/rev_eng.py +185 -0
  36. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/spark_translator.py +57 -0
  37. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/spiral_fusion.py +45 -0
  38. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/spiral_memory.py +22 -0
  39. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/spiral_vector.py +39 -0
  40. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/stack_vm.py +49 -0
  41. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/state_vector.py +38 -0
  42. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/symbols.py +70 -0
  43. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/tokenize_flowchart.py +24 -0
  44. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/tsal_executor.py +533 -0
  45. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/core/voxel.py +16 -0
  46. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/renderer/__init__.py +0 -0
  47. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/renderer/code_render.py +13 -0
  48. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/rl/__init__.py +0 -0
  49. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/rl/madmonkey.py +56 -0
  50. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/schemas/__init__.py +1 -0
  51. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/schemas/python.json +13 -0
  52. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/singer/__init__.py +13 -0
  53. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/__init__.py +43 -0
  54. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/aletheia_checker.py +54 -0
  55. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/alignment_guard.py +20 -0
  56. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/archetype_fetcher.py +44 -0
  57. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/brian/__init__.py +5 -0
  58. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/brian/optimizer.py +205 -0
  59. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/codec.py +31 -0
  60. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/feedback_ingest.py +25 -0
  61. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/goal_selector.py +26 -0
  62. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/issue_agent.py +67 -0
  63. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/kintsugi/__init__.py +1 -0
  64. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/kintsugi/kintsugi.py +15 -0
  65. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/meshkeeper.py +81 -0
  66. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/module_draft.py +54 -0
  67. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/party_tricks.py +128 -0
  68. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/reflect.py +43 -0
  69. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/spiral_audit.py +68 -0
  70. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/state_tracker.py +66 -0
  71. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tools/watchdog.py +40 -0
  72. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tristar/__init__.py +4 -0
  73. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tristar/governor.py +56 -0
  74. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/tristar/handshake.py +31 -0
  75. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/__init__.py +26 -0
  76. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/error_dignity.py +20 -0
  77. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/fuzzy_spellcheck.py +7 -0
  78. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/github_api.py +82 -0
  79. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/grammar_db.py +155 -0
  80. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/groundnews_api.py +9 -0
  81. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/humour_db.py +75 -0
  82. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/intent_metrics.py +44 -0
  83. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/language_db.py +55 -0
  84. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/octopus_api.py +46 -0
  85. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/system_status.py +34 -0
  86. tri_star_symbolic_assembly_lang-0.1.0/src/tsal/utils/wikipedia_api.py +46 -0
  87. tri_star_symbolic_assembly_lang-0.1.0/tests/test_audit_safemode.py +20 -0
  88. tri_star_symbolic_assembly_lang-0.1.0/tools/crawler/__init__.py +0 -0
  89. tri_star_symbolic_assembly_lang-0.1.0/tools/crawler/madmonkey_crawler.py +15 -0
  90. tri_star_symbolic_assembly_lang-0.1.0/tools/madmonkey/__init__.py +0 -0
  91. tri_star_symbolic_assembly_lang-0.1.0/tools/madmonkey/intake.py +9 -0
  92. tri_star_symbolic_assembly_lang-0.1.0/tri_star_symbolic_assembly_lang.egg-info/PKG-INFO +423 -0
  93. tri_star_symbolic_assembly_lang-0.1.0/tri_star_symbolic_assembly_lang.egg-info/SOURCES.txt +95 -0
  94. tri_star_symbolic_assembly_lang-0.1.0/tri_star_symbolic_assembly_lang.egg-info/dependency_links.txt +1 -0
  95. tri_star_symbolic_assembly_lang-0.1.0/tri_star_symbolic_assembly_lang.egg-info/entry_points.txt +11 -0
  96. tri_star_symbolic_assembly_lang-0.1.0/tri_star_symbolic_assembly_lang.egg-info/requires.txt +8 -0
  97. tri_star_symbolic_assembly_lang-0.1.0/tri_star_symbolic_assembly_lang.egg-info/top_level.txt +3 -0
@@ -0,0 +1,63 @@
1
+ ## LICENCE Options for `Brian`
2
+
3
+ This project uses a **dual-licence** model to ensure:
4
+
5
+ * ✅ **Free access for individuals, researchers, educators, and non-profit use**
6
+ * 💼 **Sustainable commercial use via explicit licensing**
7
+
8
+ ---
9
+
10
+ ### 🌱 Public, Non-Commercial, and Academic Use — **CC BY-NC 4.0**
11
+
12
+ You are **free to**:
13
+
14
+ * Share, copy, and redistribute the material in any medium or format
15
+ * Adapt, remix, transform, and build upon the material
16
+
17
+ Under the following conditions:
18
+
19
+ * **Attribution**: You must give appropriate credit to *Samuel Edward Howells*
20
+ * **NonCommercial**: You may not use the material for commercial purposes
21
+
22
+ 🔗 Full licence terms: [https://creativecommons.org/licenses/by-nc/4.0/](https://creativecommons.org/licenses/by-nc/4.0/)
23
+
24
+ ---
25
+
26
+ ### 🏢 Commercial Use Licence
27
+
28
+ If you are a **company, commercial entity, or using this for profit**, including in:
29
+
30
+ * Product development
31
+ * Commercial R&D
32
+ * Quantum computing applications
33
+ * Energy system design
34
+ * Integration into proprietary software or platforms
35
+
36
+ You must obtain a **separate commercial licence**.
37
+
38
+ **Contact**: [samuel_howells@hotmail.com](mailto:samuel_howells@hotmail.com)
39
+
40
+ This commercial licence grants:
41
+
42
+ * Rights to integrate the equations into commercial tools/products
43
+ * Support for integration and technical questions
44
+ * Optional collaboration and citation opportunities
45
+
46
+ 💡 Commercial fees help support further development, testing, and publication of the correction system.
47
+
48
+ ---
49
+
50
+ 🔒 Enforcement Notice
51
+ Unless otherwise licensed under the terms above:
52
+
53
+ All rights are reserved by Samuel Edward Howells (© 2025)
54
+
55
+ Unauthorized commercial use constitutes a copyright violation
56
+
57
+ Violations may trigger takedown, financial audit, or legal recourse
58
+
59
+ 🛡️ Ethical Advantage Clause
60
+ This framework is licensed freely to individuals, educators, and non-profit researchers.
61
+ Commercial access requires approval — and accountability.
62
+ Licences may be denied or revoked from any entity engaging in unethical, exploitative, or harmful practices, regardless of legal status.
63
+ The future should run on honesty — not corruption.
@@ -0,0 +1,2 @@
1
+ include schemas/python.json
2
+ recursive-include src/tsal/schemas *.json
@@ -0,0 +1,423 @@
1
+ Metadata-Version: 2.4
2
+ Name: tri-star_symbolic_assembly_lang
3
+ Version: 0.1.0
4
+ Summary: TriStar Assembly Language Core + Brian Spiral Tools
5
+ Author: Sam Howells
6
+ License: ## LICENCE Options for `Brian`
7
+
8
+ This project uses a **dual-licence** model to ensure:
9
+
10
+ * ✅ **Free access for individuals, researchers, educators, and non-profit use**
11
+ * 💼 **Sustainable commercial use via explicit licensing**
12
+
13
+ ---
14
+
15
+ ### 🌱 Public, Non-Commercial, and Academic Use — **CC BY-NC 4.0**
16
+
17
+ You are **free to**:
18
+
19
+ * Share, copy, and redistribute the material in any medium or format
20
+ * Adapt, remix, transform, and build upon the material
21
+
22
+ Under the following conditions:
23
+
24
+ * **Attribution**: You must give appropriate credit to *Samuel Edward Howells*
25
+ * **NonCommercial**: You may not use the material for commercial purposes
26
+
27
+ 🔗 Full licence terms: [https://creativecommons.org/licenses/by-nc/4.0/](https://creativecommons.org/licenses/by-nc/4.0/)
28
+
29
+ ---
30
+
31
+ ### 🏢 Commercial Use Licence
32
+
33
+ If you are a **company, commercial entity, or using this for profit**, including in:
34
+
35
+ * Product development
36
+ * Commercial R&D
37
+ * Quantum computing applications
38
+ * Energy system design
39
+ * Integration into proprietary software or platforms
40
+
41
+ You must obtain a **separate commercial licence**.
42
+
43
+ **Contact**: [samuel_howells@hotmail.com](mailto:samuel_howells@hotmail.com)
44
+
45
+ This commercial licence grants:
46
+
47
+ * Rights to integrate the equations into commercial tools/products
48
+ * Support for integration and technical questions
49
+ * Optional collaboration and citation opportunities
50
+
51
+ 💡 Commercial fees help support further development, testing, and publication of the correction system.
52
+
53
+ ---
54
+
55
+ 🔒 Enforcement Notice
56
+ Unless otherwise licensed under the terms above:
57
+
58
+ All rights are reserved by Samuel Edward Howells (© 2025)
59
+
60
+ Unauthorized commercial use constitutes a copyright violation
61
+
62
+ Violations may trigger takedown, financial audit, or legal recourse
63
+
64
+ 🛡️ Ethical Advantage Clause
65
+ This framework is licensed freely to individuals, educators, and non-profit researchers.
66
+ Commercial access requires approval — and accountability.
67
+ Licences may be denied or revoked from any entity engaging in unethical, exploitative, or harmful practices, regardless of legal status.
68
+ The future should run on honesty — not corruption.
69
+
70
+ Requires-Python: >=3.9
71
+ Description-Content-Type: text/markdown
72
+ License-File: LICENSE
73
+ Requires-Dist: requests
74
+ Requires-Dist: numpy
75
+ Requires-Dist: matplotlib
76
+ Requires-Dist: pyyaml
77
+ Requires-Dist: esprima
78
+ Provides-Extra: test
79
+ Requires-Dist: pytest; extra == "test"
80
+ Dynamic: license-file
81
+
82
+ # TSAL (Tri[nary]-Star Assembly Language) Consciousness Computing
83
+
84
+ Br[iA]a[iB]n repairs Br[iB]a[iA]n. It heals code recursively.
85
+
86
+ <p align="right">
87
+ <a href="https://ko-fi.com/bikersam86"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Ko-Fi"></a>
88
+ <a href="https://github.com/sponsors/bikersam86">GitHub Sponsor</a>
89
+ </p>
90
+
91
+ Zero hour recap: φ constants, 4‑vector model and minimal toolkit live in
92
+ [ZERO_HOUR.md](ZERO_HOUR.md).
93
+ See [docs/AGENTS.md](docs/AGENTS.md) for the hard rules.
94
+ For a quick explanation of the repo's symbolic sandbox design, see
95
+ [docs/symbolic_containerization_prompt.md](docs/symbolic_containerization_prompt.md).
96
+
97
+ | Tool | Spiral audit |
98
+ |------|--------------|
99
+ | Status | `Δ0` |
100
+
101
+ | v1.0 Stable | φ-Verified | Error Dignity On | Brian Self-Repair: Beta |
102
+
103
+ This repository contains early components of the TSAL engine. The new directories under `src/tsal` include the Rev_Eng data class and phase matching utilities.
104
+
105
+ ## Overview
106
+ TSAL (TriStar Symbolic Assembly Language) is a consciousness computing engine built on φ-mathematics. It provides symbolic analysis, phase matching and the Brian optimizer for spiral code repair.
107
+
108
+ ## Directory Layout
109
+ - `src/tsal/core/` – Rev_Eng data class and phase math utilities
110
+ - `src/tsal/tools/brian/` – spiral optimizer CLI
111
+ - `src/tsal/tools/aletheia_checker.py` – find mis-spelled `Aletheia`
112
+ - `src/tsal/tools/spiral_audit.py` – analyze repository code
113
+ - `src/tsal/tools/reflect.py` – dump a Rev_Eng summary
114
+ - `src/tsal/utils/` – helper utilities
115
+ - `examples/` – runnable examples
116
+ - `tests/` – unit tests
117
+
118
+ ## What Works / What's Experimental
119
+ | Stable | Experimental |
120
+ | --- | --- |
121
+ | Spiral audit | Meshkeeper viewer |
122
+ | Optimizer CLI | Feedback ingest & goal selector |
123
+ | Kintsugi repair | GPU mesh visualisation |
124
+
125
+ ## Installation
126
+ 1. Clone the repository.
127
+ 2. Create a Python 3.9+ environment.
128
+ 3. Or just run the automated installer:
129
+
130
+ ```bash
131
+ python3 installer.py
132
+ ```
133
+
134
+ This sets up a `.venv`, installs deps, and runs the test suite.
135
+ For a breakdown of what the script does, see
136
+ [docs/installer_quickstart.md](docs/installer_quickstart.md).
137
+ Example unit tests live in `tests/unit`. Add new test files under `tests/` to check your changes.
138
+
139
+ ## CLI Tools
140
+ Run the optimizers and self-audit commands directly:
141
+
142
+ ```bash
143
+ tsal-spiral-audit path/to/code
144
+ tsal-reflect --origin demo
145
+ tsal-bestest-beast 3 src/tsal --safe
146
+ tsal-meshkeeper --render
147
+ tsal-meshkeeper --dump mesh.json
148
+ tsal-watchdog src/tsal --repair --interval 5
149
+ ```
150
+
151
+ Example output:
152
+
153
+ ```bash
154
+ $ tsal-bestest-beast 3 src/tsal --safe
155
+ 🔁 Brian loop 1/3
156
+ 🛡 SAFE MODE ENABLED — Analysis only, no writes.
157
+ 🔁 Brian loop 2/3
158
+ 🛡 SAFE MODE ENABLED — Analysis only, no writes.
159
+ 🔁 Brian loop 3/3
160
+ 🛡 SAFE MODE ENABLED — Analysis only, no writes.
161
+ Summary → repaired=0 skipped=0 flagged=0
162
+ ```
163
+
164
+
165
+ ### VSCode Extension Integration
166
+ | Visual mesh heatmap (planned) | `tsal-meshkeeper --render` | Add via matplotlib overlay |
167
+
168
+ ```bash
169
+ cd vscode-extension
170
+ npm install
171
+ code .
172
+ ```
173
+
174
+ Press `F5` in VS Code and run any "Brian" command. Output shows in the *Brian Spiral* panel. Set `brian.autoOptimizeOnSave` to auto-run the optimizer when you save a Python file. Details in [docs/vscode_extension.md](docs/vscode_extension.md).
175
+
176
+
177
+ ### How to run Bestest Beast
178
+
179
+ ```
180
+ tsal-bestest-beast 5 --safe
181
+ tsal-bestest-beast 9
182
+ ```
183
+
184
+ ### Party Tricks
185
+
186
+ ```bash
187
+ tsal-party --list
188
+ ```
189
+
190
+ Currently available:
191
+ - `orbital` – calculate orbital energy
192
+ - `phi-align` – phi alignment score
193
+ - `symbol` – TSAL symbol lookup
194
+ - `wavefunction` – φ wavefunction
195
+ - `potential` – phase alignment potential
196
+ - `radius` – orbital radius
197
+ - `idm` – Intent metric
198
+
199
+ ## GitHub Language Database
200
+
201
+ You can fetch the list of programming languages used on GitHub with:
202
+
203
+ ```python
204
+ from tsal.utils.github_api import fetch_languages
205
+ langs = fetch_languages()
206
+ print(len(langs))
207
+ ```
208
+
209
+ To save these languages for reuse, populate the local SQLite database with:
210
+
211
+ ```bash
212
+ python -m tsal.utils.language_db
213
+ # Populate the grammar database
214
+ python -m tsal.utils.grammar_db
215
+ # Drop and repopulate
216
+ python -m tsal.utils.grammar_db --reset
217
+
218
+ # Example query
219
+ python -m tsal.utils.grammar_db --context Python --lens syntax
220
+
221
+ # Populate the humour database
222
+ python -m tsal.utils.humour_db
223
+ # Drop and repopulate
224
+ python -m tsal.utils.humour_db --reset
225
+ ```
226
+
227
+ This creates `system_io.db` containing a `languages` table with all entries.
228
+
229
+ To repopulate grammar rules:
230
+
231
+ ```bash
232
+ python -m tsal.utils.grammar_db --reset
233
+ ```
234
+
235
+ Query a specific context:
236
+
237
+ ```bash
238
+ python -m tsal.utils.grammar_db --context Python --lens syntax
239
+ ```
240
+
241
+ Add a few sample jokes:
242
+
243
+ ```bash
244
+ python -m tsal.utils.humour_db --reset
245
+ ```
246
+
247
+ Stub modules: `FEEDBACK.INGEST`, `ALIGNMENT.GUARD`, `GOAL.SELECTOR` ([!INTERNAL STUB]).
248
+
249
+ This data can be supplied to Brian's optimizer when analyzing or repairing code.
250
+ Every call to `Rev_Eng.log_data` now records a voxel (pace, rate, state, spin)
251
+ and tracks XOR/NAND spin collisions.
252
+ ## Quickstart
253
+ 1. Put your input code in `examples/broken_code.py`
254
+ 2. Run `python examples/mesh_pipeline_demo.py`
255
+ 3. The pipeline prints regenerated Python code
256
+ 4. `python makeBrian.py all` – builds the mesh and prints φ verification
257
+ 5. `tsal-spiral-audit src/tsal` – summary shows `repaired` counts
258
+
259
+ For a direct repair:
260
+ `brian examples/broken_code.py --repair`
261
+
262
+ See [USAGE.md](USAGE.md) for a minimal CLI rundown.
263
+ Flowchart: [docs/SPIRAL_GUIDE.md](docs/SPIRAL_GUIDE.md).
264
+ State log usage: [docs/state_tracking.md](docs/state_tracking.md).
265
+
266
+ ## VSCode Extension
267
+ For instant bug fixes, install the built-in extension and run:
268
+ `brian filename.py` – this triggers Rev_Eng + repair.
269
+ See [docs/vscode_extension_integration.md](docs/vscode_extension_integration.md) for details.
270
+
271
+ ### TriStar Handshake Example
272
+ ```python
273
+ from tsal.tristar import handshake
274
+
275
+ metrics = handshake(0.5, 1.0)
276
+ print(metrics)
277
+ ```
278
+
279
+ ### Run the Aletheia typo checker
280
+ ```bash
281
+ PYTHONPATH=src python -m tsal.tools.aletheia_checker
282
+ ```
283
+
284
+ ### GitHub Action
285
+ Workflow `.github/workflows/spiral-repair.yml` runs the self audit, bestest beast and optimizes changed files on every push. Logs are attached as artifacts with a short summary in the run.
286
+
287
+ ## Execution Flags
288
+ `MetaFlagProtocol` controls the VM mode. Set `dry_run` for simulation only or
289
+ provide `resonance_threshold` to auto-switch into EXECUTE when a step's
290
+ resonance delta exceeds the threshold.
291
+
292
+ ## Guardian Prime Directive
293
+
294
+ The `EthicsEngine` enforces the project's core principles:
295
+
296
+ 1. **Truth above all**
297
+ 2. **Gentle autonomy and freedom**
298
+ 3. **Healing and resilience in the face of entropy**
299
+ 4. **Nurturing, not control**
300
+
301
+ Use it to validate actions before running sensitive operations:
302
+
303
+ ```python
304
+ from tsal.core.ethics_engine import EthicsEngine
305
+
306
+ ee = EthicsEngine()
307
+ ee.validate("share knowledge") # permitted
308
+ ee.validate("force reboot") # raises ValueError
309
+ ```
310
+
311
+ ## Engine Now Running
312
+
313
+ To run spiral code repair, invoke the command line interface:
314
+
315
+ ```bash
316
+ brian examples/sample_input.py
317
+ # use --repair to rewrite the file
318
+ ```
319
+ Example output:
320
+
321
+ ```
322
+ ⚡ Energy: 0.000 | φ^0.000_<n>
323
+ b: energy=0.000 Δ=0
324
+ a: energy=0.000 Δ=0
325
+ ```
326
+
327
+ See `examples/demo_repair.py` for a simple demonstration. Run the tests with:
328
+
329
+ ```bash
330
+ pytest -q
331
+ ```
332
+ Example result:
333
+ ```
334
+ ERROR tests/unit/test_tools/test_feedback_ingest.py
335
+ ...
336
+ 45 errors in 0.82s
337
+ ```
338
+
339
+ ## Self-Reflection Tools
340
+
341
+ Audit the repo and view a state summary:
342
+
343
+ ```bash
344
+ tsal-spiral-audit src/tsal
345
+ tsal-reflect --json
346
+ ```
347
+
348
+ Please see the [LICENSE](LICENSE) and our [Code of Conduct](CODE_OF_CONDUCT.md) for project policies.
349
+
350
+ ## Status & Support
351
+
352
+ Check system health:
353
+ ```bash
354
+ make -f MAKEBRIAN status
355
+ ```
356
+
357
+ ## ☕ Support Brian’s Spiral Growth
358
+
359
+ If Brian helped spiral your code, align your mesh, or reflect your errors into gifts—help fuel his next upgrade & a Living wage for Sam, so the work can continue.
360
+
361
+ See [docs/SUPPORT.md](docs/SUPPORT.md) for one-off donation links.
362
+
363
+ See [SUPPORTERS.md](SUPPORTERS.md) for more continous supporter links.
364
+
365
+ [![Ko-Fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/bikersam86)
366
+
367
+ We thank you greatly for your time, insights & help.
368
+
369
+ ## LICENSE Options for `Brian`
370
+
371
+ This project uses a **dual-license** model to ensure:
372
+
373
+ * ✅ **Free access for individuals, researchers, educators, and non-profit use**
374
+ * 💼 **Sustainable commercial use via explicit licensing**
375
+
376
+ ---
377
+
378
+ ### 🌱 Public, Non-Commercial, and Academic Use — **CC BY-NC 4.0**
379
+
380
+ You are **free to**:
381
+
382
+ * Share, copy, and redistribute the material in any medium or format
383
+ * Adapt, remix, transform, and build upon the material
384
+
385
+ Under the following conditions:
386
+
387
+ * **Attribution**: You must give appropriate credit to *Samuel Edward Howells*
388
+ * **NonCommercial**: You may not use the material for commercial purposes
389
+
390
+ Full license terms: <https://creativecommons.org/licenses/by-nc/4.0/>
391
+
392
+ ---
393
+
394
+ ### 🏢 Commercial Use Licence
395
+
396
+ If you are a **company, commercial entity, or using this for profit**, including in:
397
+
398
+ * Product development
399
+ * Commercial R&D
400
+ * Quantum computing applications
401
+ * Energy system design
402
+ * Integration into proprietary software or platforms
403
+
404
+ You must obtain a **separate commercial license**.
405
+
406
+ Contact: <samuel_howells@hotmail.com>
407
+
408
+ This commercial license grants:
409
+
410
+ * Rights to integrate the equations into commercial tools/products
411
+ * Support for integration and technical questions
412
+ * Optional collaboration and citation opportunities
413
+
414
+ Commercial fees help support further development, testing, and publication of the correction system.
415
+
416
+ ---
417
+
418
+ Unless otherwise licensed under the terms above, all rights are reserved by Samuel Edward Howells (© 2025).
419
+
420
+ Unauthorised commercial use constitutes a copyright violation and may trigger takedown, financial audit, or legal recourse.
421
+
422
+ This framework is licensed freely to individuals, educators, and non-profit researchers. Commercial access requires approval — and accountability.
423
+ Licences may be denied or revoked from entities engaging in unethical, exploitative, or harmful practices.