mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-07-01 05:49:36 +00:00
The IMessagingClient / IKernel / IReliableChannelManager base types were inheritance-as-documentation: nothing dispatched over them and no impl ever overrode their base `method`s (the ops live in `*/api/*` as plain procs). The `method`s only returned "not implemented" at runtime and, crucially, were never checked against the real surface -- so IKernel had silently drifted from `Waku` (relayPublish returned int not string; filter/lightpush still carried a `peer` param; connectedPeersInfo returned seq[string]). Replace each base type with a structural Nim `concept` matched against the real implementation, and assert conformance once in the concentrator (`doAssert Waku is KernelApi`, etc.) where every impl and its op modules are in scope. This is zero-cost, drops the dead vtables, and makes each layer's true surface a single compiler-checked source of truth. Move `PeerConnInfo` from `waku/api/peer_manager` into `api/types` (alongside the other api-boundary data types) so `KernelApi` can name it without an import cycle -- otherwise `connectedPeersInfo` could not be part of the contract. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>