Skip to content

feat(core): aggregate a mesh-wide known-devices view from gossip - #130

Merged
Mearman merged 1 commit into
mainfrom
feat/gossip-directory-aggregation
Sep 16, 2026
Merged

Mearman merged 1 commit into
mainfrom
feat/gossip-directory-aggregation

Conversation

@Mearman

@Mearman Mearman commented Sep 16, 2026

Copy link
Copy Markdown
Member

Adds WireMeshTransport.listKnownDevices(), merging every live session's own peer-advert directory into one device-id-keyed map (newest advert wins by snapshot-seconds). Entries persist across disconnect rather than being cleared, so a device's last-known advert stays queryable while its session is momentarily down.

This is the aggregation primitive #48's own P3.8 room-discovery investigation and #49's presence work both identified as missing: agent-registry.ts's listAgents still reads only the legacy CRDT-replicated agents Map, and #48's own issue body concluded room-discovery needs the identical prerequisite before it can gossip a room/hosted extension the same way presence/status already does. Building it once here, as its own foundational piece, rather than duplicating an aggregation inside each consumer.

Not wired into agent-registry.ts or room-lifecycle.ts yet -- that's each its own follow-up (per #48's own issue body: neither is a quick removal, each needs its own design pass). This PR is scoped to the transport-level primitive and its own direct tests only.

Refs #48, #49.

WireMeshTransport.listKnownDevices() merges every live session's own
peer-advert directory into one device-id-keyed map, keeping the newer
advert (by snapshot-seconds) whenever a device is already known. This
is the prerequisite the P3.8 room-discovery design and the eventual
agent register/update/offline retirement both need: a way to read
every device this side has ever heard gossip from, with its full
advert (addresses and any open-extension field such as
presence/status), rather than only the peer directly reachable
through one session.

Entries are never cleared on disconnect, so a device's last-known
advert stays queryable while its session is momentarily down, matching
how the legacy agents Map keeps a record after setAgentOffline rather
than deleting it outright.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-16T01:06:03.511273Z fcb2a3d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman Mearman mentioned this pull request Sep 16, 2026
@Mearman
Mearman merged commit a8c3749 into main Sep 16, 2026
6 checks passed
@Mearman
Mearman deleted the feat/gossip-directory-aggregation branch September 16, 2026 01:06
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant