code wiki / (root) / nx_app_monitor.nx

nx_app_monitor.nx

buildroot/runtime/nx_app_monitor.nx

6879 B133 linesdepth 21pulls 130 transitivereach 0 importersview sourcekind orphan librarytopic app
docsdependenciesstructsconstsfunctions

about

nx_app_monitor.nx -- S-class sovereign health monitor for the Nishi web apps. Data-driven: reads web_assets/app_registry.tsv (the single source of truth), and for EVERY registered app does a real HTTPS GET through the Nishi TLS-1.3 client + Mozilla CA chain (no curl), asserting 200 + the app's content marker. This is the watchdog that was missing when sites.elf silently crash-looped. Prints an up/down table; exits 0 iff every app is UP (so it doubles as a gate / cron check). license_tier: ORIGINAL

dependencies 11 imports · 0 importers

nx_syscalls.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_https_get.nx nx_https_get_complete.nx nx_http_response_parse.nx nx_app_monitor.nx

diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.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.nxnx_https_get_complete.nxnx_http_response_parse.nxnx_app_store.nx

imported by: nobody (leaf or entry point)

structs

none

consts

19const K_MAGIC_2097152: i64 = 2097152
20const K_MAGIC_4194304: i64 = 4194304
21const K_MAGIC_65536: i64 = 65536
22const K_MAGIC_8192: i64 = 8192

functions

24func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
calls 1: sys_write
25func wn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=(48 as u8);k=1}; while m>0{t[k]=((48+(m%10)) as u8);m=m/10;k=k+1}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 }
26func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: contains
27func contains(buf: *u8, lo: i64, hi: i64, needle: *u8) -> i64
calls 1: slen
34func field(buf: *u8, ls: i64, le: i64, fi: i64, out: *u8) -> i64
44func check_one(store: *TrustStore, path: *u8, pathlen: i64, marker: *u8, mk: *i64) -> i64
calls 1: sys_mmap
81func main() -> i64