code wiki / _hdl_build / nx_cms_gate.nx

nx_cms_gate.nx

buildroot/runtime/_hdl_build/nx_cms_gate.nx

15292 B357 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind gate/prooftopic cms
docsdependenciesstructsconstsfunctions

about

nx_cms_gate.nx -- THE CMS ARC GATE (re-runnable, evidence-driven): boots the real admin daemon on loopback, then plays the LEGAL-TEAM USER + THE ATTACKER over real HTTP with its own client (no curl, no .sh): unauth surfaces refused, login lockout-guarded, CSRF enforced, stored-XSS sanitized on write, edit->publish live, revision rollback restores the prior publish. These are the spec's acceptance criteria (2026-06-06-sovereign-cms-architecture.md) mechanized. Appends a CMSGATE line to knowledge/status/cms_gate.log. Exit 0 iff permil=1000. license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_cms_store.nx nx_connect.nx nx_sha256.nx nx_syscalls.nx nx_kill_portable.nx nx_cms_gate.nx

imports: nx_cms_store.nxnx_connect.nxnx_sha256.nxnx_syscalls.nxnx_kill_portable.nx

imported by: nobody (leaf or entry point)

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

main cg_mkdir sys_mmap cst_copy sys_openat_rd sys_openat_wr sys_close sys_mmap ↻ sys_read sys_write sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻ sys_openat_wr ↻ sys_write ↻ sys_close ↻ sys_fork sys_dup3 sys_execve sys_exit sys_wait4 sys_openat_rd ↻ cg_w sys_write ↻ cg_get cg_cat cg_catn

structs

none

consts

13const CG_PORT: i64 = 8077
14const CG_SITE: *u8 = "/tmp/_cms_gate_site"

functions

16func cg_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: cg_rowmain calls 1: sys_write
17func cg_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: cg_indexcg_post
18func cg_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 3: cg_postcg_getmain
24func cg_catn(dst: *u8, off: i64, s: *u8, n: i64) -> i64
called by 3: cg_postcg_getmain
30func cg_index(hay: *u8, n: i64, needle: *u8) -> i64
called by 2: cg_hasmain calls 1: cg_len
42func cg_has(hay: *u8, n: i64, needle: *u8) -> i64 { if cg_index(hay, n, needle) >= 0 { return 1 } return 0 }
called by 1: main calls 1: cg_index
45func cg_http(req: *u8, rl: i64, resp: *u8, cap: i64) -> i64
80func cg_post(req: *u8, path: *u8, cookie: *u8, body: *u8) -> i64
called by 1: main calls 4: cg_catcg_catncg_lensys_mmap
103func cg_get(req: *u8, path: *u8, cookie: *u8) -> i64
called by 1: main calls 2: cg_catcg_catn
116func cg_row(id: i64, ok: i64, what: *u8) -> i64
called by 1: main calls 2: cg_wsys_mmap
128func cg_mkdir(path: *u8, mode: i64) -> i64
called by 1: main calls 1: sys_mmap
134func main() -> i64