nx_funcheck.nx
buildroot/runtime/nx_funcheck.nx
about
nx_funcheck.nx -- SOVEREIGN FUNCTIONAL HEALTH MONITOR (synthetic-transaction checks). Operator 2026-06-29:
"build capabilities so we never manually debug -- focus on getting sites up and KEEPING them up." This is the
VALIDATION half of the reliability loop: it drives the REAL user flows (homepage, gallery login page, the
gallery/video AUTH POST, wiki, torrent) over the sovereign TLS1.3 client and reports PASS/FAIL per check,
distinguishing the THREE failure modes a status-code check is blind to:
CONN-FAIL : TCP connect failed -> backend down / unreachable (= the browser's "Failed to fetch")
NO-RESPONSE: connected+TLS ok, no HTTP reply -> proxy hang / reset (= the browser's "Failed to fetch")
EXPECT-MISS: HTTP reply, but the expected content signature is absent (= a 404/500 served as 200, etc.)
Data-driven: each check is a row in knowledge/hosting/funcchecks.conf (name|method|url|path|expect|body). Add a
flow = add a row. Reused by deploy-gating (block/rollback a deploy that breaks a flow) + the keep-up loop
(FAIL -> auto-heal: reconcile/restart/rollback). Exit 0 iff ALL flows pass. license_tier: ORIGINAL
dependencies 14 imports · 0 importers
diagram shows first 10 each side; +4 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_artifact_root.nxnx_itoa_lib.nxnx_connect.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_https_get_complete.nxnx_https_post_complete.nxnx_websocket_client_upgrade.nxnx_https_fetch_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 28 | const FC_MAGIC_4096: i64 = 4096 |
| 29 | const FC_MAGIC_65536: i64 = 65536 |
| 30 | const FC_MAGIC_16645: i64 = 16645 |
| 31 | const FC_MAGIC_2592000: i64 = 2592000 |
| 32 | const FC_MAGIC_10368000: i64 = 10368000 |
| 33 | const FC_MAGIC_34560000: i64 = 34560000 |
| 34 | const FC_MAGIC_4194304: i64 = 4194304 |
| 35 | const FC_MAGIC_1024: i64 = 1024 |
| 36 | const FC_MAGIC_8192: i64 = 8192 |
| 42 | const FC_TIMEOUT_S: i64 = 15 |
functions
| 43 | func fc_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 48 | func fc_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 49 | func fc_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 50 | func fc_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } called by 1: main |
| 51 | func fc_contains(hay: *u8, n: i64, needle: *u8) -> i64 |
| 56 | func fc_eol(b: *u8, n: i64, st: i64) -> i64 { var i: i64=st; while i<n { if (b[i] as i64)==10 {return i} i=i+1 } return n } called by 1: main |
| 57 | func fc_split_pipe(b: *u8, ls: i64, le: i64, offs: *i64, lens: *i64, maxf: i64) -> i64 called by 1: main |
| 62 | func fc_copyz(dst: *u8, src: *u8, off: i64, len: i64) -> i64 { var i: i64=0; while i<len{dst[i]=src[off+i];i=i+1} dst[len]=0 as u8; return len } called by 1: main |
| 65 | func fcl_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: main |
| 66 | func fcl_appn(b: *u8, n: i64, v: i64) -> i64 |
| 76 | func fc_ws_probe(s: *Tls13ClientSession, fd: i64, host: *u8, hlen: i64, path: *u8, plen: i64) -> i64 |
| 124 | func fc_diag_expiry(store: *TrustStore, url: *u8, back_seconds: i64) -> i64 |
| 149 | func fc_hdr_location(buf: *u8, n: i64, out: *u8) -> i64 called by 1: fc_one |
| 176 | func fc_parse_ip(s: *u8) -> i64 called by 1: fc_one |
| 193 | func fc_connect_explicit(packed: i64, port: i64, fd_p: *i64) -> i64 |
| 206 | func fc_one(store: *TrustStore, name: *u8, method: *u8, url: *u8, path: *u8, expect: *u8, body: *u8, tmo_s: i64, connect_ip: *u8) -> i64 |
| 315 | func main() -> i64 |