Skip to content

Commit 600f316

Browse files
committed
Refactor Rust raw service organization
1 parent 8ebcd4f commit 600f316

16 files changed

Lines changed: 2774 additions & 2793 deletions

.agents/sow/current/SOW-0014-20260603-maintainability-hotspots.md

Lines changed: 166 additions & 2 deletions
Large diffs are not rendered by default.

docs/code-organization.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ src/
5353
posix.rs # L1: UDS, SHM
5454
windows.rs # L1: Named Pipe, SHM
5555
service/ # L2/L3: typed client/server helpers
56+
raw.rs # Internal raw helper wrapper/re-exports
57+
raw/ # Shared raw infrastructure plus per-method helpers
58+
client.rs # Shared raw client lifecycle, retry, send/receive
59+
server.rs # Shared managed-server lifecycle
60+
cgroups_snapshot.rs # cgroups-snapshot raw call/dispatch
61+
cgroups_lookup.rs # cgroups-lookup raw call/dispatch
62+
apps_lookup.rs # apps-lookup raw call/dispatch
63+
cgroups_cache.rs # cgroups-snapshot Level 3 cache
5664
5765
go/pkg/netipc/ # Go library (Go package)
5866
protocol/ # Codec
@@ -155,6 +163,13 @@ Each service module should correspond to one service kind. The public
155163
L2/L3 shape must not drift into “one server exports many unrelated
156164
request kinds”.
157165

166+
Internal raw helpers may share connection lifecycle, retry policy,
167+
transport send/receive, managed server accept/session loops, and
168+
generic envelope validation. Custom typed client calls, typed handler
169+
aliases, dispatch adapters, and Level 3 cache logic for one service
170+
kind must live in service-kind-specific files so adding new service
171+
kinds does not expand a shared catch-all module.
172+
158173
Service modules must NOT contain:
159174

160175
- Transport implementation details (no direct socket/pipe/SHM code)

docs/netipc-integrator-skill.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Relevant implementation roots:
9797
- [src/go/pkg/netipc/service/apps_lookup/](../src/go/pkg/netipc/service/apps_lookup/)
9898
- Internal raw helpers used to build public typed services:
9999
- [src/crates/netipc/src/service/raw.rs](../src/crates/netipc/src/service/raw.rs)
100+
- [src/crates/netipc/src/service/raw/](../src/crates/netipc/src/service/raw/)
100101
- [src/go/pkg/netipc/service/raw/](../src/go/pkg/netipc/service/raw/)
101102

102103
Important current limitation:
@@ -805,11 +806,16 @@ Once the codec exists:
805806
- add typed raw client call support
806807
- add typed dispatch support on the server side
807808
- add envelope validation for the new method code
809+
- in Rust, put dedicated typed raw call and dispatch adapter code in a
810+
service/method-specific file under `src/crates/netipc/src/service/raw/`;
811+
keep shared retry, transport send/receive, and managed-server
812+
infrastructure in shared raw files
808813

809814
Patterns to mirror:
810815

811816
- Rust raw client/server:
812817
- [src/crates/netipc/src/service/raw.rs](../src/crates/netipc/src/service/raw.rs)
818+
- [src/crates/netipc/src/service/raw/](../src/crates/netipc/src/service/raw/)
813819
- Go raw client/server:
814820
- [src/go/pkg/netipc/service/raw/](../src/go/pkg/netipc/service/raw/)
815821
- C managed server / typed call path:

0 commit comments

Comments
 (0)