code wiki / _hdl_build / nx_mgmt_api_gate.nx
nx_mgmt_api_gate.nx
buildroot/runtime/_hdl_build/nx_mgmt_api_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 20 | func 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 } |
| 21 | func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 22 | func g_row(name: *u8, ok: i64) -> i64 |
| 29 | func 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 |
| 30 | func 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 |
| 31 | func 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 |
| 32 | func g_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd >= 0 { sys_close(fd) } return 0 } |
| 33 | func g_log(s: *u8) -> i64 |
| 38 | func g_write_file(path: *u8, s: *u8) -> i64 |
| 45 | func g_starts(buf: *u8, n: i64, s: *u8) -> i64 |
| 52 | func g_contains(hay: *u8, n: i64, needle: *u8) -> i64 |
| 64 | func g_extract_token(resp: *u8, n: i64, out: *u8) -> i64 called by 1: main |
| 88 | func main() -> i64 |