cks-runtime 0.1.2__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 (34) hide show
  1. cks_runtime-0.1.2/LICENSE +21 -0
  2. cks_runtime-0.1.2/PKG-INFO +306 -0
  3. cks_runtime-0.1.2/README.md +282 -0
  4. cks_runtime-0.1.2/cks_runtime/__init__.py +11 -0
  5. cks_runtime-0.1.2/cks_runtime/adapters/__init__.py +0 -0
  6. cks_runtime-0.1.2/cks_runtime/config.py +22 -0
  7. cks_runtime-0.1.2/cks_runtime/core_api/__init__.py +0 -0
  8. cks_runtime-0.1.2/cks_runtime/core_api/interfaces.py +78 -0
  9. cks_runtime-0.1.2/cks_runtime/diagnostics/__init__.py +0 -0
  10. cks_runtime-0.1.2/cks_runtime/diagnostics/aggregator.py +115 -0
  11. cks_runtime-0.1.2/cks_runtime/diagnostics/diagnostic.py +68 -0
  12. cks_runtime-0.1.2/cks_runtime/explainability/__init__.py +0 -0
  13. cks_runtime-0.1.2/cks_runtime/explainability/explainability_manager.py +0 -0
  14. cks_runtime-0.1.2/cks_runtime/runtime.py +85 -0
  15. cks_runtime-0.1.2/cks_runtime/session/__init__.py +0 -0
  16. cks_runtime-0.1.2/cks_runtime/session/session.py +72 -0
  17. cks_runtime-0.1.2/cks_runtime/session/session_manager.py +98 -0
  18. cks_runtime-0.1.2/cks_runtime/storage/__init__.py +0 -0
  19. cks_runtime-0.1.2/cks_runtime/storage/exceptions.py +37 -0
  20. cks_runtime-0.1.2/cks_runtime/storage/memory_storage.py +127 -0
  21. cks_runtime-0.1.2/cks_runtime/storage/storage.py +90 -0
  22. cks_runtime-0.1.2/cks_runtime/transaction/__init__.py +0 -0
  23. cks_runtime-0.1.2/cks_runtime/transaction/transaction.py +149 -0
  24. cks_runtime-0.1.2/cks_runtime/transaction/transaction_manager.py +125 -0
  25. cks_runtime-0.1.2/cks_runtime/versioning/__init__.py +0 -0
  26. cks_runtime-0.1.2/cks_runtime/versioning/version.py +44 -0
  27. cks_runtime-0.1.2/cks_runtime/versioning/version_manager.py +81 -0
  28. cks_runtime-0.1.2/cks_runtime.egg-info/PKG-INFO +306 -0
  29. cks_runtime-0.1.2/cks_runtime.egg-info/SOURCES.txt +32 -0
  30. cks_runtime-0.1.2/cks_runtime.egg-info/dependency_links.txt +1 -0
  31. cks_runtime-0.1.2/cks_runtime.egg-info/requires.txt +4 -0
  32. cks_runtime-0.1.2/cks_runtime.egg-info/top_level.txt +1 -0
  33. cks_runtime-0.1.2/pyproject.toml +54 -0
  34. cks_runtime-0.1.2/setup.cfg +4 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Deus-corp
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.
@@ -0,0 +1,306 @@
1
+ Metadata-Version: 2.4
2
+ Name: cks-runtime
3
+ Version: 0.1.2
4
+ Summary: Canonical Runtime for the Canonical Knowledge Structure ecosystem
5
+ Author: Vladyslav Hruznov
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Deus-corp/cks-runtime
8
+ Project-URL: Repository, https://github.com/Deus-corp/cks-runtime
9
+ Project-URL: Issues, https://github.com/Deus-corp/cks-runtime/issues
10
+ Keywords: canonical-knowledge-structure,runtime,knowledge-runtime,transactions,sessions,versioning
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Topic :: Software Development :: Libraries
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=8.0; extra == "dev"
22
+ Requires-Dist: mypy>=1.0; extra == "dev"
23
+ Dynamic: license-file
24
+
25
+ # CKS Runtime
26
+
27
+ > The canonical operational environment for Canonical Knowledge Structures.
28
+
29
+ ![Python](https://img.shields.io/badge/python-3.11%2B-blue)
30
+ ![License](https://img.shields.io/badge/license-MIT-green)
31
+ ![Status](https://img.shields.io/badge/status-alpha-orange)
32
+
33
+ CKS Runtime is the canonical execution environment for
34
+ Canonical Knowledge Structures (CKS).
35
+
36
+ Where **CKS Core** defines the semantics of knowledge,
37
+ **CKS Runtime** defines its operational lifecycle.
38
+
39
+ Runtime provides the infrastructure required to execute,
40
+ manage, version, persist and expose Canonical Knowledge Structures
41
+ without becoming a semantic authority itself.
42
+
43
+ ---
44
+
45
+ # Why Runtime?
46
+
47
+ Canonical knowledge is immutable.
48
+
49
+ Operational state is not.
50
+
51
+ Applications need to:
52
+
53
+ - create sessions
54
+ - execute transactions
55
+ - maintain history
56
+ - persist state
57
+ - expose APIs
58
+ - coordinate diagnostics
59
+
60
+ These responsibilities belong to Runtime rather than CKS Core.
61
+
62
+ ```
63
+ Canonical Knowledge Structure
64
+
65
+
66
+ CKS Runtime
67
+
68
+ ┌──────────┼──────────┐
69
+ ▼ ▼ ▼
70
+ Session Versioning Storage
71
+ ```
72
+
73
+ Runtime manages operational behaviour.
74
+
75
+ CKS Core defines semantic behaviour.
76
+
77
+ ---
78
+
79
+ # Core Principles
80
+
81
+ CKS Runtime is founded on four architectural principles.
82
+
83
+ ### Runtime is not a semantic authority.
84
+
85
+ Semantic meaning permanently belongs to CKS Core.
86
+
87
+ Runtime never redefines knowledge.
88
+
89
+ ---
90
+
91
+ ### Runtime orchestrates semantic services.
92
+
93
+ Validation.
94
+
95
+ Evolution.
96
+
97
+ Serialization.
98
+
99
+ Diagnostics.
100
+
101
+ These services originate from CKS Core.
102
+
103
+ Runtime coordinates their execution.
104
+
105
+ ---
106
+
107
+ ### Operational state belongs to Runtime.
108
+
109
+ Sessions.
110
+
111
+ Transactions.
112
+
113
+ Persistence.
114
+
115
+ Version History.
116
+
117
+ These are Runtime responsibilities.
118
+
119
+ ---
120
+
121
+ ### Observable behaviour is standardized.
122
+
123
+ The Runtime Standard specifies observable operational behaviour rather than implementation techniques.
124
+
125
+ ---
126
+
127
+ # Runtime Architecture
128
+
129
+ The CKS ecosystem is organized into four architectural layers.
130
+
131
+ ```
132
+ Applications
133
+
134
+
135
+ Adapters
136
+
137
+
138
+ CKS Runtime
139
+
140
+
141
+ Public CKS Core API
142
+
143
+
144
+ CKS Core
145
+ ```
146
+
147
+ Responsibilities are strictly separated.
148
+
149
+ | Layer | Responsibility |
150
+ |--------|----------------|
151
+ | CKS Core | Semantic authority |
152
+ | CKS Runtime | Operational orchestration |
153
+ | Adapters | Protocol exposure |
154
+ | Applications | Business logic |
155
+
156
+ ---
157
+
158
+ # Features
159
+
160
+ The current Reference Runtime provides:
161
+
162
+ - Runtime Sessions
163
+ - Transaction Management
164
+ - Version History
165
+ - Storage Abstraction
166
+ - Runtime Diagnostics
167
+ - Explainability Coordination
168
+ - Canonical Runtime API
169
+ - Reference Runtime Architecture
170
+ - Runtime Conformance Model
171
+
172
+ ---
173
+
174
+ # Design Goals
175
+
176
+ CKS Runtime is designed to be:
177
+
178
+ - deterministic
179
+ - implementation-independent
180
+ - transport-independent
181
+ - storage-independent
182
+ - session-oriented
183
+ - transaction-oriented
184
+ - semantically neutral
185
+
186
+ ---
187
+
188
+ # Relationship to CKS Core
189
+
190
+ CKS Runtime depends upon CKS Core.
191
+
192
+ CKS Runtime never replaces CKS Core.
193
+
194
+ ```
195
+ CKS Core
196
+ defines semantics
197
+
198
+
199
+
200
+
201
+
202
+ CKS Runtime
203
+ orchestrates semantics
204
+ manages operational lifecycle
205
+ ```
206
+
207
+ Runtime communicates exclusively through the public CKS Core API.
208
+
209
+ ---
210
+
211
+ # Installation
212
+
213
+ From PyPI:
214
+
215
+ ```bash
216
+ pip install cks-core
217
+ pip install cks-runtime
218
+ ```
219
+
220
+ Or from source:
221
+
222
+ ```bash
223
+ git clone https://github.com/Deus-corp/cks-runtime.git
224
+
225
+ cd cks-runtime
226
+
227
+ pip install -e .
228
+ ```
229
+
230
+ ---
231
+
232
+ # Quick Example
233
+
234
+ ```python
235
+ from cks_runtime import Runtime
236
+
237
+ runtime = Runtime()
238
+
239
+ session = runtime.sessions.create(
240
+ knowledge_structure=my_structure
241
+ )
242
+
243
+ transaction = runtime.transactions.begin(session)
244
+
245
+ # Runtime coordinates execution.
246
+ # CKS Core defines semantics.
247
+ ```
248
+
249
+ ---
250
+
251
+ # Documentation
252
+
253
+ The Runtime Standard consists of the following normative specifications.
254
+
255
+ | Specification | Purpose |
256
+ |--------------|---------|
257
+ | SPEC-001 | Runtime Overview |
258
+ | SPEC-002 | Session Model |
259
+ | SPEC-003 | Runtime API |
260
+ | SPEC-004 | Diagnostics |
261
+ | SPEC-005 | Transactions |
262
+ | SPEC-006 | Storage |
263
+ | SPEC-007 | Version History |
264
+ | SPEC-008 | Runtime Conformance |
265
+
266
+ Supporting documents include:
267
+
268
+ - Runtime Charter
269
+ - Architectural Analyses
270
+ - Architecture Decision Records
271
+ - Reference Architecture
272
+
273
+ ---
274
+
275
+ # Project Status
276
+
277
+ Current implementation status:
278
+
279
+ | Component | Status |
280
+ |----------|--------|
281
+ | Runtime Architecture | ✅ Complete |
282
+ | Session Model | ✅ Complete |
283
+ | Transaction Model | ✅ Complete |
284
+ | Version History | ✅ Complete |
285
+ | Diagnostics | ✅ Complete |
286
+ | Storage Abstraction | ✅ Complete |
287
+ | Runtime API | ✅ Complete |
288
+ | Runtime Documentation | ✅ Complete |
289
+ | Reference Implementation | 🚧 In Progress |
290
+ | Adapter Integration | ⏳ Planned |
291
+
292
+ ---
293
+
294
+ # Long-Term Vision
295
+
296
+ CKS Runtime aims to become the canonical operational foundation shared by every CKS-compatible implementation.
297
+
298
+ Future adapter standards—including MCP, CLI, HTTP and others—will rely on Runtime rather than communicating directly with CKS Core.
299
+
300
+ This preserves a single semantic authority while allowing unlimited operational implementations.
301
+
302
+ ---
303
+
304
+ # License
305
+
306
+ MIT
@@ -0,0 +1,282 @@
1
+ # CKS Runtime
2
+
3
+ > The canonical operational environment for Canonical Knowledge Structures.
4
+
5
+ ![Python](https://img.shields.io/badge/python-3.11%2B-blue)
6
+ ![License](https://img.shields.io/badge/license-MIT-green)
7
+ ![Status](https://img.shields.io/badge/status-alpha-orange)
8
+
9
+ CKS Runtime is the canonical execution environment for
10
+ Canonical Knowledge Structures (CKS).
11
+
12
+ Where **CKS Core** defines the semantics of knowledge,
13
+ **CKS Runtime** defines its operational lifecycle.
14
+
15
+ Runtime provides the infrastructure required to execute,
16
+ manage, version, persist and expose Canonical Knowledge Structures
17
+ without becoming a semantic authority itself.
18
+
19
+ ---
20
+
21
+ # Why Runtime?
22
+
23
+ Canonical knowledge is immutable.
24
+
25
+ Operational state is not.
26
+
27
+ Applications need to:
28
+
29
+ - create sessions
30
+ - execute transactions
31
+ - maintain history
32
+ - persist state
33
+ - expose APIs
34
+ - coordinate diagnostics
35
+
36
+ These responsibilities belong to Runtime rather than CKS Core.
37
+
38
+ ```
39
+ Canonical Knowledge Structure
40
+
41
+
42
+ CKS Runtime
43
+
44
+ ┌──────────┼──────────┐
45
+ ▼ ▼ ▼
46
+ Session Versioning Storage
47
+ ```
48
+
49
+ Runtime manages operational behaviour.
50
+
51
+ CKS Core defines semantic behaviour.
52
+
53
+ ---
54
+
55
+ # Core Principles
56
+
57
+ CKS Runtime is founded on four architectural principles.
58
+
59
+ ### Runtime is not a semantic authority.
60
+
61
+ Semantic meaning permanently belongs to CKS Core.
62
+
63
+ Runtime never redefines knowledge.
64
+
65
+ ---
66
+
67
+ ### Runtime orchestrates semantic services.
68
+
69
+ Validation.
70
+
71
+ Evolution.
72
+
73
+ Serialization.
74
+
75
+ Diagnostics.
76
+
77
+ These services originate from CKS Core.
78
+
79
+ Runtime coordinates their execution.
80
+
81
+ ---
82
+
83
+ ### Operational state belongs to Runtime.
84
+
85
+ Sessions.
86
+
87
+ Transactions.
88
+
89
+ Persistence.
90
+
91
+ Version History.
92
+
93
+ These are Runtime responsibilities.
94
+
95
+ ---
96
+
97
+ ### Observable behaviour is standardized.
98
+
99
+ The Runtime Standard specifies observable operational behaviour rather than implementation techniques.
100
+
101
+ ---
102
+
103
+ # Runtime Architecture
104
+
105
+ The CKS ecosystem is organized into four architectural layers.
106
+
107
+ ```
108
+ Applications
109
+
110
+
111
+ Adapters
112
+
113
+
114
+ CKS Runtime
115
+
116
+
117
+ Public CKS Core API
118
+
119
+
120
+ CKS Core
121
+ ```
122
+
123
+ Responsibilities are strictly separated.
124
+
125
+ | Layer | Responsibility |
126
+ |--------|----------------|
127
+ | CKS Core | Semantic authority |
128
+ | CKS Runtime | Operational orchestration |
129
+ | Adapters | Protocol exposure |
130
+ | Applications | Business logic |
131
+
132
+ ---
133
+
134
+ # Features
135
+
136
+ The current Reference Runtime provides:
137
+
138
+ - Runtime Sessions
139
+ - Transaction Management
140
+ - Version History
141
+ - Storage Abstraction
142
+ - Runtime Diagnostics
143
+ - Explainability Coordination
144
+ - Canonical Runtime API
145
+ - Reference Runtime Architecture
146
+ - Runtime Conformance Model
147
+
148
+ ---
149
+
150
+ # Design Goals
151
+
152
+ CKS Runtime is designed to be:
153
+
154
+ - deterministic
155
+ - implementation-independent
156
+ - transport-independent
157
+ - storage-independent
158
+ - session-oriented
159
+ - transaction-oriented
160
+ - semantically neutral
161
+
162
+ ---
163
+
164
+ # Relationship to CKS Core
165
+
166
+ CKS Runtime depends upon CKS Core.
167
+
168
+ CKS Runtime never replaces CKS Core.
169
+
170
+ ```
171
+ CKS Core
172
+ defines semantics
173
+
174
+
175
+
176
+
177
+
178
+ CKS Runtime
179
+ orchestrates semantics
180
+ manages operational lifecycle
181
+ ```
182
+
183
+ Runtime communicates exclusively through the public CKS Core API.
184
+
185
+ ---
186
+
187
+ # Installation
188
+
189
+ From PyPI:
190
+
191
+ ```bash
192
+ pip install cks-core
193
+ pip install cks-runtime
194
+ ```
195
+
196
+ Or from source:
197
+
198
+ ```bash
199
+ git clone https://github.com/Deus-corp/cks-runtime.git
200
+
201
+ cd cks-runtime
202
+
203
+ pip install -e .
204
+ ```
205
+
206
+ ---
207
+
208
+ # Quick Example
209
+
210
+ ```python
211
+ from cks_runtime import Runtime
212
+
213
+ runtime = Runtime()
214
+
215
+ session = runtime.sessions.create(
216
+ knowledge_structure=my_structure
217
+ )
218
+
219
+ transaction = runtime.transactions.begin(session)
220
+
221
+ # Runtime coordinates execution.
222
+ # CKS Core defines semantics.
223
+ ```
224
+
225
+ ---
226
+
227
+ # Documentation
228
+
229
+ The Runtime Standard consists of the following normative specifications.
230
+
231
+ | Specification | Purpose |
232
+ |--------------|---------|
233
+ | SPEC-001 | Runtime Overview |
234
+ | SPEC-002 | Session Model |
235
+ | SPEC-003 | Runtime API |
236
+ | SPEC-004 | Diagnostics |
237
+ | SPEC-005 | Transactions |
238
+ | SPEC-006 | Storage |
239
+ | SPEC-007 | Version History |
240
+ | SPEC-008 | Runtime Conformance |
241
+
242
+ Supporting documents include:
243
+
244
+ - Runtime Charter
245
+ - Architectural Analyses
246
+ - Architecture Decision Records
247
+ - Reference Architecture
248
+
249
+ ---
250
+
251
+ # Project Status
252
+
253
+ Current implementation status:
254
+
255
+ | Component | Status |
256
+ |----------|--------|
257
+ | Runtime Architecture | ✅ Complete |
258
+ | Session Model | ✅ Complete |
259
+ | Transaction Model | ✅ Complete |
260
+ | Version History | ✅ Complete |
261
+ | Diagnostics | ✅ Complete |
262
+ | Storage Abstraction | ✅ Complete |
263
+ | Runtime API | ✅ Complete |
264
+ | Runtime Documentation | ✅ Complete |
265
+ | Reference Implementation | 🚧 In Progress |
266
+ | Adapter Integration | ⏳ Planned |
267
+
268
+ ---
269
+
270
+ # Long-Term Vision
271
+
272
+ CKS Runtime aims to become the canonical operational foundation shared by every CKS-compatible implementation.
273
+
274
+ Future adapter standards—including MCP, CLI, HTTP and others—will rely on Runtime rather than communicating directly with CKS Core.
275
+
276
+ This preserves a single semantic authority while allowing unlimited operational implementations.
277
+
278
+ ---
279
+
280
+ # License
281
+
282
+ MIT
@@ -0,0 +1,11 @@
1
+ """
2
+ CKS Runtime.
3
+ """
4
+
5
+ from .runtime import Runtime
6
+ from .config import RuntimeConfig
7
+
8
+ __all__ = [
9
+ "Runtime",
10
+ "RuntimeConfig",
11
+ ]
File without changes
@@ -0,0 +1,22 @@
1
+ """
2
+ Runtime configuration.
3
+
4
+ SPEC-001 Runtime Overview
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from dataclasses import dataclass
10
+
11
+
12
+ @dataclass(slots=True)
13
+ class RuntimeConfig:
14
+ """
15
+ Runtime configuration.
16
+
17
+ Future specifications may extend this configuration.
18
+ """
19
+
20
+ runtime_name: str = "CKS Runtime"
21
+
22
+ runtime_version: str = "0.1.2"
File without changes
@@ -0,0 +1,78 @@
1
+ """
2
+ Core boundary interfaces.
3
+
4
+ This module defines the exclusive semantic boundary
5
+ between CKS Runtime and CKS Core.
6
+
7
+ Runtime depends only on these abstractions.
8
+
9
+ Concrete Core implementations are supplied externally.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from abc import ABC
15
+ from abc import abstractmethod
16
+ from typing import Any
17
+
18
+
19
+ class CoreInterface(ABC):
20
+ """
21
+ Semantic boundary between Runtime and CKS Core.
22
+
23
+ Runtime owns operational behaviour.
24
+
25
+ CKS Core owns semantic behaviour.
26
+
27
+ Runtime shall never implement semantic rules itself.
28
+ """
29
+
30
+ @abstractmethod
31
+ def validate(
32
+ self,
33
+ knowledge_structure: Any,
34
+ ) -> Any:
35
+ """
36
+ Execute canonical Core validation.
37
+
38
+ Validation semantics belong exclusively
39
+ to CKS Core.
40
+ """
41
+
42
+ @abstractmethod
43
+ def serialize(
44
+ self,
45
+ knowledge_structure: Any,
46
+ ) -> Any:
47
+ """
48
+ Produce canonical serialization.
49
+
50
+ Serialization semantics belong exclusively
51
+ to CKS Core.
52
+ """
53
+
54
+ @abstractmethod
55
+ def evolve(
56
+ self,
57
+ knowledge_structure: Any,
58
+ operation: Any,
59
+ ) -> Any:
60
+ """
61
+ Execute canonical semantic evolution.
62
+
63
+ Runtime coordinates execution.
64
+
65
+ CKS Core defines the resulting semantic state.
66
+ """
67
+
68
+ @abstractmethod
69
+ def explain(
70
+ self,
71
+ knowledge_structure: Any,
72
+ ) -> Any:
73
+ """
74
+ Produce semantic explanation.
75
+
76
+ Runtime may expose explanations but never
77
+ generates semantic explanations itself.
78
+ """
File without changes