code wiki / _hdl_build / nx_brand_exceed3_gate.nx

nx_brand_exceed3_gate.nx source

↩ module page · 116 lines · 7049 B

1import "nx_gate_gn.nx" 2import "nx_gate_base.nx" 3// nx_brand_exceed3_gate.nx -- S-class exceed expansion WAVE 2, grounded in the June-2026 research (nx_research_signal 4// matrix: proprietary builders Webflow/Wix/Squarespace/Framer = hosted/tracking/a11y≈0). 6 MORE by-construction axes 5// through the no-overclaim referee, each genuinely RUN; incumbent = DOCUMENTED proprietary-builder behavior, labeled. 6// Framed "vs proprietary builders" (NOT WordPress, which the data shows is open-source + a11y-strong). Subjective 7// beauty / breadth still NOT here. 100% sovereign. license_tier: ORIGINAL expect_exit: 0 8import "nx_syscalls.nx" 9import "nx_cms_exceed.nx" 10import "nx_brand_book.nx" 11import "nx_brand_guard.nx" 12import "nx_brand_packs.nx" 13import "nx_brand_typescale.nx" 14import "nx_brand_spacescale.nx" 15import "nx_brand_conversion.nx" 16import "nx_brand_tokens.nx" 17 18func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw(" 19" as *u8); return ok } 20func g_has(s: *u8, n: i64, lit: *u8) -> i64 { if bt_find(s, n, lit, bt_len(lit)) >= 0 { return 1 } return 0 } 21func axis_ahead(name: *u8, our: i64, inc: i64, n: i64, tot: *i64) -> i64 { 22 let v: i64 = xcd_verdict(our, inc) 23 let ok: i64 = xcd_referee_ok(v, our, n) 24 var pass: i64 = 0 25 if v == XCD_AHEAD { if ok == 1 { pass = 1 } } 26 if pass == 1 { gw(" PASS " as *u8); tot[0]=tot[0]+1 } else { gw(" FAIL " as *u8); tot[1]=tot[1]+1 } 27 gw(name); gw(" -> " as *u8); gw(xcd_vname(v)); gw(" (ours=" as *u8); gn(our); gw("/" as *u8); gn(n) 28 gw(" vs documented=" as *u8); gn(inc); gw("/" as *u8); gn(n); gw(")\n" as *u8) 29 return pass 30} 31// emit a brand book for `brand` to `path` and read it back into out; return length. 32func g_bbemit(brand: *u8, bn: i64, path: *u8, out: *u8, cap: i64) -> i64 { 33 let fd: i64 = sys_openat_wr(path, 0x1a4) 34 bb_emit(brand, bn, fd) 35 sys_close(fd) 36 let lp: *i64 = sys_mmap(16) as *i64 37 let pg: *u8 = sys_read_file(path, lp) 38 let pn: i64 = lp[0] 39 var i: i64 = 0 40 while i < pn { if i < cap { out[i] = pg[i] } i = i + 1 } 41 return pn 42} 43 44func main() -> i64 { 45 let tot: *i64 = sys_mmap(32) as *i64 46 tot[0]=0; tot[1]=0 47 let base: *u8 = bt_default_brand() 48 let bn: i64 = bt_len(base) 49 let cap: i64 = 16384 50 let a: *u8 = sys_mmap(cap) 51 let b: *u8 = sys_mmap(cap) 52 let lp: *i64 = sys_mmap(16) as *i64 53 gw("=== nx_brand_exceed3_gate -- S-class exceed WAVE 2 (research-grounded, refereed; vs proprietary builders) ===\n" as *u8) 54 55 // H TYPE: resize-safe modular type scale (rem + in-band ratio) by construction 56 let ts: *u8 = sys_mmap(2048) 57 let tn: i64 = ts_emit_scale(1000, 5, 4, ts, 2048) 58 var typ: i64 = 0 59 if g_has(ts, tn, "rem" as *u8) == 1 { if bg_type_scale_ok(ts, tn) == 1 { typ = 1 } } 60 axis_ahead("H TYPE: resize-safe modular type scale (rem, in-band) vs arbitrary px" as *u8, typ, 0, 1, tot) 61 62 // I BRAND-BOOK live-synced from the tokens (a book reflects ITS brand's colours) vs hand-maintained 63 let bk1: i64 = g_bbemit(base, bn, "/tmp/nx_ex3_bk1.html" as *u8, a, cap) 64 let oceanlen: i64 = bp_decode(bp_pack("ocean" as *u8), b, cap) 65 let bo: *u8 = sys_mmap(cap) 66 let bk2: i64 = g_bbemit(b, oceanlen, "/tmp/nx_ex3_bk2.html" as *u8, bo, cap) 67 var sync: i64 = 0 68 if g_has(a, bk1, "#0b2545" as *u8) == 1 { if g_has(bo, bk2, "#0a3d62" as *u8) == 1 { sync = 1 } } 69 axis_ahead("I BRAND-BOOK live-synced from tokens (reflects the brand) vs hand-maintained (drifts)" as *u8, sync, 0, 1, tot) 70 71 // J CAPABILITY-TIERS: every input tier funnels through ONE governed core (vs a one-size editor) 72 // measured proxy: 3 distinct brand inputs all yield a guard-passing (AA) brand 73 var tiers: i64 = 0 74 let nb: i64 = bp_decode(bp_pack("nishi" as *u8), a, cap); if bg_pair_contrast(a, nb, "color" as *u8, "ink" as *u8, "color" as *u8, "bg" as *u8) >= 450 { tiers = tiers + 1 } 75 let ob: i64 = bp_decode(bp_pack("ocean" as *u8), a, cap); if bg_pair_contrast(a, ob, "color" as *u8, "ink" as *u8, "color" as *u8, "bg" as *u8) >= 450 { tiers = tiers + 1 } 76 let fb: i64 = bp_decode(bp_pack("forest" as *u8), a, cap); if bg_pair_contrast(a, fb, "color" as *u8, "ink" as *u8, "color" as *u8, "bg" as *u8) >= 450 { tiers = tiers + 1 } 77 axis_ahead("J CAPABILITY-TIERS: governance invariant across tiers (3/3 governed) vs one-size editor" as *u8, tiers, 1, 3, tot) 78 79 // K CONVERSION: conversion-path measured + discriminated (good page high, bad page 0) vs builders ignore it 80 let page: *u8 = sys_read_file("web_assets/andelin_branded.html" as *u8, lp) 81 let pn: i64 = lp[0] 82 var conv: i64 = 0 83 if (page as i64) != 0 { if bc_conv_score(page, pn) >= 2 { conv = conv + 1 } } 84 let bare: *u8 = "<!doctype html><html><body><p>no cta</p></body></html>" as *u8 85 var ban: i64 = 0; while bare[ban] != (0 as u8) { ban = ban + 1 } 86 if bc_conv_score(bare, ban) == 0 { conv = conv + 1 } 87 axis_ahead("K CONVERSION: conversion-path measured+enforced vs builders allow bad funnels" as *u8, conv, 0, 2, tot) 88 89 // L MULTI-BRAND: N brands all AA + reproducible by construction vs off-brand themes 90 var mb: i64 = 0 91 let lnb: i64 = bp_decode(bp_pack("nishi" as *u8), a, cap); if bg_pair_contrast(a, lnb, "color" as *u8, "ink" as *u8, "color" as *u8, "bg" as *u8) >= 450 { mb = mb + 1 } 92 let lob: i64 = bp_decode(bp_pack("ocean" as *u8), a, cap); if bg_pair_contrast(a, lob, "color" as *u8, "ink" as *u8, "color" as *u8, "bg" as *u8) >= 450 { mb = mb + 1 } 93 let lfb: i64 = bp_decode(bp_pack("forest" as *u8), a, cap); if bg_pair_contrast(a, lfb, "color" as *u8, "ink" as *u8, "color" as *u8, "bg" as *u8) >= 450 { mb = mb + 1 } 94 axis_ahead("L MULTI-BRAND: N brands all AA+reproducible by construction vs off-brand themes" as *u8, mb, 0, 3, tot) 95 96 // M SPACING: every step on the grid by construction vs arbitrary px 97 let sp: *u8 = sys_mmap(2048) 98 let spn: i64 = ss_emit_scale(8, sp, 2048) 99 var sg: i64 = 0 100 if bg_space_grid_ok(sp, spn, "1" as *u8, 8) == 1 { sg = sg + 1 } 101 if bg_space_grid_ok(sp, spn, "2" as *u8, 8) == 1 { sg = sg + 1 } 102 if bg_space_grid_ok(sp, spn, "3" as *u8, 8) == 1 { sg = sg + 1 } 103 if bg_space_grid_ok(sp, spn, "4" as *u8, 8) == 1 { sg = sg + 1 } 104 if bg_space_grid_ok(sp, spn, "5" as *u8, 8) == 1 { sg = sg + 1 } 105 axis_ahead("M SPACING: every step on the 8px grid by construction vs arbitrary px" as *u8, sg, 0, 5, tot) 106 107 gw("-- referee self-tests --\n" as *u8) 108 var st1: i64 = 0; if xcd_referee_ok(XCD_AHEAD, 2, 3) == 0 { st1 = 1 } 109 if st1 == 1 { gw(" PASS " as *u8); tot[0]=tot[0]+1 } else { gw(" FAIL " as *u8); tot[1]=tot[1]+1 } 110 gw("S1 referee rejects overclaim (AHEAD with our_correct<n)\n" as *u8) 111 112 gw("\nrows pass=" as *u8); gn(tot[0]); gw(" fail=" as *u8); gn(tot[1]); gw("\n" as *u8) 113 if tot[1] == 0 { gw("VERDICT=GREEN -- 6 more refereed by-construction exceeds (vs proprietary builders); subjective beauty/breadth still BEHIND.\n" as *u8); return 0 } 114 gw("VERDICT=RED\n" as *u8) 115 return 1 116}