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§
- Capability
Advert - Signed capability advertisement broadcast on the mesh-wide capability topic.
- Capability
Store - 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_SECSso 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_msto keep this module’s dependencies narrow).