cks-runtime 0.4.4__tar.gz → 0.4.5__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 (55) hide show
  1. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/PKG-INFO +2 -2
  2. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/config.py +1 -1
  3. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/operations/operation_types.py +7 -3
  4. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime.egg-info/PKG-INFO +2 -2
  5. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime.egg-info/requires.txt +1 -1
  6. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime_plugins/cks_core/adapter.py +38 -1
  7. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/pyproject.toml +2 -2
  8. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/LICENSE +0 -0
  9. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/README.md +0 -0
  10. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/__init__.py +0 -0
  11. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/adapters/__init__.py +0 -0
  12. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/adapters/mcp/__init__.py +0 -0
  13. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/adapters/mcp/adapter.py +0 -0
  14. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/adapters/mcp/contracts.py +0 -0
  15. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/adapters/mcp/errors.py +0 -0
  16. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/adapters/mcp/handlers.py +0 -0
  17. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/adapters/mcp/serializers.py +0 -0
  18. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/adapters/mcp/tool_registry.py +0 -0
  19. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/core_api/__init__.py +0 -0
  20. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/core_api/bridge.py +0 -0
  21. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/core_api/interfaces.py +0 -0
  22. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/core_api/validation_result.py +0 -0
  23. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/diagnostics/__init__.py +0 -0
  24. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/diagnostics/aggregator.py +0 -0
  25. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/diagnostics/diagnostic.py +0 -0
  26. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/dispatcher/dispatcher.py +0 -0
  27. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/events/event_bus.py +0 -0
  28. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/events/runtime_event.py +0 -0
  29. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/execution/__init__.py +0 -0
  30. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/execution/execution_context.py +0 -0
  31. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/execution/operation_executor.py +0 -0
  32. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/explainability/__init__.py +0 -0
  33. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/explainability/explainability_manager.py +0 -0
  34. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/operations/operation_registry.py +0 -0
  35. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/pipeline/__init__.py +0 -0
  36. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/pipeline/execution_pipeline.py +0 -0
  37. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/runtime.py +0 -0
  38. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/session/__init__.py +0 -0
  39. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/session/session.py +0 -0
  40. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/session/session_manager.py +0 -0
  41. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/storage/__init__.py +0 -0
  42. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/storage/memory_storage.py +0 -0
  43. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/storage/storage.py +0 -0
  44. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/transaction/__init__.py +0 -0
  45. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/transaction/transaction.py +0 -0
  46. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/transaction/transaction_manager.py +0 -0
  47. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/versioning/__init__.py +0 -0
  48. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/versioning/version.py +0 -0
  49. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime/versioning/version_manager.py +0 -0
  50. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime.egg-info/SOURCES.txt +0 -0
  51. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime.egg-info/dependency_links.txt +0 -0
  52. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime.egg-info/top_level.txt +0 -0
  53. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime_plugins/__init__.py +0 -0
  54. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/cks_runtime_plugins/cks_core/__init__.py +0 -0
  55. {cks_runtime-0.4.4 → cks_runtime-0.4.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cks-runtime
3
- Version: 0.4.4
3
+ Version: 0.4.5
4
4
  Summary: Canonical Runtime for the Canonical Knowledge Structure ecosystem
5
5
  Author: Vladyslav Hruznov
6
6
  License: MIT
@@ -17,7 +17,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
17
  Requires-Python: >=3.12
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: cks-core>=1.2.1
20
+ Requires-Dist: cks-core>=1.3.0
21
21
  Provides-Extra: dev
22
22
  Requires-Dist: pytest>=8.0; extra == "dev"
23
23
  Requires-Dist: mypy>=1.0; extra == "dev"
@@ -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.4"
31
+ return "0.4.5"
32
32
 
33
33
 
34
34
  @dataclass(slots=True)
@@ -32,13 +32,17 @@ class ValidateOperation(Operation):
32
32
  executor,
33
33
  ) -> ExecutionResult:
34
34
  result = executor.core.validate(self.knowledge_structure)
35
- error = None if result.valid else RuntimeError("Validation failed")
35
+ # Determining that a Knowledge Structure is invalid is a
36
+ # successful outcome of *running* validation, not an
37
+ # operation failure -- it must be reported as diagnostics,
38
+ # never as a raised exception. Only unexpected execution
39
+ # errors (caught by OperationExecutor) are OperationStatus.FAILED.
36
40
  return ExecutionResult(
37
41
  operation_id=self.operation_id,
38
- status=OperationStatus.COMPLETED if result.valid else OperationStatus.FAILED,
42
+ status=OperationStatus.COMPLETED,
39
43
  payload=result,
40
44
  diagnostics=result.diagnostics,
41
- error=error,
45
+ error=None,
42
46
  )
43
47
 
44
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cks-runtime
3
- Version: 0.4.4
3
+ Version: 0.4.5
4
4
  Summary: Canonical Runtime for the Canonical Knowledge Structure ecosystem
5
5
  Author: Vladyslav Hruznov
6
6
  License: MIT
@@ -17,7 +17,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
17
  Requires-Python: >=3.12
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: cks-core>=1.2.1
20
+ Requires-Dist: cks-core>=1.3.0
21
21
  Provides-Extra: dev
22
22
  Requires-Dist: pytest>=8.0; extra == "dev"
23
23
  Requires-Dist: mypy>=1.0; extra == "dev"
@@ -1,4 +1,4 @@
1
- cks-core>=1.2.1
1
+ cks-core>=1.3.0
2
2
 
3
3
  [dev]
4
4
  pytest>=8.0
@@ -13,6 +13,7 @@ from __future__ import annotations
13
13
  from typing import Any
14
14
 
15
15
  import cks
16
+ from cks.diagnostics import DiagnosticSeverity as CoreSeverity
16
17
  from cks.evolution import compose
17
18
  from cks.interface import inspect as cks_inspect
18
19
 
@@ -20,6 +21,42 @@ from cks_runtime.core_api.interfaces import CoreInterface
20
21
  from cks_runtime.core_api.validation_result import (
21
22
  RuntimeValidationResult,
22
23
  )
24
+ from cks_runtime.diagnostics.diagnostic import (
25
+ Diagnostic as RuntimeDiagnostic,
26
+ DiagnosticSeverity as RuntimeSeverity,
27
+ DiagnosticSource,
28
+ )
29
+
30
+ _SEVERITY_MAP = {
31
+ CoreSeverity.INFORMATION: RuntimeSeverity.INFO,
32
+ CoreSeverity.WARNING: RuntimeSeverity.WARNING,
33
+ CoreSeverity.ERROR: RuntimeSeverity.ERROR,
34
+ }
35
+
36
+
37
+ def _translate_diagnostic(diagnostic: Any) -> RuntimeDiagnostic:
38
+ """
39
+ Translate a cks-core Diagnostic into a Runtime-native Diagnostic.
40
+
41
+ cks-core diagnostics freeze ``metadata`` into a MappingProxyType,
42
+ which the stdlib ``copy`` module cannot deepcopy. Runtime persists
43
+ Diagnostics via deepcopy (see InMemoryStorage), so foreign
44
+ cks-core Diagnostic instances must never be stored as-is -- they
45
+ are always translated into the Runtime's own, deepcopy-safe
46
+ Diagnostic type at this boundary.
47
+ """
48
+
49
+ metadata = dict(diagnostic.metadata)
50
+ if diagnostic.location is not None:
51
+ metadata.setdefault("location", diagnostic.location)
52
+
53
+ return RuntimeDiagnostic(
54
+ message=diagnostic.message,
55
+ source=DiagnosticSource.CORE,
56
+ severity=_SEVERITY_MAP[diagnostic.severity],
57
+ code=diagnostic.identity,
58
+ metadata=metadata,
59
+ )
23
60
 
24
61
 
25
62
  class CksCoreAdapter(CoreInterface):
@@ -46,7 +83,7 @@ class CksCoreAdapter(CoreInterface):
46
83
  return RuntimeValidationResult(
47
84
  valid=result.is_valid,
48
85
  diagnostics=tuple(
49
- result.diagnostics,
86
+ _translate_diagnostic(d) for d in result.diagnostics
50
87
  ),
51
88
  metadata=dict(
52
89
  result.metadata,
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cks-runtime"
7
- version = "0.4.4"
7
+ version = "0.4.5"
8
8
 
9
9
  description = "Canonical Runtime for the Canonical Knowledge Structure ecosystem"
10
10
 
@@ -19,7 +19,7 @@ license = { text = "MIT" }
19
19
  requires-python = ">=3.12"
20
20
 
21
21
  dependencies = [
22
- "cks-core>=1.2.1",
22
+ "cks-core>=1.3.0",
23
23
  ]
24
24
 
25
25
  keywords = [
File without changes
File without changes
File without changes