code wiki / _hdl_build / nx_ui_audit.nx

nx_ui_audit.nx

buildroot/runtime/_hdl_build/nx_ui_audit.nx

14247 B127 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic ui
docsdependenciesstructsconstsfunctions

about

nx_ui_audit.nx -- ui-debt lane. The REAL design-quality judge (the operator's #1 gap: incredible backend + dev-grade frontend != SOTA). The existing judge (nx_page_verify a11y-lite + nx_contrast) measures DOCUMENT STRUCTURE (title/h1/main/alt) + is a contrast CALCULATOR -- it CANNOT tell a designed product from a dev dump. This measures DESIGN QUALITY from the live page source, LIAR-KILLED (every sub-score IS a measured count over the fetched bytes -- unfakeable). Composes nx_https_get (fork-capture) for the fetch; complements (does NOT touch) the racing-owned page_verify/nx_contrast. Run across every surface -> the UI-debt MAP. Dimensions (source-measurable, high design-signal): design-TOKEN discipline (var(--)), THEME-awareness (prefers-color-scheme), RESPONSIVE (@media + viewport), TYPE-scale (clamp + font-size variety), POLISH (transition/animation/:focus). Score/12 -> grade DEV-GRADE/FUNCTIONAL/DESIGNED/POLISHED. nx_ui_audit <url> [connect-host:port] (override 127.0.0.1:8443 for our own domains) ENVELOPE (declared): analyzes INLINE CSS in the fetched HTML (external stylesheets + rendered-pixel + real-color-extraction-into-nx_contrast = next rungs, honestly deferred). 512KB capture. exit: 0 audited | 4 fetch-fail | 2 usage. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_tool_run.nx nx_ui_audit.nx

imports: nx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main ua_w tr_run_capture sys_mmap sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read sys_wait4 wait_exit_code ua_count ua_b ua_q ua_je ua_slen ua_bn sys_openat_wr sys_renameat sys_openat_append

structs

none

consts

16const UA_MAGIC_30000: i64 = 30000
17const UA_MAGIC_524288: i64 = 524288
18const UA_MAGIC_32768: i64 = 32768
19const UA_MAGIC_2048: i64 = 2048
22const UA_MINBYTES: i64 = 1024
23const UA_EXIT_UNSCORABLE: i64 = 5

functions

25func ua_w(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
26func ua_b(rep: *u8, pos: i64, s: *u8) -> i64 { var p: i64 = pos; var i: i64 = 0; while s[i] != (0 as u8) { if p < UA_MAGIC_30000 { rep[p] = s[i]; p = p + 1 } i = i + 1 } return p }
called by 1: main
27func ua_bn(rep: *u8, pos: i64, v: i64) -> i64 { var p: i64 = pos; var m: i64 = v; if m < 0 { if p < UA_MAGIC_30000 { rep[p] = 45 as u8; p = p + 1 } m = 0 - m } let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { if p < UA_MAGIC_30000 { rep[p] = t[k - 1 - i]; p = p + 1 } i = i + 1 } return p }
called by 1: main
28func ua_q(rep: *u8, pos: i64) -> i64 { var p: i64 = pos; if p < UA_MAGIC_30000 { rep[p] = 34 as u8; p = p + 1 } return p }
called by 1: main
29func ua_je(rep: *u8, pos: i64, src: *u8, s: i64, e: i64) -> i64 { var p: i64 = pos; var i: i64 = s; while i < e { let c: i64 = src[i]; if c == 34 { if p < UA_MAGIC_30000 { rep[p] = 92 as u8; p = p + 1 } if p < UA_MAGIC_30000 { rep[p] = 34 as u8; p = p + 1 } } else { if c == 92 { if p < UA_MAGIC_30000 { rep[p] = 92 as u8; p = p + 1 } if p < UA_MAGIC_30000 { rep[p] = 92 as u8; p = p + 1 } } else { if c < 32 { if p < UA_MAGIC_30000 { rep[p] = 32 as u8; p = p + 1 } } else { if p < UA_MAGIC_30000 { rep[p] = c as u8; p = p + 1 } } } } i = i + 1 } return p }
called by 1: main
30func ua_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
32func ua_count(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main
46func main(argc: i64, argv: *i64) -> i64