rsoslang 0.3.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 (62) hide show
  1. rsoslang-0.3.0/LICENSE +202 -0
  2. rsoslang-0.3.0/NOTICE +9 -0
  3. rsoslang-0.3.0/PKG-INFO +120 -0
  4. rsoslang-0.3.0/README.md +97 -0
  5. rsoslang-0.3.0/pyproject.toml +41 -0
  6. rsoslang-0.3.0/setup.cfg +4 -0
  7. rsoslang-0.3.0/src/rsoslang/__init__.py +17 -0
  8. rsoslang-0.3.0/src/rsoslang/__main__.py +80 -0
  9. rsoslang-0.3.0/src/rsoslang/agents/__init__.py +0 -0
  10. rsoslang-0.3.0/src/rsoslang/agents/library.py +183 -0
  11. rsoslang-0.3.0/src/rsoslang/agents/tickets.py +60 -0
  12. rsoslang-0.3.0/src/rsoslang/agents/workflow.py +209 -0
  13. rsoslang-0.3.0/src/rsoslang/compiler.py +51 -0
  14. rsoslang-0.3.0/src/rsoslang/data/domain_books.json +342 -0
  15. rsoslang-0.3.0/src/rsoslang/data/metric_spheres.json +415 -0
  16. rsoslang-0.3.0/src/rsoslang/data/register.json +974 -0
  17. rsoslang-0.3.0/src/rsoslang/diagnostics.py +59 -0
  18. rsoslang-0.3.0/src/rsoslang/discovery.py +59 -0
  19. rsoslang-0.3.0/src/rsoslang/dragon.py +105 -0
  20. rsoslang-0.3.0/src/rsoslang/governance.py +143 -0
  21. rsoslang-0.3.0/src/rsoslang/grammar.py +343 -0
  22. rsoslang-0.3.0/src/rsoslang/house.py +63 -0
  23. rsoslang-0.3.0/src/rsoslang/identity.py +71 -0
  24. rsoslang-0.3.0/src/rsoslang/lexer.py +71 -0
  25. rsoslang-0.3.0/src/rsoslang/mcp_server.py +170 -0
  26. rsoslang-0.3.0/src/rsoslang/meanings.py +106 -0
  27. rsoslang-0.3.0/src/rsoslang/mind/__init__.py +0 -0
  28. rsoslang-0.3.0/src/rsoslang/mind/session.py +177 -0
  29. rsoslang-0.3.0/src/rsoslang/painting/__init__.py +0 -0
  30. rsoslang-0.3.0/src/rsoslang/painting/graphs.py +67 -0
  31. rsoslang-0.3.0/src/rsoslang/painting/scene.py +138 -0
  32. rsoslang-0.3.0/src/rsoslang/palace.py +110 -0
  33. rsoslang-0.3.0/src/rsoslang/parser.py +204 -0
  34. rsoslang-0.3.0/src/rsoslang/protocol.py +119 -0
  35. rsoslang-0.3.0/src/rsoslang/runtime/__init__.py +3 -0
  36. rsoslang-0.3.0/src/rsoslang/runtime/codec.py +55 -0
  37. rsoslang-0.3.0/src/rsoslang/runtime/execute.py +472 -0
  38. rsoslang-0.3.0/src/rsoslang/runtime/model.py +184 -0
  39. rsoslang-0.3.0/src/rsoslang/semantics.py +350 -0
  40. rsoslang-0.3.0/src/rsoslang/state.py +222 -0
  41. rsoslang-0.3.0/src/rsoslang/timeline.py +62 -0
  42. rsoslang-0.3.0/src/rsoslang/vakog.py +56 -0
  43. rsoslang-0.3.0/src/rsoslang.egg-info/PKG-INFO +120 -0
  44. rsoslang-0.3.0/src/rsoslang.egg-info/SOURCES.txt +60 -0
  45. rsoslang-0.3.0/src/rsoslang.egg-info/dependency_links.txt +1 -0
  46. rsoslang-0.3.0/src/rsoslang.egg-info/entry_points.txt +3 -0
  47. rsoslang-0.3.0/src/rsoslang.egg-info/requires.txt +6 -0
  48. rsoslang-0.3.0/src/rsoslang.egg-info/top_level.txt +1 -0
  49. rsoslang-0.3.0/tests/test_core.py +210 -0
  50. rsoslang-0.3.0/tests/test_dragon.py +19 -0
  51. rsoslang-0.3.0/tests/test_governance.py +50 -0
  52. rsoslang-0.3.0/tests/test_graphs.py +24 -0
  53. rsoslang-0.3.0/tests/test_identity.py +38 -0
  54. rsoslang-0.3.0/tests/test_langgraph_example.py +20 -0
  55. rsoslang-0.3.0/tests/test_mcp.py +34 -0
  56. rsoslang-0.3.0/tests/test_painting.py +51 -0
  57. rsoslang-0.3.0/tests/test_palace.py +33 -0
  58. rsoslang-0.3.0/tests/test_reach.py +50 -0
  59. rsoslang-0.3.0/tests/test_runtime.py +165 -0
  60. rsoslang-0.3.0/tests/test_session.py +50 -0
  61. rsoslang-0.3.0/tests/test_state.py +50 -0
  62. rsoslang-0.3.0/tests/test_timeline.py +23 -0
rsoslang-0.3.0/LICENSE ADDED
@@ -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
+ https://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.
rsoslang-0.3.0/NOTICE ADDED
@@ -0,0 +1,9 @@
1
+ RSOS Language (RSOS Multimodal World)
2
+ Copyright 2026 R. A. Elu (r-a-elu-architecture)
3
+
4
+ Licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Governance, practice sessions and the person simulator use the RSOS Multimodal Cue Framework
7
+ (https://github.com/r-a-elu-architecture/RSOS-Multimodal-Cue-Framework), Apache License 2.0, read-only.
8
+
9
+ Research and development software; not a medical device.
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: rsoslang
3
+ Version: 0.3.0
4
+ Summary: RSOS State Runtime and Language: multi-agent workflows in 2 model calls instead of 42, with hash-checked shared state (MCP server included)
5
+ Author: r-a-elu-architecture
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://r-a-elu-architecture.github.io/RSOS-Language/
8
+ Project-URL: Repository, https://github.com/r-a-elu-architecture/RSOS-Language
9
+ Project-URL: Results, https://r-a-elu-architecture.github.io/RSOS-Language/results.html
10
+ Keywords: mcp,multi-agent,agents,llm,state,langgraph,protocol
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ License-File: NOTICE
17
+ Requires-Dist: mcp>=1.10
18
+ Provides-Extra: experiments
19
+ Requires-Dist: tiktoken; extra == "experiments"
20
+ Requires-Dist: numpy; extra == "experiments"
21
+ Requires-Dist: networkx; extra == "experiments"
22
+ Dynamic: license-file
23
+
24
+ # RSOS Language
25
+
26
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.24304403.svg)](https://doi.org/10.5281/zenodo.24304403) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE) [![tests](https://github.com/r-a-elu-architecture/RSOS-Language/actions/workflows/tests.yml/badge.svg)](https://github.com/r-a-elu-architecture/RSOS-Language/actions/workflows/tests.yml)
27
+
28
+ *RSOS: an executable spatial-symbolic language for human–AI and AI–AI communication.* Whitepaper: R. A. Elu (2026),
29
+ [doi:10.5281/zenodo.24304403](https://doi.org/10.5281/zenodo.24304403) (all versions). Code: Apache 2.0. Software release 0.2.0:
30
+ [doi:10.5281/zenodo.24317658](https://doi.org/10.5281/zenodo.24317658).
31
+
32
+ ## RSOS State Runtime: 2 model calls instead of 42
33
+
34
+ **For multi-agent workflows that edit shared state.** The model decides; the language executes. On real LLM agents
35
+ (pre-registered, every failure reported): a 14-step task in **2 model calls instead of 42**, **2.8–3.7× cheaper** than
36
+ the best setup built for the same agents at API prices, **8× faster**, **32/32 correct**, every injected drift healed
37
+ with **zero model calls**. When agents compute from their own copies, a Slipstream-style anchor protocol got **0 of
38
+ 16** tasks right; RSOS stayed right.
39
+
40
+ ```bash
41
+ pip install rsoslang # or, from a clone: pip install -e .
42
+ claude mcp add rsos -- rsoslang mcp # or with no install: claude mcp add rsos -- uvx rsoslang mcp
43
+ python experiments/a5_runtime_equivalence.py # from a clone: this runtime replays every measured plan, 32/32 match
44
+ ```
45
+
46
+ **[Drop it in (Python or MCP) →](STATE.md)** · **[Replicate it, under $1 →](REPLICATE.md)** ·
47
+ **[All results, failures included →](https://r-a-elu-architecture.github.io/RSOS-Language/results.html)**
48
+
49
+ **A spatial-symbolic programming language for humans and AI.** You write a program the way you think it: objects in
50
+ a scene, placed, touched, pierced, entered, coloured, connected by lines, kept in the rooms of a house. The same
51
+ program runs in two places:
52
+ - in a **machine**: an AI agent workflow, a simulation;
53
+ - in a **person**: a practised mental model, delivered as a timed session of images, words, sounds, scents and
54
+ vibration codes.
55
+
56
+ **[Open the editor →](docs/editor.html)** A real 12-module support agent, painted. Put a guest at the head, heart,
57
+ brain or beside a module, and see the measured effect.
58
+
59
+ **Results (17 Nov 2026, pre-registered, real LLM agents; whitepaper v2: [doi:10.5281/zenodo.24320392](https://doi.org/10.5281/zenodo.24320392)):**
60
+ a protocol designed by the RSOS White Dragon engine (A3b) used 0.55× the BPE channel tokens of a Slipstream-style
61
+ anchor protocol while keeping every copy of the shared state true in 16/16 tasks (anchor protocol 0/16) and healing
62
+ every injected drift without a model call. The White Dragon also redesigned a weak agent system, cutting errors by
63
+ 63% (A2). Of 27 predictions on real hosts, 18 passed and 9 failed; all are reported.
64
+
65
+ **First real-host test (A1, 17 Nov 2026, pre-registered):** three LLM agents (planner, worker, checker) on 8 tasks. The RSOS palace protocol used about 7× fewer channel tokens than JSON with full state (2,563 vs 17,311), finished 7/8 tasks exactly correct (JSON 5/8), and caught and healed 24/24 injected drifts with 0 model calls (38 tokens per repair). Summaries + retrieval: 0/8 correct, 24/24 drifts kept. One model family, 8 tasks. Report: [`experiments/A1_REPORT.md`](experiments/A1_REPORT.md).
66
+
67
+ ## Purpose
68
+
69
+ RSOS grew from one seed: healing, transforming, signalling and evolving. It integrates the whole of human
70
+ experience, including its shadow, so that what is integrated can be transformed rather than denied. Because its seed
71
+ is healing, RSOS is used with consent and for the good of the person or system it works with, never to harm or
72
+ coerce. See [`RESPONSIBLE_USE.md`](RESPONSIBLE_USE.md),
73
+ [`GOVERNANCE.md`](GOVERNANCE.md), [`CONTRIBUTING.md`](CONTRIBUTING.md) and [`TRADEMARKS.md`](TRADEMARKS.md).
74
+
75
+ ## What makes it different
76
+
77
+ - **Where you place an operator decides what it does.** The same spell corrector placed at a module's head, heart,
78
+ brain or beside it gives four different results, measured on held-out data.
79
+ - **Meanings in three tiers.**
80
+ - a fixed core, shared by everyone;
81
+ - declared variations, scoped to a person, host, world or state;
82
+ - meanings left open on purpose, found by search.
83
+
84
+ Nothing changes silently.
85
+ - **The host decides.** Every operation runs on a declared host with its own channels and states. A cue on a channel
86
+ the host does not have is an error.
87
+ - **Safety is in the compiler.** Person-facing operations need consent and pass a constitution of seven checks;
88
+ return to baseline is always available.
89
+ - **Every result is reproducible.** Pre-registered experiments, seeds, result hashes; negatives published with
90
+ positives.
91
+
92
+ ## Quick start
93
+
94
+ ```bash
95
+ pip install -e .
96
+ python -m rsoslang check examples/robot_head.rsl
97
+ python -m rsoslang ir examples/sol_remote.rsl
98
+ RSOS_CUE_FRAMEWORK=/path/to/RSOS-Multimodal-Cue-Framework python -m rsoslang session examples/healing.rsl
99
+ ./reproduce.sh
100
+ ```
101
+
102
+ ## Use it from Claude or any MCP assistant
103
+
104
+ ```json
105
+ {"mcpServers": {"rsos-language": {"command": "python", "args": ["-m", "rsoslang.mcp_server"],
106
+ "env": {"RSOS_CUE_FRAMEWORK": "/path/to/RSOS-Multimodal-Cue-Framework"}}}}
107
+ ```
108
+
109
+ The tools are `rsos_statements`, `rsos_check`, `rsos_compile`, `rsos_session`, `rsos_paint_workflow`,
110
+ `rsos_apply_gestures` and `rsos_paint_graph`.
111
+
112
+ ## Results
113
+
114
+ See `results/BUILD_REPORT.md`. It covers every pre-registered test, the ones that failed included.
115
+
116
+ ## Licence
117
+
118
+ Apache 2.0. Research and development software; not a medical device.
119
+
120
+ <!-- mcp-name: io.github.r-a-elu-architecture/rsos -->
@@ -0,0 +1,97 @@
1
+ # RSOS Language
2
+
3
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.24304403.svg)](https://doi.org/10.5281/zenodo.24304403) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE) [![tests](https://github.com/r-a-elu-architecture/RSOS-Language/actions/workflows/tests.yml/badge.svg)](https://github.com/r-a-elu-architecture/RSOS-Language/actions/workflows/tests.yml)
4
+
5
+ *RSOS: an executable spatial-symbolic language for human–AI and AI–AI communication.* Whitepaper: R. A. Elu (2026),
6
+ [doi:10.5281/zenodo.24304403](https://doi.org/10.5281/zenodo.24304403) (all versions). Code: Apache 2.0. Software release 0.2.0:
7
+ [doi:10.5281/zenodo.24317658](https://doi.org/10.5281/zenodo.24317658).
8
+
9
+ ## RSOS State Runtime: 2 model calls instead of 42
10
+
11
+ **For multi-agent workflows that edit shared state.** The model decides; the language executes. On real LLM agents
12
+ (pre-registered, every failure reported): a 14-step task in **2 model calls instead of 42**, **2.8–3.7× cheaper** than
13
+ the best setup built for the same agents at API prices, **8× faster**, **32/32 correct**, every injected drift healed
14
+ with **zero model calls**. When agents compute from their own copies, a Slipstream-style anchor protocol got **0 of
15
+ 16** tasks right; RSOS stayed right.
16
+
17
+ ```bash
18
+ pip install rsoslang # or, from a clone: pip install -e .
19
+ claude mcp add rsos -- rsoslang mcp # or with no install: claude mcp add rsos -- uvx rsoslang mcp
20
+ python experiments/a5_runtime_equivalence.py # from a clone: this runtime replays every measured plan, 32/32 match
21
+ ```
22
+
23
+ **[Drop it in (Python or MCP) →](STATE.md)** · **[Replicate it, under $1 →](REPLICATE.md)** ·
24
+ **[All results, failures included →](https://r-a-elu-architecture.github.io/RSOS-Language/results.html)**
25
+
26
+ **A spatial-symbolic programming language for humans and AI.** You write a program the way you think it: objects in
27
+ a scene, placed, touched, pierced, entered, coloured, connected by lines, kept in the rooms of a house. The same
28
+ program runs in two places:
29
+ - in a **machine**: an AI agent workflow, a simulation;
30
+ - in a **person**: a practised mental model, delivered as a timed session of images, words, sounds, scents and
31
+ vibration codes.
32
+
33
+ **[Open the editor →](docs/editor.html)** A real 12-module support agent, painted. Put a guest at the head, heart,
34
+ brain or beside a module, and see the measured effect.
35
+
36
+ **Results (17 Nov 2026, pre-registered, real LLM agents; whitepaper v2: [doi:10.5281/zenodo.24320392](https://doi.org/10.5281/zenodo.24320392)):**
37
+ a protocol designed by the RSOS White Dragon engine (A3b) used 0.55× the BPE channel tokens of a Slipstream-style
38
+ anchor protocol while keeping every copy of the shared state true in 16/16 tasks (anchor protocol 0/16) and healing
39
+ every injected drift without a model call. The White Dragon also redesigned a weak agent system, cutting errors by
40
+ 63% (A2). Of 27 predictions on real hosts, 18 passed and 9 failed; all are reported.
41
+
42
+ **First real-host test (A1, 17 Nov 2026, pre-registered):** three LLM agents (planner, worker, checker) on 8 tasks. The RSOS palace protocol used about 7× fewer channel tokens than JSON with full state (2,563 vs 17,311), finished 7/8 tasks exactly correct (JSON 5/8), and caught and healed 24/24 injected drifts with 0 model calls (38 tokens per repair). Summaries + retrieval: 0/8 correct, 24/24 drifts kept. One model family, 8 tasks. Report: [`experiments/A1_REPORT.md`](experiments/A1_REPORT.md).
43
+
44
+ ## Purpose
45
+
46
+ RSOS grew from one seed: healing, transforming, signalling and evolving. It integrates the whole of human
47
+ experience, including its shadow, so that what is integrated can be transformed rather than denied. Because its seed
48
+ is healing, RSOS is used with consent and for the good of the person or system it works with, never to harm or
49
+ coerce. See [`RESPONSIBLE_USE.md`](RESPONSIBLE_USE.md),
50
+ [`GOVERNANCE.md`](GOVERNANCE.md), [`CONTRIBUTING.md`](CONTRIBUTING.md) and [`TRADEMARKS.md`](TRADEMARKS.md).
51
+
52
+ ## What makes it different
53
+
54
+ - **Where you place an operator decides what it does.** The same spell corrector placed at a module's head, heart,
55
+ brain or beside it gives four different results, measured on held-out data.
56
+ - **Meanings in three tiers.**
57
+ - a fixed core, shared by everyone;
58
+ - declared variations, scoped to a person, host, world or state;
59
+ - meanings left open on purpose, found by search.
60
+
61
+ Nothing changes silently.
62
+ - **The host decides.** Every operation runs on a declared host with its own channels and states. A cue on a channel
63
+ the host does not have is an error.
64
+ - **Safety is in the compiler.** Person-facing operations need consent and pass a constitution of seven checks;
65
+ return to baseline is always available.
66
+ - **Every result is reproducible.** Pre-registered experiments, seeds, result hashes; negatives published with
67
+ positives.
68
+
69
+ ## Quick start
70
+
71
+ ```bash
72
+ pip install -e .
73
+ python -m rsoslang check examples/robot_head.rsl
74
+ python -m rsoslang ir examples/sol_remote.rsl
75
+ RSOS_CUE_FRAMEWORK=/path/to/RSOS-Multimodal-Cue-Framework python -m rsoslang session examples/healing.rsl
76
+ ./reproduce.sh
77
+ ```
78
+
79
+ ## Use it from Claude or any MCP assistant
80
+
81
+ ```json
82
+ {"mcpServers": {"rsos-language": {"command": "python", "args": ["-m", "rsoslang.mcp_server"],
83
+ "env": {"RSOS_CUE_FRAMEWORK": "/path/to/RSOS-Multimodal-Cue-Framework"}}}}
84
+ ```
85
+
86
+ The tools are `rsos_statements`, `rsos_check`, `rsos_compile`, `rsos_session`, `rsos_paint_workflow`,
87
+ `rsos_apply_gestures` and `rsos_paint_graph`.
88
+
89
+ ## Results
90
+
91
+ See `results/BUILD_REPORT.md`. It covers every pre-registered test, the ones that failed included.
92
+
93
+ ## Licence
94
+
95
+ Apache 2.0. Research and development software; not a medical device.
96
+
97
+ <!-- mcp-name: io.github.r-a-elu-architecture/rsos -->
@@ -0,0 +1,41 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rsoslang"
7
+ version = "0.3.0"
8
+ description = "RSOS State Runtime and Language: multi-agent workflows in 2 model calls instead of 42, with hash-checked shared state (MCP server included)"
9
+ requires-python = ">=3.9"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE", "NOTICE"]
12
+ readme = "README.md"
13
+ authors = [{name = "r-a-elu-architecture"}]
14
+ keywords = ["mcp", "multi-agent", "agents", "llm", "state", "langgraph", "protocol"]
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
18
+ ]
19
+ dependencies = ["mcp>=1.10"]
20
+
21
+ [project.optional-dependencies]
22
+ experiments = ["tiktoken", "numpy", "networkx"]
23
+
24
+ [project.scripts]
25
+ rsoslang = "rsoslang.__main__:cli"
26
+ rsoslang-mcp = "rsoslang.mcp_server:main"
27
+
28
+ [project.urls]
29
+ Homepage = "https://r-a-elu-architecture.github.io/RSOS-Language/"
30
+ Repository = "https://github.com/r-a-elu-architecture/RSOS-Language"
31
+ Results = "https://r-a-elu-architecture.github.io/RSOS-Language/results.html"
32
+
33
+ [tool.setuptools.packages.find]
34
+ where = ["src"]
35
+
36
+ [tool.setuptools.package-data]
37
+ rsoslang = ["data/*.json"]
38
+
39
+ [tool.pytest.ini_options]
40
+ testpaths = ["tests"]
41
+ pythonpath = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,17 @@
1
+ """RSOS Language: a spatial-symbolic programming language for humans and AI.
2
+
3
+ One program, two runtimes: an AI system and a person's practised mental model.
4
+ The core (fixed meanings), declared bindings (scoped variations) and search (meanings left open
5
+ on purpose) follow decision D80 and addition T12 of the corpus.
6
+ """
7
+
8
+ from .lexer import tokenize
9
+ from .parser import parse, Program
10
+ from .compiler import compile_source, compile_file
11
+ from .diagnostics import Diagnostic
12
+
13
+ __version__ = "0.3.0"
14
+ LANGUAGE_VERSION = "0.2"
15
+
16
+ __all__ = ["tokenize", "parse", "Program", "compile_source", "compile_file", "Diagnostic",
17
+ "__version__", "LANGUAGE_VERSION"]
@@ -0,0 +1,80 @@
1
+ """Command line: python -m rsoslang check|ir|statements|register FILE
2
+
3
+ check FILE report errors and warnings; exit 1 on errors
4
+ ir FILE print the JSON IR (and its SHA-256 on stderr)
5
+ statements list every statement with its register links and an example
6
+ register show which register rows (U1–U87) the language covers
7
+ session FILE a person's practice session: RSX program and the cue framework's timeline
8
+ mcp run the MCP server (stdio): the State Runtime and the language as tools
9
+ """
10
+
11
+ import json
12
+ import sys
13
+ from importlib import resources
14
+
15
+ from .compiler import compile_file
16
+ from .grammar import STATEMENTS
17
+
18
+
19
+ def _register():
20
+ with resources.files("rsoslang").joinpath("data/register.json").open(encoding="utf-8") as f:
21
+ return json.load(f)
22
+
23
+
24
+ def main(argv=None):
25
+ argv = list(sys.argv[1:] if argv is None else argv)
26
+ if not argv or argv[0] in ("-h", "--help"):
27
+ print(__doc__)
28
+ return 0
29
+ cmd = argv[0]
30
+ if cmd == "mcp":
31
+ from .mcp_server import main as serve
32
+ serve()
33
+ return 0
34
+ if cmd == "statements":
35
+ if "--json" in argv:
36
+ from .grammar import signature
37
+ print(json.dumps({s.kw: {"family": s.family, "refs": s.refs, "signature": signature(s), "example": s.doc}
38
+ for s in STATEMENTS.values()}, indent=1, ensure_ascii=False))
39
+ return 0
40
+ for s in STATEMENTS.values():
41
+ print(f"{s.kw:<12} {s.family:<8} {','.join(s.refs):<22} {s.doc}")
42
+ return 0
43
+ if cmd == "register":
44
+ reg = _register()
45
+ covered = {r for s in STATEMENTS.values() for r in s.refs}
46
+ for row in reg:
47
+ mark = "x" if row["id"] in covered else " "
48
+ print(f"[{mark}] {row['id']:<4} {row['name'][:70]}")
49
+ print(f"\ncovered {sum(r['id'] in covered for r in reg)} / {len(reg)} register rows")
50
+ return 0
51
+ if cmd == "session" and len(argv) >= 2:
52
+ from .mind.session import compile_session
53
+ res = compile_file(argv[1])
54
+ for d in res.diagnostics:
55
+ print(d, file=sys.stderr)
56
+ s = compile_session(res.ir, argv[1])
57
+ print(s["rsx"])
58
+ print(f"# {len(s['steps'])} steps, {len(s['timeline']['events'])} timeline events, "
59
+ f"{s['timeline'].get('duration_ms', 0) / 1000:.0f} s; skipped {s['skipped']}; {s['footer']}", file=sys.stderr)
60
+ return 0
61
+ if cmd in ("check", "ir") and len(argv) >= 2:
62
+ res = compile_file(argv[1])
63
+ for d in res.diagnostics:
64
+ print(d, file=sys.stderr)
65
+ if cmd == "ir":
66
+ print(res.to_json())
67
+ print(f"sha256 {res.digest()}", file=sys.stderr)
68
+ else:
69
+ print(f"{argv[1]}: {len(res.errors)} errors, {len(res.warnings)} warnings, {len(res.ir['ops'])} operations")
70
+ return 0 if res.ok else 1
71
+ print(__doc__)
72
+ return 2
73
+
74
+
75
+ if __name__ == "__main__":
76
+ sys.exit(main())
77
+
78
+
79
+ def cli():
80
+ sys.exit(main())
File without changes