Skip to main content

Module dm_capability

Module dm_capability 

Source
Expand description

Mesh-wide DM capability advertisement + cache. Senders consult this store to decide whether to use the gossip DM path or fall back to raw-QUIC for a given recipient. Mesh-wide DM-capability advertisement — so senders can discover which peers support the gossip DM inbox path without needing an explicit AgentCard exchange.

This is complementary to the AgentCard.dm_capabilities field:

  • AgentCards are the authoritative record (signed+authenticated when exchanged via invite links / card imports).
  • The capability advert is the mesh-wide “I’m here and I support v1” broadcast that VPS bootstrap nodes and other mesh members use to discover each other’s DM support without ever exchanging cards.

Design trade-offs:

  • Advert is signed by the sender’s ML-DSA-65 agent key so receivers verify authenticity before caching.
  • Cached entries have a TTL (15 minutes) so stale adverts don’t persist forever; senders republish every 5 minutes during normal operation.
  • This is NOT a presence system — it’s strictly capability discovery. Presence + liveness continue to be handled by saorsa-gossip-presence.

Structs§

CapabilityAdvert
Signed capability advertisement broadcast on the mesh-wide capability topic.
CapabilityStore
In-memory cache of AgentId → latest CapabilityAdvert, with TTL eviction.

Constants§

ADVERT_CACHE_TTL_SECS
How long a cached advert remains usable before it’s considered stale. Must be > ADVERT_PUBLISH_INTERVAL_SECS so that a single missed publish window doesn’t evict the cache entry.
ADVERT_PUBLISH_INTERVAL_SECS
Cadence at which agents republish their advert.
DM_CAPABILITY_TOPIC
Well-known gossip topic for capability adverts. Every x0x 0.18+ agent subscribes on mesh join.

Functions§

now_unix_ms
Current unix-ms (convenience mirror of dm::now_unix_ms to keep this module’s dependencies narrow).