code wiki / _hdl_build / nx_cms_snapshot_gate.nx

nx_cms_snapshot_gate.nx

buildroot/runtime/_hdl_build/nx_cms_snapshot_gate.nx

13285 B279 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind gate/prooftopic cms
docsdependenciesstructsconstsfunctions

about

nx_cms_snapshot_gate.nx -- CMS W4 GATE (re-runnable, evidence-driven): SNAPSHOT/RESTORE (the UpdraftPlus class). Proves at the wire: take a snapshot of the published baseline, change the live content, then RESTORE -> the live page returns to the BYTE-EXACT baseline (not the change); the snapshot is downloadable + carries the archive magic; restore is session+CSRF guarded. Appends "CMSGATE row=nx_cms_snapshot ... verdict=PASS|FAIL". Exit 0 iff all rows pass. 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_snapshot_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 ks_mkdir sys_mmap cst_copy sys_openat_rd sys_openat_wr sys_close sys_mmap ↻ sys_read sys_write sys_renameat 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 ↻ ks_writefile sys_openat_wr ↻ sys_write ↻ sys_close ↻ sys_fork sys_openat_wr ↻ sys_dup3 sys_execve sys_exit sys_wait4 sys_openat_rd ↻ ks_w sys_write ↻

structs

none

consts

12const KS_PORT: i64 = 8091
13const KS_SITE: *u8 = "/tmp/_cms_snap_site"

functions

15func ks_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: ks_rowmain calls 1: sys_write
16func ks_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: ks_indexks_post
17func ks_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var k: i64=0; while s[k]!=(0 as u8){dst[o]=s[k];o=o+1;k=k+1} return o }
called by 3: ks_postks_getmain
18func ks_catn(dst: *u8, off: i64, s: *u8, n: i64) -> i64 { var o: i64=off; var k: i64=0; while k<n{dst[o]=s[k];o=o+1;k=k+1} return o }
called by 3: ks_postks_getmain
19func ks_index(hay: *u8, n: i64, needle: *u8) -> i64
called by 2: ks_hasmain calls 1: ks_len
31func ks_has(hay: *u8, n: i64, needle: *u8) -> i64 { if ks_index(hay, n, needle) >= 0 { return 1 } return 0 }
called by 1: main calls 1: ks_index
32func ks_http(req: *u8, rl: i64, resp: *u8, cap: i64) -> i64
53func ks_post(req: *u8, path: *u8, cookie: *u8, body: *u8) -> i64
called by 1: main calls 4: ks_catks_catnks_lensys_mmap
71func ks_get(req: *u8, path: *u8, cookie: *u8) -> i64
called by 1: main calls 2: ks_catks_catn
79func ks_row(id: i64, ok: i64, what: *u8) -> i64
called by 1: main calls 2: ks_wsys_mmap
88func ks_mkdir(path: *u8, mode: i64) -> i64 { let nb: *i64 = sys_mmap(8) as *i64; nb[0] = 258; return __syscall(nb[0], 0 - 100, path, mode, 0, 0, 0) }
called by 1: main calls 1: sys_mmap
89func ks_writefile(path: *u8, buf: *u8, n: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd < 0 { return 0 } sys_write(fd, buf, n); sys_close(fd); return 1 }
91func main() -> i64