code wiki / (root) / nx_transport_policy.nx

nx_transport_policy.nx

buildroot/runtime/nx_transport_policy.nx

5171 B102 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic transport
docsdependenciesstructsconstsfunctions

about

nx_transport_policy.nx -- TIERED TRANSPORT policy for the comms stack (lib, no main). Operator 2026-07-02: "the most s class exceed june 2026 capability with the worse ones as skilled fallbacks in case of issues and flagging of the failure on the top of the line so they can auto heal." THE LADDER (best first; each lower tier is a proven, skilled fallback -- rule 14 graceful degradation): TIER 1 QUIC/WebTransport datagrams + core RS-FEC + L4S-aware (June-2026 frontier; needs the sovereign HTTP/3+QUIC server -- the registered frontier build) TIER 2 multi-socket striped WSS + core RS-FEC (k=8,m=2 across legs; one leg's TCP stall becomes a recoverable erasure -- the measured intl-h2h win, buildable now) TIER 3 single WSS/TCP (today's LIVE path -- proven, survives everything, worst intl behavior) CONTRACT (what the client core + daemon both follow): - always run the HIGHEST tier the measured capabilities allow (tp_best) - a tier must fail CONSECUTIVELY (threshold, default 3) before falling back -- skilled, not flappy - EVERY transition (fail-down or heal-up) EMITS A FLAG LINE (tp_flag) -> the status log the keep-up/heal loop consumes; a silent fallback is a doctrine violation the gate kills - fallback is never final: tp_should_retry_upgrade opens a heal window (exponential backoff, 30s..600s cap) to probe the higher tier again -- the AUTO-HEAL path back to top-of-line license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_transport_policy.nx nx_transport_policy_gate.nx

imports: nx_syscalls.nx

imported by: nx_transport_policy_gate.nx

structs

none

consts

22const TP_TIER_TOP: i64 = 1
23const TP_TIER_STRIPED: i64 = 2
24const TP_TIER_SINGLE: i64 = 3
25const TP_FAIL_THRESHOLD: i64 = 3
26const TP_BACKOFF_MIN_S: i64 = 30
27const TP_BACKOFF_CAP_S: i64 = 600

functions

30func tp_best(caps: i64) -> i64
called by 1: main
39func tp_on_failure(tier: i64, now_s: i64, st: *i64) -> i64
called by 1: main
51func tp_on_success(st: *i64) -> i64 { st[0] = 0; return 0 }
called by 1: main
54func tp_should_retry_upgrade(tier: i64, now_s: i64, st: *i64) -> i64
called by 1: main
62func tp_on_upgrade(tier: i64, st: *i64) -> i64
called by 1: main
70func tp_apps(b: *u8, n: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){b[n+i]=s[i];i=i+1} return n+i }
called by 1: tp_flag
71func tp_appn(b: *u8, n: i64, v: i64) -> i64
called by 1: tp_flag calls 1: sys_mmap
77func tp_flag(buf: *u8, now_s: i64, from_tier: i64, to_tier: i64, event: i64) -> i64
called by 2: tp_flag_emitmain calls 2: tp_appstp_appn
94func tp_flag_emit(now_s: i64, from_tier: i64, to_tier: i64, event: i64) -> i64