Skip to content

feat(core): cut the mcp bridge over to WireMeshTransport via createBridgeMesh - #58

Merged
Mearman merged 2 commits into
mainfrom
feat/p2-cut-mcp-bridge
Sep 11, 2026
Merged

feat(core): cut the mcp bridge over to WireMeshTransport via createBridgeMesh#58
Mearman merged 2 commits into
mainfrom
feat/p2-cut-mcp-bridge

Conversation

@Mearman

@Mearman Mearman commented Sep 11, 2026

Copy link
Copy Markdown
Member

Part of #47 (step 4 of P2's sequencing plan): cuts one bridge (mcp) over to the new WireMeshTransport substrate end to end, as the first real consumer before the remaining five bridges migrate.

  • createBridgeMesh(slot, coordinatorPort?): shared factory wrapping identity load, MeshStore construction, and WireMeshTransport wiring, replacing the inline TlsTransport-based block the mcp bridge previously built by hand. peerId is now deviceIdToHex(identity.deviceId) rather than the certificate fingerprint.
  • src/bridges/mcp/index.ts uses the new factory instead of constructing MeshStore/TlsTransport inline.
  • New bridge-mesh.test.ts covers peerId derivation, store.connected after init(), and two createBridgeMesh instances sharing a coordinatorPort seeing each other's registered agents.

Also included, discovered and fixed while working this branch: the project's test script ran node --test against a hardcoded list of compiled dist/test/*.js files, requiring a manual pnpm build first and manual list maintenance per new test file. It also silently excluded federation.integration.test.ts and visibility.integration.test.ts from CI, since neither test:federation nor test:visibility (the only scripts that ran them) was ever part of CI's test job. Switched test to tsx --test against a src/test/**/*.test.ts glob (resolves .js-suffixed imports to .ts siblings, no build step needed), which folds federation/visibility coverage into the suite CI runs and removes the now-redundant scripts. delivery-receipt.runner.ts's own helper spawn now targets the .ts source via node --import tsx for the same reason.

All 92 tests pass via the new pnpm test (up from 74 previously covered, now also including federation and visibility).

…idgeMesh

Add createBridgeMesh(slot, coordinatorPort?), a shared factory wrapping identity
load, MeshStore construction, and WireMeshTransport wiring in one call,
replacing the inline TlsTransport-based block the mcp bridge previously built
by hand. peerId is derived from deviceIdToHex(identity.deviceId) rather than
the certificate fingerprint, matching the substrate swap's canonical
device-id identity.

The mcp bridge is the first of six bridges to move onto the new substrate,
proving createBridgeMesh end to end before the remaining bridges migrate.
…ild step

The test script ran node --test against a hardcoded list of ~20 dist/test/*.js
paths, requiring a manual pnpm build before every run and manual list
maintenance on every new test file. It also silently excluded
federation.integration.test.ts and visibility.integration.test.ts from CI:
their coverage lived only in test:federation/test:visibility, neither of
which CI's test job ever invoked.

Switch test to tsx --test against a src/test/**/*.test.ts glob, which
resolves .js-suffixed imports to their .ts siblings and needs no compiled
output. This picks up every *.test.ts file automatically, folding federation
and visibility coverage into the suite CI actually runs, and removes the
now-redundant test:federation/test:visibility scripts entirely.

delivery-receipt.runner.ts spawned its own helper as a compiled dist/*.js
file via plain node; point it at the .ts source instead and spawn via
`node --import tsx` so it runs without a build step too.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 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-11T18:33:19.081541Z b3e0156 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 merged commit 198c9e4 into main Sep 11, 2026
5 checks passed
@Mearman
Mearman deleted the feat/p2-cut-mcp-bridge branch September 11, 2026 18:33
@github-actions

Copy link
Copy Markdown

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