feat(core)!: retire federation.ts in favour of wire-mesh's own connectToRemote - #144
Merged
Merged
Conversation
…tToRemote federation.ts (674 lines) was a fully separate, parallel transport stack: its own TLS sockets, its own X.509 certificate-fingerprint trust model, and its own hand-rolled fed_* wire framing over wire-protocol.ts's legacy newline-delimited JSON -- none of it routed through WireMeshTransport at all. It predates the wire-mesh substrate migration and was never updated to use it. The cross-machine connection problem federation.ts solved for itself is already solved generically: connectToRemote/acceptConnection/ rejectConnection (already wired through WireMeshTransport, already human-approval-gated per connection) reach a peer on any host, not just localhost. The one thing federation.ts additionally provided -- scoping which rooms/agents cross a mesh boundary via Room.federated and a pre-declared trust allowlist -- has no replacement here: this is a full retirement, not a swap, and any two meshes that connect via connectToRemote now become one shared mesh, matching how agent_upsert/ room_upsert were already confirmed to be genuinely mesh-wide by design (agent-comms#48) rather than needing a narrower audience. Removes FederationManager, FederationBridge, Room.federated, the nine mesh_fed_* tool actions and their MeshOnlyFeatures methods, and the fed_* MeshMessage wire-protocol variants those actions' own wire framing used. deliverRoomMessageToMember, added in the previous PR specifically for FederationBridge's own onRoomMessage, is removed as dead code along with its only caller.
Mearman
marked this pull request as ready for review
September 16, 2026 05:33
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #51.
federation.ts(674 lines) was a fully separate, parallel transport stack -- its own TLS sockets (tls.connect/tls.createServer), its own X.509 certificate-fingerprint trust model (the sameidentity.ts/certificate machinery the wire-mesh migration otherwise retired), and its own hand-rolledfed_*wire framing ridingwire-protocol.ts's legacy newline-delimited JSON. None of it routed throughWireMeshTransportat all -- it predates the wire-mesh substrate migration (agent-comms#47) and was simply never updated onto the new transport.Investigated whether the cross-machine problem federation.ts solved for itself is already solved generically, and it is:
connectToRemote/acceptConnection/rejectConnection(already wired throughWireMeshTransport, already human-approval-gated per connection, already reachable viamesh_connect/mesh_accept/mesh_reject) connect to a peer on any host, not just localhost -- the exact transport problem federation.ts's own TLS link layer existed to solve.What federation.ts additionally provided beyond raw connectivity -- scoping which rooms/agents cross a mesh boundary via
Room.federatedand a pre-declared trust allowlist -- has no replacement here. This is a full retirement, not a swap: once this lands, any two meshes that connect viaconnectToRemotebecome one shared mesh with no isolation between them. This is consistent with the finding that closed agent-comms#48 --agent_upsert/room_upsertare genuinely mesh-wide by design (any connected peer can legitimately see any agent/room), not events needing a narrower, federation-scoped audience.What's removed
FederationManager,FederationBridge, and their own test filesRoom.federatedand every branch reading itmesh_fed_*tool actions (connect/disconnect/links/fingerprint/trust/untrust/trusted/listen/stop_listening) and theirMeshOnlyFeaturesmethodsfed_*MeshMessagewire-protocol variants those actions' own framing used (never dispatched throughWireMeshTransportin the first place)deliverRoomMessageToMember, added in the immediately preceding PR specifically forFederationBridge's ownonRoomMessage-- removed as dead code along with its only caller, since that caller no longer existsidentity.tsis untouched: its certificate/keypair generation is still genuinely load-bearing for the current wire-mesh identity flow (identity-store.ts,wire-mesh-identity.ts), not federation-only.Marked as a breaking change (
feat!:) since it removes public package exports (FederationManager,FedLink,FedCallbacksfromindex.ts) and nine tool actions.Test plan
pnpm typecheckpnpm lintpnpm test(767/767)pnpm build