code wiki / _hdl_build / nx_invite_token_gate.nx
nx_invite_token_gate.nx
buildroot/runtime/_hdl_build/nx_invite_token_gate.nx
about
nx_invite_token_gate.nx -- SOVEREIGN in-process referee for the invite-token store organ.
Drives inv_issue / inv_check / inv_consume against a fresh /tmp store and asserts the FULL
lifecycle plus every reject path with real negative controls (no fabricated greens):
T1 issue -> check returns the issued level (valid token works)
T2 NEG expired: a token valid NOW returns 0 once now_s passes its expiry
T3 NEG single-use: check ok -> consume -> re-check returns 0
T4 NEG wrong-realm: a token issued for realm A returns 0 under realm B (and != 0 under A)
T5 NEG unknown/garbage token never issued -> 0
T6 independence: two distinct issues; consuming one does NOT void the other
GREEN iff 6/6 + sys_exit(0). license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_invite_token.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
| 14 | 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 } |
| 15 | func g_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd >= 0 { sys_close(fd) } return 0 } |
| 16 | func g_num(v: i64) -> i64 |
| 24 | func g_res(name: *u8, ok: i64) -> i64 { g_w(" " as *u8); g_w(name); if ok == 1 { g_w(": PASS\n" as *u8) } else { g_w(": FAIL\n" as *u8) } return ok } |
| 26 | func main() -> i64 |