code wiki / _hdl_build / nx_mgmt_api_gate.nx

nx_mgmt_api_gate.nx

buildroot/runtime/_hdl_build/nx_mgmt_api_gate.nx

18802 B330 linesdepth 18pulls 72 transitivereach 0 importersview sourcekind gate/prooftopic mgmt
docsdependenciesstructsconstsfunctions

about

nx_mgmt_api_gate.nx -- SOVEREIGN in-process referee for the ecosystem control-plane API. NO socket, NO curl, NO shell: arms a realm + registers an admin via the real Modern Auth, writes snapshot FIXTURES via syscalls, then feeds crafted HTTP request BYTES straight into the pure router ma_handle and asserts the response bytes. Proves the "true monitoring, no false +/-" property mechanically: T1 GET /api -> 200 + route index (public) T2 POST /api/login (correct) -> 200 + {"token":...} (mint no-cookie session) T3 GET /api/health (degraded) +tok -> 200 DEGRADED + dueling-supervisors + crash-loop (no false-GREEN) T4 GET /api/health NO tok -> 401 (infra state default-deny) T5 GET /api/services(degraded) +tok -> 200 + the down/loop svc + "dup":1 (per-svc truth) T6 POST /api/deploy NO tok -> 401 (privileged route GUARDED) T7 POST /api/deploy +tok -> 501 (route reserved; honest, not faked) T8 GET /api/health (healthy) +tok -> 200 + overall OK (no false-RED) T9 GET /api/bogus -> 404 T10 GET /api/health (MISSING snap) +tok -> 200 + UNKNOWN + no-snapshot (no false-GREEN on absent data) GREEN iff T1..T10 hold. Sovereign: nx_mgmt_api + nx_modern_auth_flow + nx_syscalls. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_mgmt_api.nx nx_modern_auth_flow.nx nx_syscalls.nx nx_mgmt_api_gate.nx

imports: nx_mgmt_api.nxnx_modern_auth_flow.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 g_w sys_write g_trunc sys_openat_wr sys_close g_write_file sys_openat_wr ↻ sys_write ↻ g_len sys_close ↻ sys_exit sys_mmap 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 sys_mmap ↻ nx_scratch_oom sys_write ↻ sys_exit ↻ sys_mmap ↻

structs

none

consts

none

functions

20func g_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 2: g_rowmain calls 1: sys_write
21func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
22func g_row(name: *u8, ok: i64) -> i64
called by 1: main calls 1: g_w
29func g_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o + i] = s[i]; i = i + 1 } return o + i }
called by 1: main
30func g_find(hay: *u8, hn: i64, ndl: *u8) -> i64 { var nl: i64=0; while ndl[nl]!=(0 as u8){nl=nl+1} if nl==0 { return 0-1 } var s: i64=0; while s+nl<=hn { var m: i64=1; var k: i64=0; while k<nl { if hay[s+k]!=ndl[k] { m=0; k=nl } else { k=k+1 } } if m==1 { return s } s=s+1 } return 0-1 }
called by 1: main
31func g_cat_n(d: *u8, o: i64, s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { d[o + i] = s[i]; i = i + 1 } return o + n }
called by 1: main
32func g_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd >= 0 { sys_close(fd) } return 0 }
called by 1: main calls 2: sys_openat_wrsys_close
33func g_log(s: *u8) -> i64
38func g_write_file(path: *u8, s: *u8) -> i64
45func g_starts(buf: *u8, n: i64, s: *u8) -> i64
called by 1: main calls 1: g_len
52func g_contains(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: g_len
64func g_extract_token(resp: *u8, n: i64, out: *u8) -> i64
called by 1: main
88func main() -> i64