code wiki / _hdl_build / nx_brand_aesthetic_gate.nx
nx_brand_aesthetic_gate.nx source
↩ module page · 41 lines · 2146 B
1// nx_brand_aesthetic_gate.nx -- the objective design-quality score discriminates a real branded page from a bare
2// one. HONEST: objective proxies, NOT subjective beauty; Nike/Apple parity = R6's measured BEHIND, not claimed here.
3// 100% sovereign. expect_exit: 0
4import "nx_syscalls.nx"
5import "nx_sitegate_emit_lib.nx"
6import "nx_brand_aesthetic.nx"
7import "nx_brand_tokens.nx"
8
9
10func inbandq(v: i64, lo: i64, hi: i64) -> i64 { if v < lo { return 0 } if v > hi { return 0 } return 1 }
11
12func main() -> i64 {
13 let tot: *i64 = sys_mmap(32) as *i64
14 tot[0]=0; tot[1]=0
15 let lp: *i64 = sys_mmap(16) as *i64
16 gw("=== nx_brand_aesthetic_gate -- MEASURED objective design-quality (proxies, not subjective beauty) ===\n" as *u8)
17
18 // A1: the real branded andelinwest page scores high on the objective bar
19 let page: *u8 = sys_read_file("web_assets/andelin_branded.html" as *u8, lp)
20 let pn: i64 = lp[0]
21 var sc: i64 = 0
22 if (page as i64) != 0 { if pn > 0 { sc = bq_score(page, pn) } }
23 gw(" andelin_branded.html design-quality score = " as *u8); gn(sc); gw(" / 10\n" as *u8)
24 t_row("A1 real branded page MEETS the objective design-quality bar (>=8/10)" as *u8, inbandq(sc, 8, 10), tot)
25
26 // A2: a bare page scores low (the score discriminates)
27 let bare: *u8 = "<!doctype html><html><body><p>hello</p></body></html>" as *u8
28 var bn: i64 = 0; while bare[bn] != (0 as u8) { bn = bn + 1 }
29 let scbare: i64 = bq_score(bare, bn)
30 gw(" bare page design-quality score = " as *u8); gn(scbare); gw(" / 10\n" as *u8)
31 t_row("A2 a bare unstyled page scores LOW (<=3/10) -- the metric discriminates" as *u8, inbandq(scbare, 0, 3), tot)
32
33 // A3: determinism
34 let s2: i64 = bq_score(page, pn)
35 t_row("A3 score is deterministic (same page -> same score)" as *u8, inbandq(s2, sc, sc), tot)
36
37 gw("\nrows pass=" as *u8); gn(tot[0]); gw(" fail=" as *u8); gn(tot[1]); gw("\n" as *u8)
38 if tot[1] == 0 { gw("VERDICT=GREEN -- objective design-quality is MEASURED; the default meets the bar. (Subjective Nike-parity = R6 honest BEHIND.)\n" as *u8); return 0 }
39 gw("VERDICT=RED\n" as *u8)
40 return 1
41}