code wiki / _hdl_build / nx_cms_analytics_gate.nx
nx_cms_analytics_gate.nx
buildroot/runtime/_hdl_build/nx_cms_analytics_gate.nx
about
nx_cms_analytics_gate.nx -- CMS W5 GATE (re-runnable, evidence-driven): FIRST-PARTY ANALYTICS
(the Site Kit / Jetpack class, minus the third-party beacon). Proves: each public page view is
counted server-side; counts are exact; counts SURVIVE a daemon restart (additive, file-backed);
/admin/stats is session-only and shows the count; the served page carries NO third-party analytics
beacon (first-party by construction). Appends "CMSGATE row=nx_cms_analytics ... verdict=PASS|FAIL".
Exit 0 iff all rows pass. license_tier: ORIGINAL
dependencies 5 imports · 0 importers
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
structs
| none |
consts
| 13 | const AN_PORT: i64 = 8089 |
| 14 | const AN_SITE: *u8 = "/tmp/_cms_an_site" |
functions
| 16 | func an_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 17 | func an_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 18 | func an_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 } |
| 19 | func an_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 } |
| 20 | func an_index(hay: *u8, n: i64, needle: *u8) -> i64 |
| 32 | func an_has(hay: *u8, n: i64, needle: *u8) -> i64 { if an_index(hay, n, needle) >= 0 { return 1 } return 0 } |
| 34 | func an_http(req: *u8, rl: i64, resp: *u8, cap: i64) -> i64 called by 2: an_waitmain calls 7: sys_socketsys_mmapnx_connect_boundedsys_closesys_writesys_set_socket_timeout+1 |
| 55 | func an_post(req: *u8, path: *u8, cookie: *u8, body: *u8) -> i64 |
| 73 | func an_get(req: *u8, path: *u8, cookie: *u8) -> i64 |
| 81 | func an_row(id: i64, ok: i64, what: *u8) -> i64 |
| 90 | func an_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) } |
| 91 | func an_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 } |
| 98 | func an_admin_path() -> *u8 |
| 105 | func an_boot(site: *u8, logp: *u8) -> i64 |
| 123 | func an_wait(req: *u8, resp: *u8) -> i64 |
| 135 | func main() -> i64 |