code wiki / _hdl_build / nx_health_eval.nx
nx_health_eval.nx
buildroot/runtime/_hdl_build/nx_health_eval.nx
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
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
structs
| none |
consts
| 18 | const HE_MAGIC_8445: i64 = 8445 |
| 19 | const HE_MAGIC_2048: i64 = 2048 |
| 20 | const HE_MAGIC_4096: i64 = 4096 |
| 21 | const HE_MAGIC_8443: i64 = 8443 |
| 22 | const HE_MAGIC_999999: i64 = 999999 |
| 23 | const HE_MAGIC_65536: i64 = 65536 |
| 24 | const HE_MAGIC_1000000000: i64 = 1000000000 |
| 25 | const HE_MAGIC_4194304: i64 = 4194304 |
| 28 | const HE_CAP: i64 = 262144 |
| 31 | const HE_HEALTH_OUT: *u8 = "sites/nishifamily/health.json" |
| 156 | const HE_QOE_LOG: *u8 = "/volume1/homes/elderwesto/nishihost/room_telemetry.log" |
| 157 | const HE_QOE_MIN_FPS: i64 = 8 // below ~8fps conversational video reads as a slideshow (field-cited 2026-07-05) |
| 158 | const HE_QOE_FRESH_S: i64 = 3600 // only judge calls from the last hour; older = informational |
| 390 | const HE_HUB_PORT: i64 = 18792 |
functions
| 33 | func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 34 | func hn(v: i64) -> i64 |
| 38 | func he_has(hay: *u8, n: i64, needle: *u8) -> i64 |
| 48 | func he_get_lo(host: *u8, host_len: i64, path: *u8, path_len: i64, store: *TrustStore, now: i64, |
| 68 | func he_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 72 | func he_check(name: *u8, path: *u8, marker: *u8, is_js: i64, store: *TrustStore, now: i64, |
| 111 | func he_fetch_one(path: *u8, store: *TrustStore, now: i64, out: *u8, cap: i64) -> i64 |
| 127 | func he_ui_check(store: *TrustStore, now: i64, jout: *u8, joff: *i64) -> i64 |
| 161 | func he_qi(buf: *u8, from: i64, to: i64, key: *u8) -> i64 |
| 175 | func he_wn(dst: *u8, off: *i64, v: i64) -> i64 |
| 181 | func 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 } |
| 185 | func he_flow_row(name: *u8, ok: i64, why: *u8, jout: *u8, joff: *i64) -> i64 |
| 203 | func he_qoe_check(now: i64, jout: *u8, joff: *i64) -> i64 |
| 324 | func he_relay_join(path: *u8, plen: i64, rq: *u8, rs: *u8) -> i64 |
| 338 | func he_relay_probe(jout: *u8, joff: *i64) -> i64 |
| 391 | func he_hub_probe(jout: *u8, joff: *i64) -> i64 |
| 426 | func he_csp_canary(store: *TrustStore, now: i64, jout: *u8, joff: *i64) -> i64 |
| 457 | func he_pass(store: *TrustStore, total_out: *i64) -> i64 |
| 499 | func main(argc: i64, argv: *i64) -> i64 |