code wiki / _hdl_build / nx_home_registry_gate.nx

nx_home_registry_gate.nx

buildroot/runtime/_hdl_build/nx_home_registry_gate.nx

7559 B98 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic home
docsdependenciesstructsconstsfunctions

about

nx_home_registry_gate.nx -- SOVEREIGN proof of nx_home H1 data-driven registry (#11). Writes a TSV registry of CUSTOM devices, forks /tmp/nx_home.sov.elf pointed at it, and proves over a loopback socket (no python/shell) that the server loaded the FILE's devices -- not the embedded defaults: R1 custom devices present (office/garage/porch) R2 custom names loaded (Garage Light) R3 data-driven, NOT embedded (no living_room) R4 exactly 3 devices (count ids) R5 command works on a loaded device (garage on:1, bri:50) R6 unknown device -> structured error Then POST /home/shutdown. GREEN iff 6/6. Requires /tmp/nx_home.sov.elf. knowledge/status/nx_home_registry_gate.log. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_gate_emit_lib.nx nx_home_registry_gate.nx

imports: nx_syscalls.nxnx_connect.nxnx_gate_emit_lib.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write write_reg sys_mmap g_cat tab nl sys_openat_wr sys_write ↻ sys_close sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap ↻ sys_execve sys_exit http_req sys_mmap ↻ g_sockaddr sys_socket nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_close ↻ sys_write ↻ sys_read g_strlen sys_wait4 g_contains g_strlen ↻ g_check g_puts ↻ g_count g_strlen ↻ g_num sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

13func g_num(v: i64) -> i64 { let bb: *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{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
14func g_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
15func g_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; 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{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
16func g_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
17func g_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[off+i]=s[i]; i=i+1 } return off+i }
called by 1: write_reg
18func g_contains(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: g_strlen
24func g_count(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: g_strlen
30func g_sockaddr(buf: *u8, port: i64, a: i64, b: i64, c: i64, d: i64) -> i64
called by 1: http_req
35func http_req(port: i64, req: *u8, reqlen: i64, resp: *u8, cap: i64) -> i64
47func tab(b: *u8, o: i64) -> i64 { b[o]=9 as u8; return o+1 }
called by 1: write_reg
48func nl(b: *u8, o: i64) -> i64 { b[o]=10 as u8; return o+1 }
called by 1: write_reg
49func write_reg(path: *u8) -> i64
57func main() -> i64