Skip to content

feat(core)!: retire federation.ts in favour of wire-mesh's own connectToRemote - #144

Merged
Mearman merged 1 commit into
mainfrom
feat/retire-federation
Sep 16, 2026
Merged

Mearman merged 1 commit into
mainfrom
feat/retire-federation

Conversation

@Mearman

@Mearman Mearman commented Sep 16, 2026

Copy link
Copy Markdown
Member

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 same identity.ts/certificate machinery the wire-mesh migration otherwise retired), and its own hand-rolled fed_* wire framing riding wire-protocol.ts's legacy newline-delimited JSON. None of it routed through WireMeshTransport at 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 through WireMeshTransport, already human-approval-gated per connection, already reachable via mesh_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.federated and 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 via connectToRemote become one shared mesh with no isolation between them. This is consistent with the finding that closed agent-comms#48 -- agent_upsert/room_upsert are 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 files
  • Room.federated and every branch reading it
  • The nine mesh_fed_* tool actions (connect/disconnect/links/fingerprint/trust/untrust/trusted/listen/stop_listening) and their MeshOnlyFeatures methods
  • The fed_* MeshMessage wire-protocol variants those actions' own framing used (never dispatched through WireMeshTransport in the first place)
  • deliverRoomMessageToMember, added in the immediately preceding PR specifically for FederationBridge's own onRoomMessage -- removed as dead code along with its only caller, since that caller no longer exists

identity.ts is 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, FedCallbacks from index.ts) and nine tool actions.

Test plan

  • pnpm typecheck
  • pnpm lint
  • pnpm test (767/767)
  • pnpm build

…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
Mearman marked this pull request as ready for review September 16, 2026 05:33
@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-16T05:45:36.499587Z 460c955 Draft marked ready
ℹ️ 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 merged commit 4232b08 into main Sep 16, 2026
6 checks passed
@Mearman
Mearman deleted the feat/retire-federation branch September 16, 2026 05:46
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.0.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