code wiki / _hdl_build / nx_cms_gate.nx

nx_cms_gate.nx

buildroot/runtime/_hdl_build/nx_cms_gate.nx

17470 B385 linesdepth 5pulls 10 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 6 imports · 0 importers

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

imports: nx_cms_store.nxnx_connect.nxnx_sha256.nxnx_syscalls.nxnx_gate_verdict.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 nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ 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_seed_allocated 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 ↻

structs

none

consts

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

functions

17func 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
18func 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
19func cg_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 3: cg_postcg_getmain
25func cg_catn(dst: *u8, off: i64, s: *u8, n: i64) -> i64
called by 3: cg_postcg_getmain
31func cg_index(hay: *u8, n: i64, needle: *u8) -> i64
called by 2: cg_hasmain calls 1: cg_len
43func 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
46func cg_http(req: *u8, rl: i64, resp: *u8, cap: i64) -> i64
81func cg_post(req: *u8, path: *u8, cookie: *u8, body: *u8) -> i64
called by 1: main calls 4: cg_catcg_catncg_lensys_mmap
104func cg_get(req: *u8, path: *u8, cookie: *u8) -> i64
called by 1: main calls 2: cg_catcg_catn
117func cg_row(id: i64, ok: i64, what: *u8) -> i64
called by 1: main calls 2: cg_wsys_mmap
129func cg_mkdir(path: *u8, mode: i64) -> i64
called by 1: main calls 1: sys_mmap
135func main() -> i64