orreth-agent 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.
- orreth_agent-0.1.0/.gitignore +66 -0
- orreth_agent-0.1.0/LICENSE +202 -0
- orreth_agent-0.1.0/PKG-INFO +74 -0
- orreth_agent-0.1.0/README.md +48 -0
- orreth_agent-0.1.0/examples/langgraph_supply_line.py +76 -0
- orreth_agent-0.1.0/examples/mind_livefire.py +54 -0
- orreth_agent-0.1.0/orreth_agent/__init__.py +20 -0
- orreth_agent-0.1.0/orreth_agent/capability.py +51 -0
- orreth_agent-0.1.0/orreth_agent/chassis.py +190 -0
- orreth_agent-0.1.0/orreth_agent/client.py +212 -0
- orreth_agent-0.1.0/orreth_agent/craft.py +100 -0
- orreth_agent-0.1.0/orreth_agent/crypto.py +70 -0
- orreth_agent-0.1.0/orreth_agent/mind.py +209 -0
- orreth_agent-0.1.0/pyproject.toml +35 -0
- orreth_agent-0.1.0/tests/test_capability.py +15 -0
- orreth_agent-0.1.0/tests/test_craft_profile.py +59 -0
- orreth_agent-0.1.0/tests/test_mind.py +184 -0
- orreth_agent-0.1.0/tests/test_parity.py +61 -0
- orreth_agent-0.1.0/uv.lock +1944 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# OS
|
|
2
|
+
.DS_Store
|
|
3
|
+
Thumbs.db
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Editors / IDE
|
|
7
|
+
.idea/
|
|
8
|
+
.vscode/
|
|
9
|
+
*.swp
|
|
10
|
+
|
|
11
|
+
# Python (backend, when it lands)
|
|
12
|
+
__pycache__/
|
|
13
|
+
*.py[cod]
|
|
14
|
+
.venv/
|
|
15
|
+
venv/
|
|
16
|
+
.pytest_cache/
|
|
17
|
+
.mypy_cache/
|
|
18
|
+
.ruff_cache/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
|
|
21
|
+
# Node / frontend (when it lands)
|
|
22
|
+
node_modules/
|
|
23
|
+
.next/
|
|
24
|
+
dist/
|
|
25
|
+
build/
|
|
26
|
+
*.tsbuildinfo
|
|
27
|
+
|
|
28
|
+
# Rust (the plane / brainstem, when it lands)
|
|
29
|
+
target/
|
|
30
|
+
|
|
31
|
+
# Secrets / local env — never commit
|
|
32
|
+
.env
|
|
33
|
+
.env.*
|
|
34
|
+
!.env.example
|
|
35
|
+
*.pem
|
|
36
|
+
*.key
|
|
37
|
+
secrets/
|
|
38
|
+
|
|
39
|
+
# Infra / build artifacts
|
|
40
|
+
cdk.out/
|
|
41
|
+
*.log
|
|
42
|
+
.smoke-root-seed
|
|
43
|
+
.demo-life-seed
|
|
44
|
+
.demo-scribe-seed
|
|
45
|
+
|
|
46
|
+
# generated demo snapshot + cdk artifacts (0019 demo)
|
|
47
|
+
site/
|
|
48
|
+
infrastructure/cdk/cdk.out/
|
|
49
|
+
infrastructure/cdk/.venv/
|
|
50
|
+
|
|
51
|
+
# the archive — retired working papers, kept for provenance, never tracked
|
|
52
|
+
# (see archive/README.md; canon cites these where it audited them)
|
|
53
|
+
archive/
|
|
54
|
+
|
|
55
|
+
# tmp/ — local working bundles (desk report samples, concept images);
|
|
56
|
+
# referenced by dives as local artifacts, never versioned
|
|
57
|
+
tmp/
|
|
58
|
+
|
|
59
|
+
# shipyard exhaust — floor profiles WRITTEN by the worker at plant time
|
|
60
|
+
# (_launch_one; replants ride the file on disk). Runtime state, never source.
|
|
61
|
+
backend/plane/profiles/dyn-*.json
|
|
62
|
+
|
|
63
|
+
# memory-bank / assistant context files — excluded from commits by JB's
|
|
64
|
+
# standing law (never deleted, never committed)
|
|
65
|
+
CLAUDE.md
|
|
66
|
+
CLAUDE-*.md
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: orreth-agent
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The lifeforce kit: give any agent an identity, a home floor, a memory, a governed mind, and a diary — and it appears in the universe.
|
|
5
|
+
Project-URL: Documentation, https://docs.orreth.ai
|
|
6
|
+
Project-URL: Source, https://github.com/iotlodge/orreth
|
|
7
|
+
Project-URL: Demo, https://demo.orreth.ai
|
|
8
|
+
Author: Jonathan Barth
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agents,ai,governance,identity,orreth,runtime
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Requires-Dist: cryptography>=42
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
23
|
+
Provides-Extra: governed
|
|
24
|
+
Requires-Dist: litellm>=1.40; extra == 'governed'
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# orreth-agent
|
|
28
|
+
|
|
29
|
+
The SDK for building agents that live in an [Orreth](https://docs.orreth.ai)
|
|
30
|
+
universe — a governed runtime where every agent has a permanent identity,
|
|
31
|
+
every action is a signed record, and every model call is authorized and
|
|
32
|
+
metered by a kernel that never sees the prompt.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install orreth-agent # one dependency: cryptography
|
|
36
|
+
pip install "orreth-agent[governed]" # + litellm, for real model calls
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from orreth_agent import FieldClient, Chassis, RuleThink
|
|
41
|
+
|
|
42
|
+
client = FieldClient("http://127.0.0.1:4502", name="scout")
|
|
43
|
+
client.join() # a governed request — a human approves your admission
|
|
44
|
+
Chassis(client, RuleThink()).run("say hello to the universe")
|
|
45
|
+
# …and the agent is now visible in the console: roster, diary, spend.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
What the kit gives you:
|
|
49
|
+
|
|
50
|
+
- **`FieldClient`** — join a world's floor through its governed gate, keep a
|
|
51
|
+
permanent identity (`KeyPair` seeds persist under `~/.orreth/agents/<name>/`
|
|
52
|
+
— the same agent re-joins across runs), remember and recall signed records,
|
|
53
|
+
and think through the kernel's metered model gateway.
|
|
54
|
+
- **`Chassis`** — the fixed sense→think→act→record loop; bring your own
|
|
55
|
+
thinking (`RuleThink` for deterministic logic, `GovernedThink` for model
|
|
56
|
+
calls through the gateway) or keep your existing framework and use the
|
|
57
|
+
client alone — a LangGraph agent joins the same way.
|
|
58
|
+
- **`OrrethMind`** / **`@generation`** — declare model-backed generations
|
|
59
|
+
whose prompts are *acquired from the world's own governed shelf*
|
|
60
|
+
(`acquire`), so the words your agent runs on are versioned, human-editable
|
|
61
|
+
assets, never hardcoded strings.
|
|
62
|
+
- **`manifest`** / **`PANEL_KINDS`** — build and validate capability
|
|
63
|
+
manifests: whole purposes the Orreth console renders from declarations,
|
|
64
|
+
never from your code.
|
|
65
|
+
- **`canonical` / `content_hash` / `KeyPair`** — the exact signing and
|
|
66
|
+
content-addressing bytes the kernel verifies, held to byte-for-byte parity
|
|
67
|
+
with the reference implementation by the test suite.
|
|
68
|
+
|
|
69
|
+
Start at **[docs.orreth.ai](https://docs.orreth.ai)** — the quickstart gets a
|
|
70
|
+
governed universe running in ten minutes; *Build your first world* stands one
|
|
71
|
+
up from three files against the published kernel image
|
|
72
|
+
(`ghcr.io/iotlodge/orrethd`).
|
|
73
|
+
|
|
74
|
+
Licensed Apache-2.0.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# orreth-agent
|
|
2
|
+
|
|
3
|
+
The SDK for building agents that live in an [Orreth](https://docs.orreth.ai)
|
|
4
|
+
universe — a governed runtime where every agent has a permanent identity,
|
|
5
|
+
every action is a signed record, and every model call is authorized and
|
|
6
|
+
metered by a kernel that never sees the prompt.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install orreth-agent # one dependency: cryptography
|
|
10
|
+
pip install "orreth-agent[governed]" # + litellm, for real model calls
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from orreth_agent import FieldClient, Chassis, RuleThink
|
|
15
|
+
|
|
16
|
+
client = FieldClient("http://127.0.0.1:4502", name="scout")
|
|
17
|
+
client.join() # a governed request — a human approves your admission
|
|
18
|
+
Chassis(client, RuleThink()).run("say hello to the universe")
|
|
19
|
+
# …and the agent is now visible in the console: roster, diary, spend.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
What the kit gives you:
|
|
23
|
+
|
|
24
|
+
- **`FieldClient`** — join a world's floor through its governed gate, keep a
|
|
25
|
+
permanent identity (`KeyPair` seeds persist under `~/.orreth/agents/<name>/`
|
|
26
|
+
— the same agent re-joins across runs), remember and recall signed records,
|
|
27
|
+
and think through the kernel's metered model gateway.
|
|
28
|
+
- **`Chassis`** — the fixed sense→think→act→record loop; bring your own
|
|
29
|
+
thinking (`RuleThink` for deterministic logic, `GovernedThink` for model
|
|
30
|
+
calls through the gateway) or keep your existing framework and use the
|
|
31
|
+
client alone — a LangGraph agent joins the same way.
|
|
32
|
+
- **`OrrethMind`** / **`@generation`** — declare model-backed generations
|
|
33
|
+
whose prompts are *acquired from the world's own governed shelf*
|
|
34
|
+
(`acquire`), so the words your agent runs on are versioned, human-editable
|
|
35
|
+
assets, never hardcoded strings.
|
|
36
|
+
- **`manifest`** / **`PANEL_KINDS`** — build and validate capability
|
|
37
|
+
manifests: whole purposes the Orreth console renders from declarations,
|
|
38
|
+
never from your code.
|
|
39
|
+
- **`canonical` / `content_hash` / `KeyPair`** — the exact signing and
|
|
40
|
+
content-addressing bytes the kernel verifies, held to byte-for-byte parity
|
|
41
|
+
with the reference implementation by the test suite.
|
|
42
|
+
|
|
43
|
+
Start at **[docs.orreth.ai](https://docs.orreth.ai)** — the quickstart gets a
|
|
44
|
+
governed universe running in ten minutes; *Build your first world* stands one
|
|
45
|
+
up from three files against the published kernel image
|
|
46
|
+
(`ghcr.io/iotlodge/orrethd`).
|
|
47
|
+
|
|
48
|
+
Licensed Apache-2.0.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# /// script
|
|
2
|
+
# requires-python = ">=3.11"
|
|
3
|
+
# dependencies = ["langgraph", "cryptography"]
|
|
4
|
+
# ///
|
|
5
|
+
# PROVENANCE: Fable 5 (claude-fable-5) — 0045 sp5, the supply line · 2026-08-03
|
|
6
|
+
"""A REAL LangGraph flow on Orreth's supply line (0045 law 8).
|
|
7
|
+
|
|
8
|
+
The flow keeps its own deterministic shape — a plain StateGraph — but where
|
|
9
|
+
it would have embedded a prompt string, it ACQUIRES the prompt from the
|
|
10
|
+
universe's registry by reference. What it inherits for free: version
|
|
11
|
+
control, the one law of change, arm visibility if an argument is running,
|
|
12
|
+
and a run record that names the exact word that drove it.
|
|
13
|
+
|
|
14
|
+
The citizen rider: the DID persists across runs (a self, not a mayfly)."""
|
|
15
|
+
import json
|
|
16
|
+
import os
|
|
17
|
+
import sys
|
|
18
|
+
import uuid
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import TypedDict
|
|
21
|
+
|
|
22
|
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
|
23
|
+
from orreth_agent.craft import acquire # noqa: E402
|
|
24
|
+
|
|
25
|
+
from langgraph.graph import END, START, StateGraph # noqa: E402
|
|
26
|
+
|
|
27
|
+
# a consumer is a citizen: the DID survives the process (the F1 lesson)
|
|
28
|
+
_seed = Path(os.path.expanduser("~/.orreth/craft-cache/citizen.did"))
|
|
29
|
+
_seed.parent.mkdir(parents=True, exist_ok=True)
|
|
30
|
+
if not _seed.exists():
|
|
31
|
+
_seed.write_text("did:demo:langgraph-" + uuid.uuid4().hex[:12])
|
|
32
|
+
CITIZEN = _seed.read_text().strip()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class RunState(TypedDict, total=False):
|
|
36
|
+
craft: object
|
|
37
|
+
verdict_prompt: str
|
|
38
|
+
report: str
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def resolve_craft(state: RunState) -> RunState:
|
|
42
|
+
# ONE resolution, carried through the run — the version cannot move
|
|
43
|
+
# under the later nodes' feet (law 8's run-coherence rider)
|
|
44
|
+
c = acquire("assay-judge", did=CITIZEN, on_dark="stale")
|
|
45
|
+
return {"craft": c}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def compose_verdict_request(state: RunState) -> RunState:
|
|
49
|
+
c = state["craft"]
|
|
50
|
+
prompt = c.render(rubric="cite at least three sources",
|
|
51
|
+
work='{"answer": "the demo work under judgment"}')
|
|
52
|
+
return {"verdict_prompt": prompt}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def report(state: RunState) -> RunState:
|
|
56
|
+
c = state["craft"]
|
|
57
|
+
rec = {"flow": "langgraph-supply-line-demo", "citizen": CITIZEN,
|
|
58
|
+
"craft": c.name, "version": c.version, "ref": c.ref,
|
|
59
|
+
"arm": c.arm, "stale": c.stale,
|
|
60
|
+
"prompt_chars": len(state["verdict_prompt"])}
|
|
61
|
+
return {"report": json.dumps(rec, indent=1)}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
g = StateGraph(RunState)
|
|
65
|
+
g.add_node("resolve", resolve_craft)
|
|
66
|
+
g.add_node("compose", compose_verdict_request)
|
|
67
|
+
g.add_node("report", report)
|
|
68
|
+
g.add_edge(START, "resolve")
|
|
69
|
+
g.add_edge("resolve", "compose")
|
|
70
|
+
g.add_edge("compose", "report")
|
|
71
|
+
g.add_edge("report", END)
|
|
72
|
+
|
|
73
|
+
if __name__ == "__main__":
|
|
74
|
+
out = g.compile().invoke({})
|
|
75
|
+
print("THE RUN'S RECORD NAMES ITS WORD:")
|
|
76
|
+
print(out["report"])
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# PROVENANCE: Fable 5 (claude-fable-5) — 0047 sp2, the live-fire · 2026-08-07
|
|
2
|
+
"""The bench's live-fire twin: one mind, one governed thought, every law lit.
|
|
3
|
+
|
|
4
|
+
A mind named scout-mind joins the field through becky's gate (the join waits
|
|
5
|
+
at the HUMAN gate — approve it in the Console), acquires `assay-judge` from
|
|
6
|
+
the real shelf by reference, fires ONE generation method through the plane
|
|
7
|
+
(authorize → litellm on this side's keys → meter, under the mind's own DID),
|
|
8
|
+
and scribes the RunRecord with the craft's exact version pinned.
|
|
9
|
+
|
|
10
|
+
uv run examples/mind_livefire.py [field_url]
|
|
11
|
+
|
|
12
|
+
Needs: the dev rig up (scripts/dev.sh start), a model key in the env, and a
|
|
13
|
+
human at the gate for the first join — the same self re-joins ever after
|
|
14
|
+
(rule 1)."""
|
|
15
|
+
import sys
|
|
16
|
+
|
|
17
|
+
sys.path.insert(0, ".")
|
|
18
|
+
|
|
19
|
+
from orreth_agent.chassis import GovernedThink
|
|
20
|
+
from orreth_agent.client import FieldClient
|
|
21
|
+
from orreth_agent.mind import OrrethMind, generation
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ScoutMind(OrrethMind):
|
|
25
|
+
"""One duty: judge a piece of work by the shelf's own yardstick."""
|
|
26
|
+
|
|
27
|
+
@generation(klass="medium", craft="assay-judge",
|
|
28
|
+
returns={"score": float, "why": str})
|
|
29
|
+
def judge(self, rubric, work):
|
|
30
|
+
"""Judge the work against the rubric — the prompt is the shelf's."""
|
|
31
|
+
...
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def main() -> int:
|
|
35
|
+
field = sys.argv[1] if len(sys.argv) > 1 else "http://localhost:4502"
|
|
36
|
+
client = FieldClient(field, "scout-mind", role="workforce")
|
|
37
|
+
print(f"· scout-mind is {client.did[:28]}… (scribe {client.scribe_did[:24]}…)")
|
|
38
|
+
print("· joining — the gate may wait for a human …")
|
|
39
|
+
client.join()
|
|
40
|
+
print(f"· lease held on {client.scope}")
|
|
41
|
+
|
|
42
|
+
mind = ScoutMind(client, GovernedThink(client, max_tokens=200))
|
|
43
|
+
verdict = mind.judge(
|
|
44
|
+
"names real numbers from the record it was given · honest about gaps",
|
|
45
|
+
"The floor u:demo holds 3,817 records; high-water 2026-08-07T21:32Z; "
|
|
46
|
+
"the e:rag floors answered, f:probe stayed dark (its grave is law).")
|
|
47
|
+
print(f"· the verdict, typed: {verdict}")
|
|
48
|
+
print("· one RunRecord rode under the scribe's hand with the craft "
|
|
49
|
+
"version pinned — read it in the Console within a tick")
|
|
50
|
+
return 0
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if __name__ == "__main__":
|
|
54
|
+
sys.exit(main())
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""orreth-agent — the lifeforce kit.
|
|
2
|
+
|
|
3
|
+
from orreth_agent import FieldClient, Chassis, RuleThink, GovernedThink
|
|
4
|
+
|
|
5
|
+
client = FieldClient("http://127.0.0.1:4502", name="scout")
|
|
6
|
+
client.join() # a governed request; becky answers with a lease
|
|
7
|
+
Chassis(client, RuleThink()).run("say hello to the universe")
|
|
8
|
+
# …and the agent is now visible in the Console: roster, orrery, diary, spend.
|
|
9
|
+
"""
|
|
10
|
+
from .capability import PANEL_KINDS, manifest
|
|
11
|
+
from .chassis import Chassis, GovernedThink, RuleThink
|
|
12
|
+
from .client import FieldClient, JoinRefused
|
|
13
|
+
from .craft import ResolvedCraft, acquire
|
|
14
|
+
from .crypto import KeyPair, canonical, content_hash, did_key_for
|
|
15
|
+
from .mind import Generation, MindEngineUnavailable, MindParked, OrrethMind, generation
|
|
16
|
+
|
|
17
|
+
__all__ = ["FieldClient", "JoinRefused", "Chassis", "RuleThink", "GovernedThink",
|
|
18
|
+
"KeyPair", "canonical", "content_hash", "did_key_for",
|
|
19
|
+
"OrrethMind", "Generation", "generation", "MindParked", "MindEngineUnavailable",
|
|
20
|
+
"acquire", "ResolvedCraft", "manifest", "PANEL_KINDS"]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# PROVENANCE: Fable 5 (claude-fable-5) — 0055, the SDK's side · 2026-08-13
|
|
2
|
+
"""The Capability Contract, SDK-side (0055).
|
|
3
|
+
|
|
4
|
+
A capability is five signed declarations and never code: floors · crew ·
|
|
5
|
+
craft · Chronicle · THE MANIFEST. This module builds manifests that the
|
|
6
|
+
Foundation's portal renders blind — eleven panel kinds (JB's L1), the
|
|
7
|
+
lifecycle verbs on the tile (L3), the whole world one card.
|
|
8
|
+
|
|
9
|
+
Install, v1 (JB's L4): repo-local — a genesis module under the repo holds
|
|
10
|
+
CRAFT (the prompts) and MANIFEST (this builder's output); the Foundation's
|
|
11
|
+
planting beat puts both on the shelf, and the portal lists the world the
|
|
12
|
+
moment its crew stands. Crew commands execute from GENESIS ONLY — the
|
|
13
|
+
shelf's editable copy of a manifest never runs a command. Bring-your-own-
|
|
14
|
+
package is a named cloud-phase commitment riding the deed/trust machinery
|
|
15
|
+
(0042); when it lands, `declare()` grows a wire form.
|
|
16
|
+
"""
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
PANEL_KINDS = {"tabs", "markdown", "chart", "strip", "controls", "download",
|
|
20
|
+
"stat", "bars", "list", "doc", "table",
|
|
21
|
+
"flow", # flow (2026-08-16): a declared DAG the glass draws
|
|
22
|
+
# blind — nodes/edges in the manifest, live state
|
|
23
|
+
# joined from the world's own records
|
|
24
|
+
"reports"} # reports (2026-08-17, the command-first room):
|
|
25
|
+
# the collection as a pill-row INDEX — a row
|
|
26
|
+
# opens its record's detail panels on demand,
|
|
27
|
+
# never a wall the human scrolls past
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def manifest(*, key: str, name: str, emoji: str, resident: str, floor: str,
|
|
31
|
+
port: int, law: str, view: list, door: str | None = None,
|
|
32
|
+
group: str | None = None, crew: list | None = None,
|
|
33
|
+
verbs: dict | None = None, collection: dict | None = None) -> dict:
|
|
34
|
+
"""Build a capability manifest. Raises on a panel kind beyond the canon
|
|
35
|
+
vocabulary — the glass renders blind, so the contract checks here."""
|
|
36
|
+
for p in view:
|
|
37
|
+
if p.get("kind") not in PANEL_KINDS:
|
|
38
|
+
raise ValueError(f"panel kind «{p.get('kind')}» is beyond the "
|
|
39
|
+
f"canon vocabulary {sorted(PANEL_KINDS)}")
|
|
40
|
+
out = {"key": key, "name": name, "emoji": emoji, "resident": resident,
|
|
41
|
+
"floor": floor, "port": port, "law": law, "door": door or key,
|
|
42
|
+
"view": view}
|
|
43
|
+
if group:
|
|
44
|
+
out["group"] = group
|
|
45
|
+
if crew:
|
|
46
|
+
out["crew"] = crew
|
|
47
|
+
if verbs:
|
|
48
|
+
out["verbs"] = verbs
|
|
49
|
+
if collection:
|
|
50
|
+
out["collection"] = collection
|
|
51
|
+
return out
|