code wiki / _hdl_build / nx_siteedit_gate.nx

nx_siteedit_gate.nx

buildroot/runtime/_hdl_build/nx_siteedit_gate.nx

13298 B195 linesdepth 18pulls 54 transitivereach 0 importersview sourcekind gate/prooftopic siteedit
docsdependenciesstructsconstsfunctions

about

nx_siteedit_gate.nx -- SOVEREIGN in-process referee for the admin.<d>/site SITE-VISUALS editor. Arms a fresh Modern-Auth realm, seeds a real .site blueprint, then drives the pure router sed_handle with crafted HTTP bytes and asserts response bytes AND filesystem side effects: T1 GET /site -> 200 editor shell T2 NEG /site/config no session -> 401 T3 authed GET /site/config -> 200 + the seeded blueprint bytes T4 authed POST /site/save (edited hero marker) -> 200 SAVED + config updated + a .v version kept T5 NEG save with hero| MISSING -> 400 REFUSED + live config UNCHANGED (marker still present) T6 authed POST /site/preview -> preview/index.html EXISTS + carries the edited marker T7 authed POST /site/publish -> docroot index.html + practice page + sitemap exist w/ marker, .prev-index.html backup exists (the pre-publish homepage) T8 NEG publish with NO session -> 401 and the docroot index keeps T7's content (untouched) GREEN iff 8/8. Appends knowledge/status/siteedit_gate.log. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_siteedit_daemon.nx nx_modern_auth_flow.nx nx_syscalls.nx nx_siteedit_gate.nx

imports: nx_siteedit_daemon.nxnx_modern_auth_flow.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main g_w sys_write sys_openat_wr sys_close sys_mkdir sys_write ↻ g_len sys_mmap nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ _uas_hex_dec _uas_nib nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_opq_derive_keypair sys_mmap ↻ _voprf_load_context_string u256_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write ↻ sys_exit sys_mmap ↻ nx_opq_hash_to_scalar sys_mmap ↻ nx_h2c_expand_message_xmd_ sys_mmap ↻

structs

none

consts

54const GCFG_BASE: *u8 = "title|Andelin West -- Utah Attorneys\nheader|Andelin West|Free consultation|#consult\nhero|Straightforward legal help.|Talk to a Utah attorney.|Start now|#consult\nsearch|/search|Search...\ncards|How we help\ncard|Family Law|Divorce and custody handled with care.\ncard|Estate Planning|Wills and trusts done right.\nstep|Tell us what happened.\nsig|Licensed by the Utah State Bar\nfooter|Andelin West, PLLC -- Utah\n"
55const GCFG_EDIT: *u8 = "title|Andelin West -- Utah Attorneys\nheader|Andelin West|Free consultation|#consult\nhero|glacierheadline legal help for Utah.|Talk to a Utah attorney.|Start now|#consult\nsearch|/search|Search...\ncards|How we help\ncard|Family Law|Divorce and custody handled with care.\ncard|Estate Planning|Wills and trusts done right.\nstep|Tell us what happened.\nsig|Licensed by the Utah State Bar\nfooter|Andelin West, PLLC -- Utah\n"
56const GCFG_BAD: *u8 = "title|Broken config\nheader|X|Y|#z\nsearch|/search|s\ncard|Only|Card\nfooter|F\n"

functions

18func 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 }
called by 2: g_verdictmain calls 1: sys_write
19func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
20func g_lw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
21func g_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o + i] = s[i]; i = i + 1 } return o + i }
called by 1: main
22func g_cat_n(d: *u8, o: i64, s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { d[o + i] = s[i]; i = i + 1 } return o + n }
called by 1: main
23func g_starts(buf: *u8, n: i64, s: *u8) -> i64 { let sn: i64 = g_len(s); if n < sn { return 0 } var i: i64 = 0; while i < sn { if (buf[i] as i64) != (s[i] as i64) { return 0 } i = i + 1 } return 1 }
called by 1: main calls 1: g_len
24func g_contains(hay: *u8, n: i64, needle: *u8) -> i64
called by 2: g_file_hasmain calls 1: g_len
29func g_extract_token(resp: *u8, n: i64, out: *u8) -> i64
39func g_file_has(path: *u8, needle: *u8) -> i64
46func g_file_exists(path: *u8) -> i64
called by 1: main calls 2: sys_openat_rdsys_close
52func g_verdict(label: *u8, ok: i64) -> i64 { g_w(" " as *u8); g_w(label); if ok == 1 { g_w(" PASS\n" as *u8) } else { g_w(" FAIL\n" as *u8) } return ok }
called by 1: main calls 1: g_w
58func main() -> i64