refactor(runtime-host): extract Peer Mesh control message codecs - #5006
Open
Totoro-qaq wants to merge 1 commit into
Open
refactor(runtime-host): extract Peer Mesh control message codecs#5006Totoro-qaq wants to merge 1 commit into
Totoro-qaq wants to merge 1 commit into
Conversation
Move control-message types, decoders and their validation helpers into a package-internal module. Share the evidence page limit with node while preserving framing, admission, lifecycle and existing signed-record checks. Keep the extracted declarations and public node declarations equivalent. Add codec boundary tests and retain the original Peer Mesh integration suite. Refs: apache#4726 Generated-by: Codex
Contributor
Author
|
@Astro-Han Could you take a look when you have a chance? This extracts the Peer Mesh control message codecs into |
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.
Summary
Separate Peer Mesh control-message types and object decoding from node lifecycle orchestration. The internal codec owns the five decoder entry points and their bounds, while node retains stream framing, timeouts, connection admission and state changes. Existing signed-record decoders are reused, and pagination and decoding share one evidence-page limit.
peer-mesh/node.tsshrinks from 3,103 to 2,835 lines. The new codec is 317 lines, so aggregate production code increases by 49 lines for module headers/imports. The result is an independently testable boundary in a large module, not a net deletion or performance improvement. Public package exports and wire formats are unchanged.Fixes #5005
Refs #4726, A9.
Verification
Local macOS verification with Node 24.18.0 and npm 11.19.0:
Not run: other workspace test suites, a Windows execution matrix, or a multi-host native Peer Mesh deployment. The existing Peer Mesh integration tests use their original in-memory transport and real cryptographic helpers.
AI use
Tool(s) and scope: Codex inspected the existing seam, extracted the implementation, added boundary tests, ran local equivalence and regression checks, and prepared these drafts. DSH performed a separate read-only source review and ran the codec tests. Submitted with contributor approval; upstream review is pending.
Checklist
Does this PR entail a change in behavior?