land feat/runtime/networkcontroller (707efa1e18) #139

Merged
gitea_admin merged 2 commits from feat/runtime/networkcontroller into staging 2026-07-03 14:33:44 +00:00
Contributor
No description provided.
W10: a standalone NetworkController for NETWORK_CONFIG_REQUEST/reply.
Holds an in-memory nwid -> NetworkConfig registry (setNetwork/removeNetwork;
existence in the map is the entire MVP authorization model, no
certificate/allowlist infra exists yet). handleConfigRequest(nwid,
requester identity, request packet id, now) looks the network up and
returns an OWNED Reply: OK(NETWORK_CONFIG_REQUEST) carrying a
dictionary-encoded NetworkConfig when found, ERROR(OBJ_NOT_FOUND)
when not. handleRawConfigRequest wraps it for the untrusted-bytes
entrypoint (decodes a raw NETWORK_CONFIG_REQUEST payload via the
existing configrequest.zig decoder first).

Round-trip KATs prove the reply decodes correctly through the existing
okheader.zig/errorpacket.zig/networkconfig.zig/dictionary.zig decoders.
Does not touch node.zig's live dispatch (separate, later item) --
independently testable, ready to be wired in.

Wires the pre-allocated root.zig slot so these tests run in this
branch's own CI build.

Process note: encodeConfigOk/encodeNotFoundError were first stubbed to
return empty bytes, and `zig build test` was confirmed red locally
(1236 passed, 4 failed -- exactly the round-trip/not-found/raw-request/
registry-key tests). The repo's pre-commit hook runs the full
`zig build test` gate on every commit (mirroring CI), so that red
state could not be persisted as its own commit without bypassing
hooks; test and implementation land together here instead, verified
green (zig build test, zig build, zig fmt --check all pass).
handleRawConfigRequest decodes an untrusted, off-the-wire
NETWORK_CONFIG_REQUEST payload (via configrequest.zig) before looking
it up, so it needs its own fuzz target per CLAUDE.md's decoder rule.
Registered as networkcontroller-decode, grouped next to
configrequest-decode (the decoder it wraps) rather than appended to
the file. 100k+ iterations smoke-clean, no crashes.

Does not touch the fuzz/receivepath slot (a different, later item).
gitea_admin deleted branch feat/runtime/networkcontroller 2026-07-03 14:33:44 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/zerotea!139
No description provided.