code wiki / (root) / nx_funcheck.nx

nx_funcheck.nx

buildroot/runtime/nx_funcheck.nx

25291 B385 linesdepth 21pulls 157 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_artifact_root.nx nx_itoa_lib.nx nx_connect.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_tls13_client_validate_certifica nx_tls13_client_session_run.nx nx_https_url_for_fetch.nx nx_https_url_connect.nx nx_funcheck.nx

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

main nx_trust_store_load_from_c sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal fc_puts sys_write ↻ fc_putn nxi_out

structs

none

consts

28const FC_MAGIC_4096: i64 = 4096
29const FC_MAGIC_65536: i64 = 65536
30const FC_MAGIC_16645: i64 = 16645
31const FC_MAGIC_2592000: i64 = 2592000
32const FC_MAGIC_10368000: i64 = 10368000
33const FC_MAGIC_34560000: i64 = 34560000
34const FC_MAGIC_4194304: i64 = 4194304
35const FC_MAGIC_1024: i64 = 1024
36const FC_MAGIC_8192: i64 = 8192
42const FC_TIMEOUT_S: i64 = 15

functions

43func 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 }
called by 2: fc_onemain calls 1: sys_write
48func fc_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 2: fc_onemain calls 1: nxi_out
49func fc_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: fc_containsfc_one
50func 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
51func fc_contains(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: fc_one calls 1: fc_strlen
56func 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
57func fc_split_pipe(b: *u8, ls: i64, le: i64, offs: *i64, lens: *i64, maxf: i64) -> i64
called by 1: main
62func 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
65func 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
66func fcl_appn(b: *u8, n: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
76func fc_ws_probe(s: *Tls13ClientSession, fd: i64, host: *u8, hlen: i64, path: *u8, plen: i64) -> i64
124func fc_diag_expiry(store: *TrustStore, url: *u8, back_seconds: i64) -> i64
149func fc_hdr_location(buf: *u8, n: i64, out: *u8) -> i64
called by 1: fc_one
176func fc_parse_ip(s: *u8) -> i64
called by 1: fc_one
193func fc_connect_explicit(packed: i64, port: i64, fd_p: *i64) -> i64
206func fc_one(store: *TrustStore, name: *u8, method: *u8, url: *u8, path: *u8, expect: *u8, body: *u8, tmo_s: i64, connect_ip: *u8) -> i64
315func main() -> i64