cks-runtime 0.4.0__tar.gz → 0.4.1__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.
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/PKG-INFO +1 -1
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/config.py +1 -1
- cks_runtime-0.4.1/cks_runtime/core_api/validation_result.py +42 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime.egg-info/PKG-INFO +1 -1
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/pyproject.toml +1 -1
- cks_runtime-0.4.0/cks_runtime/core_api/validation_result.py +0 -157
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/LICENSE +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/README.md +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/adapters/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/adapters/mcp/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/adapters/mcp/adapter.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/adapters/mcp/contracts.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/adapters/mcp/errors.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/adapters/mcp/handlers.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/adapters/mcp/serializers.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/adapters/mcp/tool_registry.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/core_api/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/core_api/bridge.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/core_api/interfaces.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/diagnostics/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/diagnostics/aggregator.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/diagnostics/diagnostic.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/dispatcher/dispatcher.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/events/event_bus.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/events/runtime_event.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/execution/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/execution/execution_context.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/execution/operation_executor.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/explainability/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/explainability/explainability_manager.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/operations/operation_registry.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/operations/operation_types.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/pipeline/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/pipeline/execution_pipeline.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/runtime.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/session/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/session/session.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/session/session_manager.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/storage/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/storage/memory_storage.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/storage/storage.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/transaction/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/transaction/transaction.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/transaction/transaction_manager.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/versioning/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/versioning/version.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/versioning/version_manager.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime.egg-info/SOURCES.txt +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime.egg-info/dependency_links.txt +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime.egg-info/requires.txt +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime.egg-info/top_level.txt +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime_plugins/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime_plugins/cks_core/__init__.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime_plugins/cks_core/adapter.py +0 -0
- {cks_runtime-0.4.0 → cks_runtime-0.4.1}/setup.cfg +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Runtime Validation Result.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from dataclasses import dataclass, field
|
|
8
|
+
from typing import Any, Mapping
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(frozen=True, slots=True)
|
|
12
|
+
class RuntimeValidationResult:
|
|
13
|
+
"""Immutable Runtime validation result."""
|
|
14
|
+
|
|
15
|
+
valid: bool
|
|
16
|
+
diagnostics: tuple[Any, ...] = field(default_factory=tuple)
|
|
17
|
+
metadata: Mapping[str, Any] = field(default_factory=dict)
|
|
18
|
+
|
|
19
|
+
def __post_init__(self) -> None:
|
|
20
|
+
# diagnostics всегда должен быть кортежем
|
|
21
|
+
object.__setattr__(self, "diagnostics", tuple(self.diagnostics))
|
|
22
|
+
# metadata оставляем как есть, он уже Mapping (может быть dict)
|
|
23
|
+
# больше не оборачиваем в MappingProxyType
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def has_diagnostics(self) -> bool:
|
|
27
|
+
return bool(self.diagnostics)
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def diagnostic_count(self) -> int:
|
|
31
|
+
return len(self.diagnostics)
|
|
32
|
+
|
|
33
|
+
def __bool__(self) -> bool:
|
|
34
|
+
return self.valid
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def success(cls, *, metadata: Mapping[str, Any] | None = None) -> RuntimeValidationResult:
|
|
38
|
+
return cls(valid=True, metadata=metadata if metadata is not None else {})
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def failure(cls, diagnostics: tuple[Any, ...], *, metadata: Mapping[str, Any] | None = None) -> RuntimeValidationResult:
|
|
42
|
+
return cls(valid=False, diagnostics=diagnostics, metadata=metadata if metadata is not None else {})
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Runtime Validation Result.
|
|
3
|
-
|
|
4
|
-
Represents the Runtime-native view of semantic validation.
|
|
5
|
-
|
|
6
|
-
Runtime never depends on Core-native validation objects.
|
|
7
|
-
|
|
8
|
-
Core plugins translate their validation models into
|
|
9
|
-
this stable Runtime representation.
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
from __future__ import annotations
|
|
13
|
-
|
|
14
|
-
from dataclasses import dataclass
|
|
15
|
-
from dataclasses import field
|
|
16
|
-
from types import MappingProxyType
|
|
17
|
-
from typing import Any
|
|
18
|
-
from typing import Mapping
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@dataclass(
|
|
22
|
-
frozen=True,
|
|
23
|
-
slots=True,
|
|
24
|
-
)
|
|
25
|
-
class RuntimeValidationResult:
|
|
26
|
-
"""
|
|
27
|
-
Immutable Runtime validation result.
|
|
28
|
-
|
|
29
|
-
Ownership:
|
|
30
|
-
|
|
31
|
-
Runtime owns this representation.
|
|
32
|
-
|
|
33
|
-
Core plugins own:
|
|
34
|
-
- validation rules;
|
|
35
|
-
- semantic diagnostics;
|
|
36
|
-
- validation algorithms.
|
|
37
|
-
|
|
38
|
-
Runtime only consumes the result.
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
valid: bool
|
|
42
|
-
|
|
43
|
-
diagnostics: tuple[Any, ...] = field(
|
|
44
|
-
default_factory=tuple,
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
metadata: Mapping[str, Any] = field(
|
|
48
|
-
default_factory=lambda: MappingProxyType({}),
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
def __post_init__(
|
|
52
|
-
self,
|
|
53
|
-
) -> None:
|
|
54
|
-
"""
|
|
55
|
-
Normalize mutable inputs into immutable structures.
|
|
56
|
-
"""
|
|
57
|
-
|
|
58
|
-
object.__setattr__(
|
|
59
|
-
self,
|
|
60
|
-
"diagnostics",
|
|
61
|
-
tuple(
|
|
62
|
-
self.diagnostics,
|
|
63
|
-
),
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
object.__setattr__(
|
|
67
|
-
self,
|
|
68
|
-
"metadata",
|
|
69
|
-
MappingProxyType(
|
|
70
|
-
dict(
|
|
71
|
-
self.metadata,
|
|
72
|
-
),
|
|
73
|
-
),
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
# ------------------------------------------------------------------
|
|
77
|
-
# Properties
|
|
78
|
-
# ------------------------------------------------------------------
|
|
79
|
-
|
|
80
|
-
@property
|
|
81
|
-
def has_diagnostics(
|
|
82
|
-
self,
|
|
83
|
-
) -> bool:
|
|
84
|
-
"""
|
|
85
|
-
Whether validation produced diagnostics.
|
|
86
|
-
"""
|
|
87
|
-
|
|
88
|
-
return bool(
|
|
89
|
-
self.diagnostics,
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
@property
|
|
93
|
-
def diagnostic_count(
|
|
94
|
-
self,
|
|
95
|
-
) -> int:
|
|
96
|
-
"""
|
|
97
|
-
Number of diagnostics.
|
|
98
|
-
"""
|
|
99
|
-
|
|
100
|
-
return len(
|
|
101
|
-
self.diagnostics,
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
# ------------------------------------------------------------------
|
|
105
|
-
# Helpers
|
|
106
|
-
# ------------------------------------------------------------------
|
|
107
|
-
|
|
108
|
-
def __bool__(
|
|
109
|
-
self,
|
|
110
|
-
) -> bool:
|
|
111
|
-
"""
|
|
112
|
-
Validation truth value.
|
|
113
|
-
|
|
114
|
-
True means validation succeeded.
|
|
115
|
-
"""
|
|
116
|
-
|
|
117
|
-
return self.valid
|
|
118
|
-
|
|
119
|
-
@classmethod
|
|
120
|
-
def success(
|
|
121
|
-
cls,
|
|
122
|
-
*,
|
|
123
|
-
metadata: Mapping[str, Any] | None = None,
|
|
124
|
-
) -> RuntimeValidationResult:
|
|
125
|
-
"""
|
|
126
|
-
Construct successful validation result.
|
|
127
|
-
"""
|
|
128
|
-
|
|
129
|
-
return cls(
|
|
130
|
-
valid=True,
|
|
131
|
-
metadata=(
|
|
132
|
-
metadata
|
|
133
|
-
if metadata is not None
|
|
134
|
-
else {}
|
|
135
|
-
),
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
@classmethod
|
|
139
|
-
def failure(
|
|
140
|
-
cls,
|
|
141
|
-
diagnostics: tuple[Any, ...],
|
|
142
|
-
*,
|
|
143
|
-
metadata: Mapping[str, Any] | None = None,
|
|
144
|
-
) -> RuntimeValidationResult:
|
|
145
|
-
"""
|
|
146
|
-
Construct failed validation result.
|
|
147
|
-
"""
|
|
148
|
-
|
|
149
|
-
return cls(
|
|
150
|
-
valid=False,
|
|
151
|
-
diagnostics=diagnostics,
|
|
152
|
-
metadata=(
|
|
153
|
-
metadata
|
|
154
|
-
if metadata is not None
|
|
155
|
-
else {}
|
|
156
|
-
),
|
|
157
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cks_runtime-0.4.0 → cks_runtime-0.4.1}/cks_runtime/explainability/explainability_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|