Phase 1: Cluster-Fundament – Nachrichten, Registry, Paarung, Discovery

- hms_cluster: ClusterMessage (§6.5: Pflichtfelder, Sequenzen, Revisionen,
  execute_at, Trace-ID), CommandTracker (idempotent, vorwärts-only:
  accepted->armed->executed/failed)
- NodeRegistry: online/degraded/stale/offline über Schwellen, UI-Kategorien
  discovered/paired/unknown/incompatible/offline, Doppel-Node-ID blockiert,
  IP-Wechsel erhaelt node_id (§6.3, §6.5)
- Pairing: PIN (TTL 120s, Versuchslimit), Fingerprint (SHA-256 gruppiert),
  Token nur als Hash, Scopes read/control/content_sync/admin, Ablauf +
  sofortiger Widerruf (§6.3, §27.1, ADR-0010)
- Discovery-Modell: _hmsmedia._tcp.local. TXT ohne Secrets, Capability-
  Digest, persistente manuelle Fallback-Liste (ADR-0009)
- ADR-0009 (mDNS + Fallback) und ADR-0010 (Paarung) dokumentiert
- 25 Unit-Tests; Gesamtsuite 183 Tests gruen, Ruff gruen
This commit is contained in:
HMS MediaEngine Agent
2026-09-11 01:06:26 +02:00
parent 80dc10de22
commit c4574927fd
14 changed files with 1190 additions and 14 deletions
+54
View File
@@ -0,0 +1,54 @@
"""hms_cluster Clusterprotokoll, Node-Registry, Paarung, Discovery
(PLAN.md §6.3, §6.5; ADR-0009, ADR-0010)."""
from hms_cluster.discovery import (
DISCOVERY_PROTOCOL_VERSION,
SERVICE_TYPE,
ManualNodeList,
ServiceInfo,
capability_digest,
)
from hms_cluster.message import ClusterMessage, CommandStatus, CommandTracker
from hms_cluster.pairing import (
PairingPin,
PairingStore,
Scope,
generate_pin,
hash_token,
identity_fingerprint,
new_token,
pin_valid,
)
from hms_cluster.registry import (
DuplicateNodeError,
HealthThresholds,
NodeCategory,
NodeEntry,
NodeHealth,
NodeRegistry,
)
__all__ = [
"SERVICE_TYPE",
"DISCOVERY_PROTOCOL_VERSION",
"ServiceInfo",
"ManualNodeList",
"capability_digest",
"ClusterMessage",
"CommandStatus",
"CommandTracker",
"PairingPin",
"PairingStore",
"Scope",
"generate_pin",
"pin_valid",
"identity_fingerprint",
"new_token",
"hash_token",
"DuplicateNodeError",
"HealthThresholds",
"NodeCategory",
"NodeEntry",
"NodeHealth",
"NodeRegistry",
]