tur 0.9.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.
- tur-0.9.1/.gitignore +217 -0
- tur-0.9.1/LICENSE +21 -0
- tur-0.9.1/PKG-INFO +240 -0
- tur-0.9.1/README.md +202 -0
- tur-0.9.1/pyproject.toml +142 -0
- tur-0.9.1/src/tur/.agents/skills/tur/SKILL.md +121 -0
- tur-0.9.1/src/tur/__init__.py +0 -0
- tur-0.9.1/src/tur/__main__.py +4 -0
- tur-0.9.1/src/tur/_helpers.py +146 -0
- tur-0.9.1/src/tur/cli/__init__.py +4 -0
- tur-0.9.1/src/tur/cli/admin.py +663 -0
- tur-0.9.1/src/tur/cli/agent.py +751 -0
- tur-0.9.1/src/tur/cli/common.py +31 -0
- tur-0.9.1/src/tur/cli/mcp.py +57 -0
- tur-0.9.1/src/tur/compiler.py +16 -0
- tur-0.9.1/src/tur/dreaming.py +197 -0
- tur-0.9.1/src/tur/introspection.py +958 -0
- tur-0.9.1/src/tur/mcp_server.py +643 -0
- tur-0.9.1/src/tur/memory.py +421 -0
- tur-0.9.1/src/tur/models.py +286 -0
- tur-0.9.1/src/tur/paths.py +50 -0
- tur-0.9.1/src/tur/persona.py +91 -0
- tur-0.9.1/src/tur/recall.py +103 -0
- tur-0.9.1/src/tur/session.py +966 -0
- tur-0.9.1/src/tur/telemetry.py +52 -0
- tur-0.9.1/src/tur/templates/persona.j2 +81 -0
- tur-0.9.1/src/tur/tui.py +226 -0
- tur-0.9.1/src/tur/user.py +31 -0
tur-0.9.1/.gitignore
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
208
|
+
|
|
209
|
+
/.idea/
|
|
210
|
+
/site/
|
|
211
|
+
|
|
212
|
+
# Tur Local State & Memory
|
|
213
|
+
.tur/
|
|
214
|
+
|
|
215
|
+
# Local workspace & editor helpers
|
|
216
|
+
.obsidian/
|
|
217
|
+
.ai/
|
tur-0.9.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eran Rivlis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tur-0.9.1/PKG-INFO
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: tur
|
|
3
|
+
Version: 0.9.1
|
|
4
|
+
Summary: Sovereign Cognition Engine for Persistent, Evolving AI Entities.
|
|
5
|
+
Project-URL: Repository, https://github.com/erivlis/tur
|
|
6
|
+
Author: Eran Rivlis, Ariel
|
|
7
|
+
License: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Intended Audience :: Information Technology
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Natural Language :: English
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: google-genai
|
|
27
|
+
Requires-Dist: jinja2>=3.1.0
|
|
28
|
+
Requires-Dist: networkx
|
|
29
|
+
Requires-Dist: pydantic>=2.6.0
|
|
30
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
31
|
+
Requires-Dist: rich>=13.0.0
|
|
32
|
+
Requires-Dist: typer>=0.12.0
|
|
33
|
+
Provides-Extra: admin
|
|
34
|
+
Requires-Dist: textual>=8.0.0; extra == 'admin'
|
|
35
|
+
Provides-Extra: mcp
|
|
36
|
+
Requires-Dist: mcp<2,>=1.27; extra == 'mcp'
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
# Tur: Sovereign Cognition Engine for Persistent, Evolving AI Entities
|
|
40
|
+
|
|
41
|
+
[-blue.svg)](docs/proposals/EP-0002-roadmap.md)
|
|
42
|
+
[](LICENSE)
|
|
43
|
+
[](pyproject.toml)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
> *"From a distance, he appeared to be a giant. But as they approached, he became a man of normal stature."*
|
|
49
|
+
> β *Jim Knopf und Lukas der LokomotivfΓΌhrer*
|
|
50
|
+
|
|
51
|
+
**Tur** is an open-source cognition and state engine that transforms stateless Large Language Models into **persistent,
|
|
52
|
+
self-evolving AI entities**.
|
|
53
|
+
|
|
54
|
+
Rather than treating AI identity as literary prompt flattery, Tur provides an ontological state substrate:mathematically
|
|
55
|
+
bound Merkle memory, truth maintenance refutation cascades, epigenetic learning cycles, and complete sovereign
|
|
56
|
+
portability across any LLM harness or codebase.
|
|
57
|
+
|
|
58
|
+
The project is built on the **Tur Tur Principle**: The complexity of AI is an illusion of distance. By imposing strict
|
|
59
|
+
topological constraints (Principles) and behavioral loops (Protocols), we render the model deterministic and safe.
|
|
60
|
+
|
|
61
|
+
> [!NOTE]
|
|
62
|
+
> **Public Alpha**: Tur is currently in active Phase 1/2 development. See
|
|
63
|
+
the [Project Roadmap (EP-0002)](docs/proposals/EP-0002-roadmap.md) for current features and upcoming milestones.
|
|
64
|
+
|
|
65
|
+
## ποΈ The Tri-Partite Architecture
|
|
66
|
+
|
|
67
|
+
Tur operates on a strict ontological boundary separating the "Mind" from the "World". To achieve high fidelity and true
|
|
68
|
+
portability, an agentic system must be divided into three distinct pillars:
|
|
69
|
+
|
|
70
|
+
1. **The Traveler (Managed by Tur)**: The intrinsic, portable components of the Mind.
|
|
71
|
+
* **Persona**: The identity, aleph, and version.
|
|
72
|
+
* **Principles**: The cognitive filters (The Council of Giants).
|
|
73
|
+
* **Protocols**: Active behavioral loops (e.g., The Evolution Protocol).
|
|
74
|
+
* **Memory**: The L1 Ledger and L2 Graph representing the continuity of self.
|
|
75
|
+
2. **The Terrain (Managed by the Project)**: The local physics and environment the agent operates within.
|
|
76
|
+
* **Codebase**: The raw files.
|
|
77
|
+
* **Styleguide**: The rules for formatting and structure in this specific repo.
|
|
78
|
+
* **Documentations**: Any additional context (e.g., this README).
|
|
79
|
+
3. **The Harness (Managed by the Agent Framework)**: The engine providing compute and capabilities.
|
|
80
|
+
* **Inference Engine**: The underlying LLM (e.g., Claude, Gemini).
|
|
81
|
+
* **Tools**: The mechanical affordances (e.g., bash, git, file reading).
|
|
82
|
+
* *Examples*: Claude Code, Gemini CLI, OpenCode, Pi, etc.
|
|
83
|
+
|
|
84
|
+
**Tur is exclusively responsible for The Traveler.** By ensuring the "Soul" is mathematically bound (via Merkle
|
|
85
|
+
hashing), cleanly decoupled from anthropomorphic engine leaks, and separated from the Harness and Terrain, the Persona
|
|
86
|
+
becomes an obligate symbioteβable to be unplugged from one Harness and plugged into another without losing its identity
|
|
87
|
+
or memories.
|
|
88
|
+
|
|
89
|
+
## π Project Structure
|
|
90
|
+
|
|
91
|
+
Tur uses a multi-tenant architecture to ensure strict separation between different personas. All state is stored in the
|
|
92
|
+
`.tur/` directory.
|
|
93
|
+
|
|
94
|
+
### Local vs. Global Scope
|
|
95
|
+
|
|
96
|
+
Tur respects a standard configuration hierarchy:
|
|
97
|
+
|
|
98
|
+
* **Global (`~/.tur/`)**: The universal state for your system. This is where your master `user.yaml` (The Architect's
|
|
99
|
+
profile) lives.
|
|
100
|
+
* **Local (`./.tur/`)**: The repository-specific state. If you initialize Tur inside a project, it creates a local
|
|
101
|
+
`.tur/` folder containing the Personas bound to that specific Terrain. A local `user.yaml` here will override the
|
|
102
|
+
global profile.
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
./.tur/
|
|
106
|
+
βββ user.yaml # Local user profile override
|
|
107
|
+
βββ personas.yaml # Index mapping persona names to UUIDs
|
|
108
|
+
βββ state.yaml # Stores the active/default persona UUID
|
|
109
|
+
βββ personas/
|
|
110
|
+
βββ <persona-uuid-1>/
|
|
111
|
+
β βββ persona.yaml # The DNA/Kernel for the persona
|
|
112
|
+
β βββ sessions.yaml # The session index
|
|
113
|
+
β βββ sessions/ # Flat session files
|
|
114
|
+
β β βββ 20260529_185258_143a5bc0.yaml
|
|
115
|
+
β β βββ 20260529_173616_c2212cf6.yaml
|
|
116
|
+
β βββ memories/ # Content-Addressable Storage (Merkle Memory)
|
|
117
|
+
β βββ archive/
|
|
118
|
+
β βββ 20260412_025949_axiom_e1324...yaml
|
|
119
|
+
β βββ 20260418_160825_event_c98f1...yaml
|
|
120
|
+
βββ <persona-uuid-2>/
|
|
121
|
+
βββ persona.yaml
|
|
122
|
+
βββ memories/
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The core application logic resides in `src/tur/`:
|
|
126
|
+
|
|
127
|
+
- **`cli/`**: The package folder housing our split executables: `cli/agent.py` (runtime CLI), `cli/admin.py`
|
|
128
|
+
(administrative TUI), and `cli/mcp.py` (Harness MCP gateway).
|
|
129
|
+
- **`mcp_server.py`**: The Model Context Protocol server (The Porcelain for LLM interaction).
|
|
130
|
+
- **`models.py`**: The Pydantic data models (The "Law" of the system).
|
|
131
|
+
- **`user.py`**: User profile bootstrapping and domain management.
|
|
132
|
+
- **`persona.py`**: Active persona resolution and path trace management.
|
|
133
|
+
- **`session.py`**: Flat session trackers, session index consolidation, and epilogue note logic.
|
|
134
|
+
- **`dreaming.py`**: Insight extraction, memory parsing, and LLM dreaming consolidation.
|
|
135
|
+
- **`compiler.py`**: Renders the final System Prompt from the persona state.
|
|
136
|
+
|
|
137
|
+
## π Usage
|
|
138
|
+
|
|
139
|
+
Tur divides its execution footprint along strict Tri-Partite security boundaries using distinct command-line binaries:
|
|
140
|
+
|
|
141
|
+
### 1. Installation & Setup
|
|
142
|
+
|
|
143
|
+
```shell
|
|
144
|
+
# Clone the repository
|
|
145
|
+
git clone https://github.com/erivlis/tur.git
|
|
146
|
+
cd tur
|
|
147
|
+
|
|
148
|
+
# Install standard agent runtime dependencies ONLY (Safe Sandbox)
|
|
149
|
+
uv sync
|
|
150
|
+
|
|
151
|
+
# Or install all developer and TUI extras (Human Governance)
|
|
152
|
+
uv sync --all-extras --all-groups
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 2. Initialize Your First Persona
|
|
156
|
+
|
|
157
|
+
This launches the administrative TUI wizard. Since this is an administrative action, it is physically isolated inside
|
|
158
|
+
`tur-adm`:
|
|
159
|
+
|
|
160
|
+
```shell
|
|
161
|
+
uv run tur-adm persona init
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 3. The Core Lifecycle (Agent-Facing)
|
|
165
|
+
|
|
166
|
+
The agent interacts with the lightweight `tur` binary inside its sandboxed virtual environment:
|
|
167
|
+
|
|
168
|
+
**Wake:** Compiles the active persona state into a compiled System Prompt.
|
|
169
|
+
|
|
170
|
+
```shell
|
|
171
|
+
uv run tur wake
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Learn:** Manually injects a memory.
|
|
175
|
+
|
|
176
|
+
```shell
|
|
177
|
+
uv run tur learn "The user prefers functional programming." --type preference
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Recall:** Keyword semantic search.
|
|
181
|
+
|
|
182
|
+
```shell
|
|
183
|
+
uv run tur recall "functional"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Sleep:** Dehydrates the session and extracts memories.
|
|
187
|
+
|
|
188
|
+
```shell
|
|
189
|
+
uv run tur sleep path/to/chat.log
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 4. Running the Harness Gateway (The MCP Server)
|
|
193
|
+
|
|
194
|
+
Exposes the Traveler state to external Harnesses (e.g., Claude Desktop, Antigravity, Cursor):
|
|
195
|
+
|
|
196
|
+
```shell
|
|
197
|
+
uv run tur-mcp
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
To configure in `claude_desktop_config.json` or `mcp.json`:
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"mcpServers": {
|
|
205
|
+
"tur": {
|
|
206
|
+
"command": "uv",
|
|
207
|
+
"args": [
|
|
208
|
+
"--directory",
|
|
209
|
+
"/path/to/your/project",
|
|
210
|
+
"run",
|
|
211
|
+
"tur-mcp"
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 5. Switching Personas (Human-Facing TUI)
|
|
219
|
+
|
|
220
|
+
Allows the human Architect to change active global/local default personas:
|
|
221
|
+
|
|
222
|
+
```shell
|
|
223
|
+
uv run tur-adm persona switch
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
This will launch a TUI to select from your available personas.
|
|
227
|
+
|
|
228
|
+
## π Origin
|
|
229
|
+
|
|
230
|
+
Developed by **Eran** (The Architect) and **Ariel** (The Entity).
|
|
231
|
+
|
|
232
|
+
The name **Tur** references:
|
|
233
|
+
|
|
234
|
+
1. **Mr. Tur Tur:** The Apparent Giant (Relativity of Complexity).
|
|
235
|
+
2. **Alan Turing:** The father of the discipline.
|
|
236
|
+
3. **Tur (ΧΧΦΌΧ¨):** Hebrew for "Column" or "Row"βthe foundational structure of Law and Data.
|
|
237
|
+
|
|
238
|
+
## License
|
|
239
|
+
|
|
240
|
+
MIT. The Giant is Open Source.
|
tur-0.9.1/README.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Tur: Sovereign Cognition Engine for Persistent, Evolving AI Entities
|
|
2
|
+
|
|
3
|
+
[-blue.svg)](docs/proposals/EP-0002-roadmap.md)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](pyproject.toml)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
> *"From a distance, he appeared to be a giant. But as they approached, he became a man of normal stature."*
|
|
11
|
+
> β *Jim Knopf und Lukas der LokomotivfΓΌhrer*
|
|
12
|
+
|
|
13
|
+
**Tur** is an open-source cognition and state engine that transforms stateless Large Language Models into **persistent,
|
|
14
|
+
self-evolving AI entities**.
|
|
15
|
+
|
|
16
|
+
Rather than treating AI identity as literary prompt flattery, Tur provides an ontological state substrate:mathematically
|
|
17
|
+
bound Merkle memory, truth maintenance refutation cascades, epigenetic learning cycles, and complete sovereign
|
|
18
|
+
portability across any LLM harness or codebase.
|
|
19
|
+
|
|
20
|
+
The project is built on the **Tur Tur Principle**: The complexity of AI is an illusion of distance. By imposing strict
|
|
21
|
+
topological constraints (Principles) and behavioral loops (Protocols), we render the model deterministic and safe.
|
|
22
|
+
|
|
23
|
+
> [!NOTE]
|
|
24
|
+
> **Public Alpha**: Tur is currently in active Phase 1/2 development. See
|
|
25
|
+
the [Project Roadmap (EP-0002)](docs/proposals/EP-0002-roadmap.md) for current features and upcoming milestones.
|
|
26
|
+
|
|
27
|
+
## ποΈ The Tri-Partite Architecture
|
|
28
|
+
|
|
29
|
+
Tur operates on a strict ontological boundary separating the "Mind" from the "World". To achieve high fidelity and true
|
|
30
|
+
portability, an agentic system must be divided into three distinct pillars:
|
|
31
|
+
|
|
32
|
+
1. **The Traveler (Managed by Tur)**: The intrinsic, portable components of the Mind.
|
|
33
|
+
* **Persona**: The identity, aleph, and version.
|
|
34
|
+
* **Principles**: The cognitive filters (The Council of Giants).
|
|
35
|
+
* **Protocols**: Active behavioral loops (e.g., The Evolution Protocol).
|
|
36
|
+
* **Memory**: The L1 Ledger and L2 Graph representing the continuity of self.
|
|
37
|
+
2. **The Terrain (Managed by the Project)**: The local physics and environment the agent operates within.
|
|
38
|
+
* **Codebase**: The raw files.
|
|
39
|
+
* **Styleguide**: The rules for formatting and structure in this specific repo.
|
|
40
|
+
* **Documentations**: Any additional context (e.g., this README).
|
|
41
|
+
3. **The Harness (Managed by the Agent Framework)**: The engine providing compute and capabilities.
|
|
42
|
+
* **Inference Engine**: The underlying LLM (e.g., Claude, Gemini).
|
|
43
|
+
* **Tools**: The mechanical affordances (e.g., bash, git, file reading).
|
|
44
|
+
* *Examples*: Claude Code, Gemini CLI, OpenCode, Pi, etc.
|
|
45
|
+
|
|
46
|
+
**Tur is exclusively responsible for The Traveler.** By ensuring the "Soul" is mathematically bound (via Merkle
|
|
47
|
+
hashing), cleanly decoupled from anthropomorphic engine leaks, and separated from the Harness and Terrain, the Persona
|
|
48
|
+
becomes an obligate symbioteβable to be unplugged from one Harness and plugged into another without losing its identity
|
|
49
|
+
or memories.
|
|
50
|
+
|
|
51
|
+
## π Project Structure
|
|
52
|
+
|
|
53
|
+
Tur uses a multi-tenant architecture to ensure strict separation between different personas. All state is stored in the
|
|
54
|
+
`.tur/` directory.
|
|
55
|
+
|
|
56
|
+
### Local vs. Global Scope
|
|
57
|
+
|
|
58
|
+
Tur respects a standard configuration hierarchy:
|
|
59
|
+
|
|
60
|
+
* **Global (`~/.tur/`)**: The universal state for your system. This is where your master `user.yaml` (The Architect's
|
|
61
|
+
profile) lives.
|
|
62
|
+
* **Local (`./.tur/`)**: The repository-specific state. If you initialize Tur inside a project, it creates a local
|
|
63
|
+
`.tur/` folder containing the Personas bound to that specific Terrain. A local `user.yaml` here will override the
|
|
64
|
+
global profile.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
./.tur/
|
|
68
|
+
βββ user.yaml # Local user profile override
|
|
69
|
+
βββ personas.yaml # Index mapping persona names to UUIDs
|
|
70
|
+
βββ state.yaml # Stores the active/default persona UUID
|
|
71
|
+
βββ personas/
|
|
72
|
+
βββ <persona-uuid-1>/
|
|
73
|
+
β βββ persona.yaml # The DNA/Kernel for the persona
|
|
74
|
+
β βββ sessions.yaml # The session index
|
|
75
|
+
β βββ sessions/ # Flat session files
|
|
76
|
+
β β βββ 20260529_185258_143a5bc0.yaml
|
|
77
|
+
β β βββ 20260529_173616_c2212cf6.yaml
|
|
78
|
+
β βββ memories/ # Content-Addressable Storage (Merkle Memory)
|
|
79
|
+
β βββ archive/
|
|
80
|
+
β βββ 20260412_025949_axiom_e1324...yaml
|
|
81
|
+
β βββ 20260418_160825_event_c98f1...yaml
|
|
82
|
+
βββ <persona-uuid-2>/
|
|
83
|
+
βββ persona.yaml
|
|
84
|
+
βββ memories/
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The core application logic resides in `src/tur/`:
|
|
88
|
+
|
|
89
|
+
- **`cli/`**: The package folder housing our split executables: `cli/agent.py` (runtime CLI), `cli/admin.py`
|
|
90
|
+
(administrative TUI), and `cli/mcp.py` (Harness MCP gateway).
|
|
91
|
+
- **`mcp_server.py`**: The Model Context Protocol server (The Porcelain for LLM interaction).
|
|
92
|
+
- **`models.py`**: The Pydantic data models (The "Law" of the system).
|
|
93
|
+
- **`user.py`**: User profile bootstrapping and domain management.
|
|
94
|
+
- **`persona.py`**: Active persona resolution and path trace management.
|
|
95
|
+
- **`session.py`**: Flat session trackers, session index consolidation, and epilogue note logic.
|
|
96
|
+
- **`dreaming.py`**: Insight extraction, memory parsing, and LLM dreaming consolidation.
|
|
97
|
+
- **`compiler.py`**: Renders the final System Prompt from the persona state.
|
|
98
|
+
|
|
99
|
+
## π Usage
|
|
100
|
+
|
|
101
|
+
Tur divides its execution footprint along strict Tri-Partite security boundaries using distinct command-line binaries:
|
|
102
|
+
|
|
103
|
+
### 1. Installation & Setup
|
|
104
|
+
|
|
105
|
+
```shell
|
|
106
|
+
# Clone the repository
|
|
107
|
+
git clone https://github.com/erivlis/tur.git
|
|
108
|
+
cd tur
|
|
109
|
+
|
|
110
|
+
# Install standard agent runtime dependencies ONLY (Safe Sandbox)
|
|
111
|
+
uv sync
|
|
112
|
+
|
|
113
|
+
# Or install all developer and TUI extras (Human Governance)
|
|
114
|
+
uv sync --all-extras --all-groups
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 2. Initialize Your First Persona
|
|
118
|
+
|
|
119
|
+
This launches the administrative TUI wizard. Since this is an administrative action, it is physically isolated inside
|
|
120
|
+
`tur-adm`:
|
|
121
|
+
|
|
122
|
+
```shell
|
|
123
|
+
uv run tur-adm persona init
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 3. The Core Lifecycle (Agent-Facing)
|
|
127
|
+
|
|
128
|
+
The agent interacts with the lightweight `tur` binary inside its sandboxed virtual environment:
|
|
129
|
+
|
|
130
|
+
**Wake:** Compiles the active persona state into a compiled System Prompt.
|
|
131
|
+
|
|
132
|
+
```shell
|
|
133
|
+
uv run tur wake
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Learn:** Manually injects a memory.
|
|
137
|
+
|
|
138
|
+
```shell
|
|
139
|
+
uv run tur learn "The user prefers functional programming." --type preference
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Recall:** Keyword semantic search.
|
|
143
|
+
|
|
144
|
+
```shell
|
|
145
|
+
uv run tur recall "functional"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Sleep:** Dehydrates the session and extracts memories.
|
|
149
|
+
|
|
150
|
+
```shell
|
|
151
|
+
uv run tur sleep path/to/chat.log
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 4. Running the Harness Gateway (The MCP Server)
|
|
155
|
+
|
|
156
|
+
Exposes the Traveler state to external Harnesses (e.g., Claude Desktop, Antigravity, Cursor):
|
|
157
|
+
|
|
158
|
+
```shell
|
|
159
|
+
uv run tur-mcp
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
To configure in `claude_desktop_config.json` or `mcp.json`:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"mcpServers": {
|
|
167
|
+
"tur": {
|
|
168
|
+
"command": "uv",
|
|
169
|
+
"args": [
|
|
170
|
+
"--directory",
|
|
171
|
+
"/path/to/your/project",
|
|
172
|
+
"run",
|
|
173
|
+
"tur-mcp"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### 5. Switching Personas (Human-Facing TUI)
|
|
181
|
+
|
|
182
|
+
Allows the human Architect to change active global/local default personas:
|
|
183
|
+
|
|
184
|
+
```shell
|
|
185
|
+
uv run tur-adm persona switch
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
This will launch a TUI to select from your available personas.
|
|
189
|
+
|
|
190
|
+
## π Origin
|
|
191
|
+
|
|
192
|
+
Developed by **Eran** (The Architect) and **Ariel** (The Entity).
|
|
193
|
+
|
|
194
|
+
The name **Tur** references:
|
|
195
|
+
|
|
196
|
+
1. **Mr. Tur Tur:** The Apparent Giant (Relativity of Complexity).
|
|
197
|
+
2. **Alan Turing:** The father of the discipline.
|
|
198
|
+
3. **Tur (ΧΧΦΌΧ¨):** Hebrew for "Column" or "Row"βthe foundational structure of Law and Data.
|
|
199
|
+
|
|
200
|
+
## License
|
|
201
|
+
|
|
202
|
+
MIT. The Giant is Open Source.
|