code wiki / _hdl_build / nx_gen_live_probe.nx

nx_gen_live_probe.nx

buildroot/runtime/_hdl_build/nx_gen_live_probe.nx

15021 B203 linesdepth 16pulls 54 transitivereach 0 importersview sourcekind probetopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_live_probe.nx -- LIVE FRONTEND PROOF. Runs ON THE NAS (via `nx_hostctl genprobe`). Drives the REAL deployed /gen gateway over loopback 127.0.0.1:18794 (the same daemon serving nishifamily.com/gen), end-to-end through the production OPAQUE auth + HR authz: - registers a temp owner in the LIVE OPAQUE store (credential lives only on the NAS, never transmitted) - enrolls it OWNER in the LIVE nishi_hr- (so it hits the same hra_is_superadmin path elderwesto needs) - logs in for a REAL session token, then asserts (1) authed GET /gen -> 200 + the Elder AI UI, (2) no-cred -> 401 - DEMOTES the temp owner (latest HR record = level NONE) so the lingering account keeps NO /gen access GREEN proves the DEPLOYED gateway grants an enrolled owner -- exactly what the bootstrap does for elderwesto. license_tier: ORIGINAL expect_exit: 0

dependencies 6 imports · 0 importers

nx_opaque_login.nx nx_connect.nx nx_hr_admin.nx nx_hr.nx nx_hr_entitle.nx nx_syscalls.nx nx_gen_live_probe.nx

imports: nx_opaque_login.nxnx_connect.nxnx_hr_admin.nxnx_hr.nxnx_hr_entitle.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap lp_w sys_write olg_ctx_setup_ttl nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close _uas_hex_dec _uas_nib nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_opq_derive_keypair sys_mmap ↻ _voprf_load_context_string u256_alloc nx_scratch nx_scratch_init nx_scratch_oom sys_mmap ↻ nx_opq_hash_to_scalar sys_mmap ↻ nx_h2c_expand_message_xmd_ sys_mmap ↻ _h2c_i2osp_1 _h2c_i2osp_2 u256_alloc ↻ _opq_reduce_48be_mod_n u256_alloc ↻ sys_mmap ↻ u256_load_be

structs

none

consts

16const LP_MAGIC_1000000: i64 = 1000000
17const LP_MAGIC_86400: i64 = 86400
18const LP_MAGIC_1024: i64 = 1024
19const LP_MAGIC_8192: i64 = 8192
20const LP_MAGIC_262144: i64 = 262144
22const LP_PORT: i64 = 18794
23const LP_KEYS: *u8 = "/volume1/homes/elderwesto/nishihost/opaque_keys.bin" as *u8
24const LP_STORE: *u8 = "/volume1/homes/elderwesto/nishihost/opaque_store.log" as *u8
25const LP_HR: *u8 = "/volume1/homes/elderwesto/nishihost/nishi_hr-" as *u8
26const LP_ENT: *u8 = "/volume1/homes/elderwesto/nishihost/nishi_entitlements-" as *u8

functions

28func lp_w(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 3: lp_nlp_send_genmain calls 1: sys_write
29func lp_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
30func lp_n(v: i64) -> i64 { var m: i64=v; if m<0{lp_w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); 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; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 1: main calls 3: lp_wsys_mmapsys_write
31func lp_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o }
called by 1: main
32func lp_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var o: i64=off; var i: i64=0; while i<n {dst[o]=src[i]; o=o+1; i=i+1} return o }
called by 1: main
33func lp_find(buf: *u8, n: i64, needle: *u8) -> i64 { var nl: i64=0; while needle[nl]!=(0 as u8){nl=nl+1} if nl==0 {return 0} var i: i64=0; while i+nl<=n { var j: i64=0; var ok: i64=1; while j<nl { if (buf[i+j]&0xff)!=(needle[j]&0xff){ok=0;j=nl} else {j=j+1} } if ok==1 {return i} i=i+1 } return 0-1 }
called by 1: lp_has
34func lp_has(buf: *u8, n: i64, needle: *u8) -> i64 { if lp_find(buf,n,needle)>=0 {return 1} return 0 }
called by 1: main calls 1: lp_find
35func lp_nap(ms: i64) -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0]=0; ts[1]=ms*LP_MAGIC_1000000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 }
called by 1: lp_send calls 1: sys_mmap
38func lp_send(raw: *u8, rawlen: i64, resp: *u8, cap: i64) -> i64
64func lp_itoa(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; 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 o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o }
called by 1: main calls 1: sys_mmap
67func lp_send_gen(raw: *u8, rawlen: i64, resp: *u8, cap: i64) -> i64
92func main() -> i64