Skip to content

feat: add wire-mesh's device-id derivation to PeerIdentity - #55

Merged
Mearman merged 1 commit into
mainfrom
feat/p2-identity-swap
Sep 11, 2026
Merged

feat: add wire-mesh's device-id derivation to PeerIdentity#55
Mearman merged 1 commit into
mainfrom
feat/p2-identity-swap

Conversation

@Mearman

@Mearman Mearman commented Sep 11, 2026

Copy link
Copy Markdown
Member

Part of #47 (P2: substrate swap). Step 2 of the phase's own sequencing plan -- see the P2 design pass.

wire-mesh's identity model keys a peer on SHA-256 of its raw public-key bytes, never a certificate's DER encoding -- the exact instability this project's own certificate-fingerprint peerId already has (identity-store.ts's own renewal-near-expiry logic mints a fresh fingerprint, and therefore a fresh agent id, well before the underlying key actually changes). Migrating onto wire-mesh's transport needs this value available before anything can cut peerId over to it.

Purely additive: PeerIdentity.deviceId is derived alongside the existing certificate/fingerprint in both generateIdentity() and the persisted-identity reload path, but nothing reads it yet -- MeshStore.peerId still comes from fingerprint, and the existing TlsTransport keeps working entirely unchanged. The certificate-building code is untouched; it continues to wrap the same keypair deviceId is now also derived from.

Test plan

  • New tests: deviceId matches an independently-derived SHA-256 of the raw public key; two fresh identities get different deviceIds
  • Full existing suite (66 tests) plus federation/delivery/visibility all still pass unmodified

wire-mesh's own identity model keys a peer on SHA-256 of its raw
public-key bytes, never a certificate's DER encoding — the exact
instability this project's own certificate-fingerprint peerId
already has (identity-store.ts's own renewal-near-expiry logic mints
a fresh fingerprint, and therefore a fresh agent id, well before the
underlying key actually changes). Migrating agent-comms onto
wire-mesh's transport needs this value available before anything
can switch peerId over to it.

Purely additive: PeerIdentity.deviceId is derived alongside the
existing certificate/fingerprint in both generateIdentity() and the
persisted-identity reload path, but nothing reads it yet.
MeshStore.peerId still comes from fingerprint. The
certificate-building code is unchanged; it continues to wrap the
same keypair deviceId is derived from.
@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-11T17:35:43.273874Z ed507c4 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 8d1c8de into main Sep 11, 2026
5 checks passed
@Mearman
Mearman deleted the feat/p2-identity-swap branch September 11, 2026 17:32
@github-actions

Copy link
Copy Markdown

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