code wiki / (root) / nx_sov_endpoint.nx

nx_sov_endpoint.nx

buildroot/runtime/nx_sov_endpoint.nx

5397 B153 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic sov
docsdependenciesstructsconstsfunctions

about

nx_sov_endpoint.nx -- the ONE place that knows how to reach our own edge. WHY THIS EXISTS. Every caller that talks to the sovereign edge has been hand-writing its own endpoint: `https://nishifamily.com`, or the loopback connect-override `127.0.0.1:8443`, or a bare `:443`. The working answer has been carried between sessions as folklore -- "use 127.0.0.1:8443 for our own domains" -- which is a workaround living in prose, not a fix living in code. When :443 degrades, every one of those call sites fails independently and each one has to be rediscovered by hand. MEASURED 2026-07-31, not recalled. From this laptop, against the live host: :8443 sovereign client 5/5 OK raw TCP 20/20 TLS1.3, LE cert :443 sovereign client 0/5 OK raw TCP 18/20 flaps between serving our real cert and actively refusing The flap is a listener that is NOT one of ours -- `nx_hostctl status` lists no sovereign service on :443 -- so we cannot supervise it and must not depend on it. :8443 is sites.elf, ours, and was stable across every probe. THE RULE THIS ENCODES: 8443 before 443, loopback before the wire. It is policy plus a reason, in data, so that a future edit that reorders these has to confront the measurement rather than quietly restore the folklore. The note string is not decoration -- the gate requires every endpoint to carry one, so the policy cannot be changed silently. This module is deliberately PURE: ordering and URL construction only, no sockets. A resolver that probed the network could not be gated offline, and an ungated resolver on the path to every fetch is worse than folklore. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_sov_endpoint.nx nx_sov_endpoint_gate.nx

imports: nx_syscalls.nx

imported by: nx_sov_endpoint_gate.nx

structs

none

consts

33const NX_MAGIC_8443: i64 = 8443
35const NX_SOV_N_ENDPOINT: i64 = 3

functions

38func nx_sov_endpoint_host(i: i64) -> *u8
called by 1: main
45func nx_sov_endpoint_port(i: i64) -> i64
called by 1: main
53func nx_sov_endpoint_note(i: i64) -> *u8
called by 1: main
63func nx_sov_endpoint_is_loopback(i: i64) -> i64
called by 1: main
72func nx_sov_port_is_degraded(port: i64) -> i64
called by 1: main
77func nx_sov_len(s: *u8) -> i64
called by 1: main
84func nx_sov_put(out: *u8, off: i64, s: *u8) -> i64
called by 1: nx_sov_endpoint_url
97func nx_sov_put_num(out: *u8, off: i64, v: i64) -> i64
calls 1: sys_mmap
125func nx_sov_endpoint_url(i: i64, out: *u8) -> i64
called by 1: main calls 1: nx_sov_put
138func nx_sov_endpoint_preferred(out: *u8) -> i64
144func nx_sov_endpoint_preferred_remote(out: *u8) -> i64