Add onboarding architecture doc for knet/icmp interaction#241
Merged
Add onboarding architecture doc for knet/icmp interaction#241
Conversation
Documents how the knet (packet parsing/serialization) and icmp (raw socket pings + ICMP packet types) libraries fit into the four kanonproxy modules, with a data-flow diagram and a per-module touchpoint summary to help new contributors orient themselves. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The README previously claimed there were four modules but only described core. Expanded the Modules section to cover server, client, and android with their entry points, and fixed the broken tests link (the path was missing the core/ module prefix). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an onboarding-focused architecture document describing how knet parsing/serialization and the icmp library’s ping functionality are integrated across client/, server/, core/, and android.
Changes:
- Added
docs/architecture.mdwith a packet round-trip ASCII flow diagram across modules. - Documented responsibility boundaries between
knet(packet structures/serialization) andicmp(platform ICMP echo emission). - Listed key wiring/touchpoints (e.g.,
KAnonProxy,ProxyServer,ProxyClient,Session.handleExceptionOnRemoteChannel).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #241 +/- ##
============================================
+ Coverage 60.38% 61.44% +1.06%
- Complexity 226 231 +5
============================================
Files 15 15
Lines 2070 2070
Branches 315 315
============================================
+ Hits 1250 1272 +22
+ Misses 643 626 -17
+ Partials 177 172 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The previous wording implied only ICMP involved outbound sockets, which is wrong - kanonproxy opens TCP and UDP sockets itself. Reworded to make clear that ICMP is the exception because it needs privileged raw-socket access, which is delegated to the icmp library. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a simpler top-level view showing the relationship between the three repos (knet, icmp, kanonproxy) before the detailed per-module data-flow diagram, so readers can orient themselves at a glance before diving into the packet path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds packetdumper as a third external repo alongside knet and icmp in the high-level diagram, threads its dumpBuffer hooks through the data- flow diagram for client/ and server/, adds three rows to the library responsibility table, and notes its wiring in ProxyServer / ProxyClient / KAnonVpnService. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GitHub renders Mermaid blocks natively, so the high-level repo diagram and the per-module data-flow diagram now display as proper graphs instead of monospace ASCII art. Content is preserved (libraries, types they expose, dumpBuffer hooks, ICMP delegation, error path through knet:IcmpFactory). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous pastel fills (#eef, #efe) rendered with washed-out gray text on GitHub's dark theme, making nodes hard to read. Replaced with saturated fills (blue for libs/internal nodes, green for kanonproxy modules, orange for external lib endpoints, gray for I/O endpoints) and explicit white text via the color: attribute, which works identically in both light and dark theme. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Puts kanonproxy at the top and reverses the arrows so they read "kanonproxy uses X", which matches the actual dependency direction. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Restructures the per-module Mermaid diagram so core sits at the top and server / client sit side-by-side beneath it (wrapped in an invisible LR subgraph to force horizontal pairing). Edge directions were flipped accordingly to push core to the top rank in dagre layout; added a note that arrow direction here describes layout, not data flow (every edge is bidirectional in practice). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
docs/architecture.mdaimed at new contributors onboarding to the repoclient/,server/, andcore/KAnonProxyconstructor,ProxyServer,ProxyClient,Session.handleExceptionOnRemoteChannel)Test plan
docs/architecture.mdon GitHub and confirm the ASCII diagram and table display correctlyKAnonProxy.kt,ProxyServer.kt,ProxyClient.kt,Session.kt)🤖 Generated with Claude Code