code wiki / _hdl_build / nx_uiq_console_lib.nx
nx_uiq_console_lib.nx
buildroot/runtime/_hdl_build/nx_uiq_console_lib.nx
about
nx_uiq_console_lib.nx -- F106a console/error capture: the console-analog defect signal, COMPUTED.
SOTA ground truth (banked 07-21): console/CSP capture is the highest-ROI automated defect signal
(WAREX/CovAgent). For sovereign static surfaces the console-equivalent classes ARE computable
from source, deterministically, no fakes:
ERRORS: var_undef var(--x) used, never defined, no fallback -> invalid property value
dup_id duplicate id= -> broken fragment/aria targets
dead_frag href="#x" with no matching id= in the page
mixed src="http://..." or <link href="http://..."> on an https page
empty_src src="" -> the browser fetches the page itself
tag_imbalance unclosed container tag (div/section/table/... open!=close)
WARNINGS: var_undef_fb (undefined but fallback saves it) img_noalt (a11y console class) empty_href
HONEST ENVELOPE (declared in output): static source scan; <script> BODIES are masked before the
HTML-structure scans; lowercase html; CSS-defined custom properties only (JS setProperty unseen);
space-separated attributes. Runtime JS errors / real CSP reports need a JS engine = browser-lane,
NOT faked here. license_tier: ORIGINAL genealogy: F106a experiential; family nx_uiq_color/contrast/perf
dependencies 1 imports · 3 importers
imports: nx_uiq_color.nx
imported by: nx_uiq_atree_lib.nxnx_uiq_console.nxnx_uiq_console_gate.nx
structs
| none |
consts
| 18 | const CS_CAP_BUF: i64 = 1048576 |
| 19 | const CS_CAP_IDS: i64 = 1024 |
| 20 | const CS_CAP_DETAIL: i64 = 48 |
| 21 | const CS_FIX_FAIL: *u8 = "<html><body><style>:root{--ok:#fff}.a{color:var(--miss)}.b{color:var(--gone,#000)}.c{color:var(--ok)}</style><div id=\"d1\"></div><div id=\"d1\"></div><a href=\"#nope\">x</a><a href=\"#d1\">y</a><a href=\"\">z</a><img src=\"x.png\"><img src=\"y.png\" alt=\"y\"><script src=\"http://x.js\"></script><img src=\"\" alt=\"e\"><div><span>s</span></body></html>" as *u8 |
| 22 | const CS_FIX_PASS: *u8 = "<html><body><style>:root{--ok:#111}.a{color:var(--ok)}</style><div id=\"a\"></div><a href=\"#a\">x</a><img src=\"i.png\" alt=\"i\"><script>let v=1</script><i>var(--)</i></body></html>" as *u8 |
| 23 | const CS_FIX_LIAR: *u8 = "<html><body><style>:root{--ok:#111}.a{color:var(--ok)}</style><div id=\"a\"></div><a href=\"#a\">x</a><img src=\"i.png\" alt=\"i\"><script>let v=1</script><b style=\"color:var(--nope)\">q</b></body></html>" as *u8 |
| 24 | const CS_FIX_MASK: *u8 = "<script>let s='<div id=\"q\">'</script><div></div>" as *u8 |
functions
| 33 | func cs_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8) { n=n+1 } return n } |
| 35 | func cs_namec(c: i64) -> i64 |
| 44 | func cs_find_from(buf: *u8, n: i64, start: i64, pat: *u8) -> i64 |
| 63 | func cs_span_eq(buf: *u8, o1: i64, l1: i64, o2: i64, l2: i64) -> i64 |
| 71 | func cs_detail(cls: i64, off: i64, len: i64) -> i64 |
| 86 | func cs_mask_scripts(src: *u8, n: i64, dst: *u8) -> i64 |
| 112 | func cs_has_def(buf: *u8, n: i64, noff: i64, nlen: i64) -> i64 |
| 137 | func cs_scan_vars(buf: *u8, n: i64, cnt: *i64) -> i64 |
| 165 | func cs_scan_ids(buf: *u8, n: i64, ioff: *i64, ilen: *i64, cap: i64, dupout: *i64) -> i64 |
| 187 | func cs_scan_frags(buf: *u8, n: i64, ioff: *i64, ilen: *i64, un: i64, cnt: *i64) -> i64 |
| 210 | func cs_scan_imgs(buf: *u8, n: i64, cnt: *i64) -> i64 |
| 230 | func cs_scan_mixed(buf: *u8, n: i64, cnt: *i64) -> i64 |
| 256 | func cs_scan_empty(buf: *u8, n: i64, errc: *i64, warnc: *i64) -> i64 |
| 274 | func cs_count_pat(buf: *u8, n: i64, pat: *u8, nb: i64) -> i64 |
| 293 | func cs_tagpair(mk: *u8, n: i64, opat: *u8, cpat: *u8, name: *u8, emit: i64, first: *i64) -> i64 |
| 310 | func cs_clsname(c: i64) -> i64 |
| 324 | func cs_audit_buf(buf: *u8, n: i64, emit: i64) -> i64 |
| 443 | func cs_slurp(path: *u8, buf: *u8, cap: i64) -> i64 |
| 455 | func cs_selftest() -> i64 |