wip(k1): checkpoint connection recovery rewrite

Capture the current unreleased K1 connection, recovery, lifecycle, viewer, and test work as a single known-bad baseline for subsequent fixes.
This commit is contained in:
DCCONSTRUCTIONS
2026-08-14 14:57:50 +03:00
parent aff331082f
commit 0ca7316a24
157 changed files with 152962 additions and 4036 deletions
+15 -6
View File
@@ -68,6 +68,19 @@ class PluginActionNotFoundError(LookupError):
class PluginExecutionError(RuntimeError):
"""A validated plugin action failed while talking to its device/runtime."""
def __init__(
self,
message: str,
*,
http_status_code: int = 502,
reason_code: str | None = None,
) -> None:
super().__init__(message)
if not 400 <= http_status_code <= 599:
raise ValueError("plugin execution HTTP status must be an error response")
self.http_status_code = http_status_code
self.reason_code = reason_code
class PluginRuntimeCompatibilityError(RuntimeError):
"""A plugin runtime cannot satisfy the reviewed manifest/host contract."""
@@ -124,9 +137,7 @@ class InProcessDevicePluginRuntime:
raise PluginRuntimeCompatibilityError(
"Runtime does not support the manifest host API version"
)
if frozenset(request.required_action_ids) != frozenset(
self.descriptor.action_ids
):
if frozenset(request.required_action_ids) != frozenset(self.descriptor.action_ids):
raise PluginRuntimeCompatibilityError(
"Runtime handshake actions do not match the manifest"
)
@@ -225,9 +236,7 @@ class DevicePluginDispatcher:
@property
def health_snapshots(self) -> dict[str, RuntimeHealthSnapshot]:
return {
plugin_id: runtime.health() for plugin_id, runtime in self._runtimes.items()
}
return {plugin_id: runtime.health() for plugin_id, runtime in self._runtimes.items()}
async def invoke(
self,