code wiki / _hdl_build / nx_siteedit_gate.nx
nx_siteedit_gate.nx
buildroot/runtime/_hdl_build/nx_siteedit_gate.nx
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
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
structs
| none |
consts
| 54 | const 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" |
| 55 | const 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" |
| 56 | const GCFG_BAD: *u8 = "title|Broken config\nheader|X|Y|#z\nsearch|/search|s\ncard|Only|Card\nfooter|F\n" |
functions
| 18 | func 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 } |
| 19 | func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 20 | func 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 } |
| 21 | func 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 |
| 22 | func 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 |
| 23 | func 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 } |
| 24 | func g_contains(hay: *u8, n: i64, needle: *u8) -> i64 |
| 29 | func g_extract_token(resp: *u8, n: i64, out: *u8) -> i64 |
| 39 | func g_file_has(path: *u8, needle: *u8) -> i64 |
| 46 | func g_file_exists(path: *u8) -> i64 |
| 52 | func 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 } |
| 58 | func main() -> i64 |