code wiki / _hdl_build / nx_health_eval.nx

nx_health_eval.nx

buildroot/runtime/_hdl_build/nx_health_eval.nx

36698 B565 linesdepth 21pulls 136 transitivereach 0 importersview sourcekind tooltopic health
docsdependenciesstructsconstsfunctions

about

nx_health_eval.nx -- SOVEREIGN continuous M&E evaluator (operator 2026-07-04: "we have no monitoring and evaluation ... fire and pray for all our tools ... same with web hosting" + "use the apis not awsudo/shell"). Probes the WHOLE live hosting+video surface using the sovereign nx_https_get primitive (TLS-1.3, own trust store -- NO curl, NO awsudo, NO shell), checks each flow's real content (200 + marker; a JS asset MUST NOT be text/html = the "app.js 404 -> Unexpected token <" class), rolls up a single health verdict, writes a served health.json, AND records the pass-count to the metric ledger so every run reports a BETTER/WORSE trend. Designed to run continuously (hostctl-supervised, the sovereign supervisor -- not a shell cron) + register in the tools API. This converts "fire and pray" into measured-every-run. expect_exit: 0 when all critical flows pass. license_tier: ORIGINAL

dependencies 8 imports · 0 importers

nx_https_get.nx nx_connect.nx nx_trust_store_load_from_certdata. nx_metric_ledger.nx nx_ui_checks.nx nx_websocket_client_upgrade.nx nx_websocket_stream.nx nx_websocket_frame.nx nx_health_eval.nx

imports: nx_https_get.nxnx_connect.nxnx_trust_store_load_from_certdata.nxnx_metric_ledger.nxnx_ui_checks.nxnx_websocket_client_upgrade.nxnx_websocket_stream.nxnx_websocket_frame.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main hw nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read 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 trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻ x509_read_alg_id sys_mmap ↻

structs

none

consts

18const HE_MAGIC_8445: i64 = 8445
19const HE_MAGIC_2048: i64 = 2048
20const HE_MAGIC_4096: i64 = 4096
21const HE_MAGIC_8443: i64 = 8443
22const HE_MAGIC_999999: i64 = 999999
23const HE_MAGIC_65536: i64 = 65536
24const HE_MAGIC_1000000000: i64 = 1000000000
25const HE_MAGIC_4194304: i64 = 4194304
28const HE_CAP: i64 = 262144
31const HE_HEALTH_OUT: *u8 = "sites/nishifamily/health.json"
156const HE_QOE_LOG: *u8 = "/volume1/homes/elderwesto/nishihost/room_telemetry.log"
157const HE_QOE_MIN_FPS: i64 = 8 // below ~8fps conversational video reads as a slideshow (field-cited 2026-07-05)
158const HE_QOE_FRESH_S: i64 = 3600 // only judge calls from the last hour; older = informational
390const HE_HUB_PORT: i64 = 18792

functions

33func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
34func hn(v: i64) -> i64
called by 2: he_passmain
38func he_has(hay: *u8, n: i64, needle: *u8) -> i64
48func he_get_lo(host: *u8, host_len: i64, path: *u8, path_len: i64, store: *TrustStore, now: i64,
68func he_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
72func he_check(name: *u8, path: *u8, marker: *u8, is_js: i64, store: *TrustStore, now: i64,
called by 1: he_pass calls 2: he_get_lohe_slen
111func he_fetch_one(path: *u8, store: *TrustStore, now: i64, out: *u8, cap: i64) -> i64
127func he_ui_check(store: *TrustStore, now: i64, jout: *u8, joff: *i64) -> i64
161func he_qi(buf: *u8, from: i64, to: i64, key: *u8) -> i64
175func he_wn(dst: *u8, off: *i64, v: i64) -> i64
181func he_ws2(dst: *u8, off: *i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8) { dst[off[0]]=s[i]; off[0]=off[0]+1; i=i+1 } return 0 }
185func he_flow_row(name: *u8, ok: i64, why: *u8, jout: *u8, joff: *i64) -> i64
203func he_qoe_check(now: i64, jout: *u8, joff: *i64) -> i64
324func he_relay_join(path: *u8, plen: i64, rq: *u8, rs: *u8) -> i64
338func he_relay_probe(jout: *u8, joff: *i64) -> i64
391func he_hub_probe(jout: *u8, joff: *i64) -> i64
426func he_csp_canary(store: *TrustStore, now: i64, jout: *u8, joff: *i64) -> i64
457func he_pass(store: *TrustStore, total_out: *i64) -> i64
499func main(argc: i64, argv: *i64) -> i64