cks-runtime 0.4.5__tar.gz → 0.4.6__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 (56) hide show
  1. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/PKG-INFO +1 -1
  2. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/config.py +1 -1
  3. cks_runtime-0.4.6/cks_runtime/versioning/version.py +103 -0
  4. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime.egg-info/PKG-INFO +1 -1
  5. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/pyproject.toml +1 -1
  6. cks_runtime-0.4.5/cks_runtime/versioning/version.py +0 -110
  7. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/LICENSE +0 -0
  8. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/README.md +0 -0
  9. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/__init__.py +0 -0
  10. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/adapters/__init__.py +0 -0
  11. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/adapters/mcp/__init__.py +0 -0
  12. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/adapters/mcp/adapter.py +0 -0
  13. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/adapters/mcp/contracts.py +0 -0
  14. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/adapters/mcp/errors.py +0 -0
  15. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/adapters/mcp/handlers.py +0 -0
  16. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/adapters/mcp/serializers.py +0 -0
  17. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/adapters/mcp/tool_registry.py +0 -0
  18. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/core_api/__init__.py +0 -0
  19. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/core_api/bridge.py +0 -0
  20. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/core_api/interfaces.py +0 -0
  21. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/core_api/validation_result.py +0 -0
  22. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/diagnostics/__init__.py +0 -0
  23. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/diagnostics/aggregator.py +0 -0
  24. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/diagnostics/diagnostic.py +0 -0
  25. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/dispatcher/dispatcher.py +0 -0
  26. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/events/event_bus.py +0 -0
  27. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/events/runtime_event.py +0 -0
  28. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/execution/__init__.py +0 -0
  29. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/execution/execution_context.py +0 -0
  30. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/execution/operation_executor.py +0 -0
  31. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/explainability/__init__.py +0 -0
  32. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/explainability/explainability_manager.py +0 -0
  33. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/operations/operation_registry.py +0 -0
  34. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/operations/operation_types.py +0 -0
  35. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/pipeline/__init__.py +0 -0
  36. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/pipeline/execution_pipeline.py +0 -0
  37. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/runtime.py +0 -0
  38. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/session/__init__.py +0 -0
  39. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/session/session.py +0 -0
  40. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/session/session_manager.py +0 -0
  41. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/storage/__init__.py +0 -0
  42. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/storage/memory_storage.py +0 -0
  43. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/storage/storage.py +0 -0
  44. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/transaction/__init__.py +0 -0
  45. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/transaction/transaction.py +0 -0
  46. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/transaction/transaction_manager.py +0 -0
  47. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/versioning/__init__.py +0 -0
  48. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime/versioning/version_manager.py +0 -0
  49. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime.egg-info/SOURCES.txt +0 -0
  50. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime.egg-info/dependency_links.txt +0 -0
  51. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime.egg-info/requires.txt +0 -0
  52. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime.egg-info/top_level.txt +0 -0
  53. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime_plugins/__init__.py +0 -0
  54. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime_plugins/cks_core/__init__.py +0 -0
  55. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/cks_runtime_plugins/cks_core/adapter.py +0 -0
  56. {cks_runtime-0.4.5 → cks_runtime-0.4.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cks-runtime
3
- Version: 0.4.5
3
+ Version: 0.4.6
4
4
  Summary: Canonical Runtime for the Canonical Knowledge Structure ecosystem
5
5
  Author: Vladyslav Hruznov
6
6
  License: MIT
@@ -28,7 +28,7 @@ def _runtime_version() -> str:
28
28
  try:
29
29
  return version("cks-runtime")
30
30
  except PackageNotFoundError:
31
- return "0.4.5"
31
+ return "0.4.6"
32
32
 
33
33
 
34
34
  @dataclass(slots=True)
@@ -0,0 +1,103 @@
1
+ """
2
+ Runtime Version.
3
+
4
+ Represents an immutable Runtime snapshot.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from copy import deepcopy
10
+ from dataclasses import dataclass, field
11
+ from datetime import UTC, datetime
12
+ from types import MappingProxyType
13
+ from typing import Any, Mapping
14
+ from uuid import uuid4
15
+
16
+
17
+ @dataclass(frozen=True, slots=True)
18
+ class RuntimeVersion:
19
+ """Immutable Runtime snapshot."""
20
+
21
+ session_id: str
22
+ transaction_id: str
23
+ knowledge_structure: Any
24
+ metadata: Mapping[str, Any]
25
+
26
+ version_id: str = field(default_factory=lambda: str(uuid4()))
27
+ created_at: datetime = field(default_factory=lambda: datetime.now(UTC))
28
+
29
+ def __post_init__(self) -> None:
30
+ """Deep-copy mutable state and freeze metadata."""
31
+ object.__setattr__(
32
+ self,
33
+ "knowledge_structure",
34
+ deepcopy(self.knowledge_structure),
35
+ )
36
+ object.__setattr__(
37
+ self,
38
+ "metadata",
39
+ MappingProxyType(deepcopy(dict(self.metadata))),
40
+ )
41
+
42
+ #
43
+ # ------------------------------------------------------------------
44
+ # Copy semantics
45
+ # ------------------------------------------------------------------
46
+ #
47
+ # RuntimeVersion.knowledge_structure is `Any`: Runtime is
48
+ # storage-independent and must not assume a plugged-in Core's
49
+ # structure type is immutable, so a blanket `return self` here
50
+ # would silently break the isolation InMemoryStorage relies on
51
+ # for non-cks-core adapters with mutable structures.
52
+ #
53
+ # The only thing the stdlib `copy` module actually can't handle is
54
+ # `metadata`, which we wrap in MappingProxyType (immutable by our
55
+ # own contract) — so we deep-copy every field explicitly instead of
56
+ # deferring to the default pickle-based reduction.
57
+
58
+ def __copy__(self) -> "RuntimeVersion":
59
+ return type(self)(
60
+ session_id=self.session_id,
61
+ transaction_id=self.transaction_id,
62
+ knowledge_structure=self.knowledge_structure,
63
+ metadata=dict(self.metadata),
64
+ version_id=self.version_id,
65
+ created_at=self.created_at,
66
+ )
67
+
68
+ def __deepcopy__(self, memo: dict[int, Any]) -> "RuntimeVersion":
69
+ new = type(self)(
70
+ session_id=self.session_id,
71
+ transaction_id=self.transaction_id,
72
+ knowledge_structure=deepcopy(self.knowledge_structure, memo),
73
+ metadata=dict(self.metadata),
74
+ version_id=self.version_id,
75
+ created_at=self.created_at,
76
+ )
77
+ memo[id(self)] = new
78
+ return new
79
+
80
+ #
81
+ # ------------------------------------------------------------------
82
+ # Metadata
83
+ # ------------------------------------------------------------------
84
+
85
+ @property
86
+ def has_metadata(self) -> bool:
87
+ return bool(self.metadata)
88
+
89
+ @property
90
+ def age(self):
91
+ return datetime.now(UTC) - self.created_at
92
+
93
+ #
94
+ # ------------------------------------------------------------------
95
+ # Debugging
96
+ # ------------------------------------------------------------------
97
+
98
+ def __repr__(self) -> str:
99
+ return (
100
+ f"{self.__class__.__name__}("
101
+ f"id={self.version_id!r}, "
102
+ f"session={self.session_id!r})"
103
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cks-runtime
3
- Version: 0.4.5
3
+ Version: 0.4.6
4
4
  Summary: Canonical Runtime for the Canonical Knowledge Structure ecosystem
5
5
  Author: Vladyslav Hruznov
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cks-runtime"
7
- version = "0.4.5"
7
+ version = "0.4.6"
8
8
 
9
9
  description = "Canonical Runtime for the Canonical Knowledge Structure ecosystem"
10
10
 
@@ -1,110 +0,0 @@
1
- """
2
- Runtime Version.
3
-
4
- Represents an immutable Runtime snapshot.
5
-
6
- A RuntimeVersion records the operational state of a
7
- RuntimeSession immediately after a committed RuntimeTransaction.
8
-
9
- RuntimeVersions are immutable snapshots.
10
- """
11
-
12
- from __future__ import annotations
13
-
14
- from copy import deepcopy
15
- from dataclasses import dataclass
16
- from dataclasses import field
17
- from datetime import UTC
18
- from datetime import datetime
19
- from typing import Any
20
- from uuid import uuid4
21
-
22
-
23
- @dataclass(frozen=True, slots=True)
24
- class RuntimeVersion:
25
- """
26
- Immutable Runtime snapshot.
27
-
28
- Ownership:
29
-
30
- - belongs to exactly one RuntimeSession;
31
- - originates from exactly one committed RuntimeTransaction;
32
- - stores operational state only.
33
-
34
- RuntimeVersion never owns semantic behaviour.
35
- """
36
-
37
- session_id: str
38
-
39
- transaction_id: str
40
-
41
- knowledge_structure: Any
42
-
43
- metadata: dict[str, Any]
44
-
45
- version_id: str = field(
46
- default_factory=lambda: str(uuid4()),
47
- )
48
-
49
- created_at: datetime = field(
50
- default_factory=lambda: datetime.now(
51
- UTC,
52
- ),
53
- )
54
-
55
- def __post_init__(self) -> None:
56
- """
57
- Deep-copy mutable state.
58
-
59
- RuntimeVersion must never share mutable objects
60
- with a live RuntimeSession.
61
- """
62
-
63
- object.__setattr__(
64
- self,
65
- "knowledge_structure",
66
- deepcopy(self.knowledge_structure),
67
- )
68
-
69
- object.__setattr__(
70
- self,
71
- "metadata",
72
- deepcopy(self.metadata),
73
- )
74
-
75
- #
76
- # ------------------------------------------------------------------
77
- # Metadata
78
- # ------------------------------------------------------------------
79
- #
80
-
81
- @property
82
- def has_metadata(self) -> bool:
83
- """
84
- Whether this RuntimeVersion contains metadata.
85
- """
86
-
87
- return bool(self.metadata)
88
-
89
- @property
90
- def age(self):
91
- """
92
- Time elapsed since this RuntimeVersion was created.
93
- """
94
-
95
- return datetime.now(
96
- UTC,
97
- ) - self.created_at
98
-
99
- #
100
- # ------------------------------------------------------------------
101
- # Debugging
102
- # ------------------------------------------------------------------
103
- #
104
-
105
- def __repr__(self) -> str:
106
- return (
107
- f"{self.__class__.__name__}("
108
- f"id={self.version_id!r}, "
109
- f"session={self.session_id!r})"
110
- )
File without changes
File without changes
File without changes