code wiki / _hdl_build / nx_research_signal_gate.nx
nx_research_signal_gate.nx source
↩ module page · 55 lines · 3413 B
1import "nx_gate_gn.nx"
2import "nx_gate_base.nx"
3// nx_research_signal_gate.nx -- run the new researcher analysis stage over the bex_ June-2026 corpus: print a signal
4// matrix + verify the scanner finds REAL facts (WordPress=open-source, Webflow=hosted, Material=tokens, a11y page=WCAG).
5// Grounds the exceed plan in live data. 100% sovereign. expect_exit: 0
6import "nx_syscalls.nx"
7import "nx_research_signal.nx"
8
9func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("
10" as *u8); return ok }
11func t_row(name: *u8, ok: i64, tot: *i64) -> i64 {
12 if ok == 1 { gw(" PASS " as *u8); tot[0]=tot[0]+1 } else { gw(" FAIL " as *u8); tot[1]=tot[1]+1 }
13 gw(name); gw("\n" as *u8); return 0
14}
15// print a per-source signal profile
16func rs_prof(label: *u8, path: *u8) -> i64 {
17 gw(" " as *u8); gw(label)
18 gw(" cloud=" as *u8); gn(rs_scan(path, "cloud" as *u8))
19 gw(" host=" as *u8); gn(rs_scan(path, "host" as *u8))
20 gw(" subscr=" as *u8); gn(rs_scan(path, "subscription" as *u8))
21 gw(" open-source=" as *u8); gn(rs_scan(path, "open source" as *u8))
22 gw(" a11y=" as *u8); gn(rs_scan(path, "accessib" as *u8))
23 gw(" track=" as *u8); gn(rs_scan(path, "track" as *u8))
24 gw(" token=" as *u8); gn(rs_scan(path, "token" as *u8))
25 gw("\n" as *u8)
26 return 0
27}
28
29func main() -> i64 {
30 let tot: *i64 = sys_mmap(32) as *i64
31 tot[0]=0; tot[1]=0
32 gw("=== nx_research_signal_gate -- researcher analysis stage over the bex_ June-2026 corpus ===\n" as *u8)
33 gw("-- signal matrix (raw counts per source; grounds the exceed plan) --\n" as *u8)
34 rs_prof("webflow " as *u8, "knowledge/fetched/bex_webflow.raw" as *u8)
35 rs_prof("framer " as *u8, "knowledge/fetched/bex_framer.raw" as *u8)
36 rs_prof("wix " as *u8, "knowledge/fetched/bex_wix.raw" as *u8)
37 rs_prof("squarespace " as *u8, "knowledge/fetched/bex_squarespace.raw" as *u8)
38 rs_prof("wordpress " as *u8, "knowledge/fetched/bex_wordpress.raw" as *u8)
39 rs_prof("material " as *u8, "knowledge/fetched/bex_material.raw" as *u8)
40 rs_prof("tailwind " as *u8, "knowledge/fetched/bex_tailwind.raw" as *u8)
41 rs_prof("optimizely " as *u8, "knowledge/fetched/bex_optimizely.raw" as *u8)
42
43 gw("-- scanner verification (must find REAL facts) --\n" as *u8)
44 t_row("WordPress is open-source (scan finds 'open source')" as *u8, rs_has("knowledge/fetched/bex_wordpress.raw" as *u8, "open source" as *u8, 1), tot)
45 t_row("Webflow is a hosted platform (scan finds 'host')" as *u8, rs_has("knowledge/fetched/bex_webflow.raw" as *u8, "host" as *u8, 1), tot)
46 t_row("Material Design uses tokens (scan finds 'token')" as *u8, rs_has("knowledge/fetched/bex_material.raw" as *u8, "token" as *u8, 1), tot)
47 t_row("the accessibility corpus references WCAG" as *u8, rs_has("knowledge/fetched/bex_web_a11y.raw" as *u8, "wcag" as *u8, 1), tot)
48 var nf: i64 = 0; if rs_scan("knowledge/fetched/bex_DOES_NOT_EXIST.raw" as *u8, "x" as *u8) == 0 - 1 { nf = 1 }
49 t_row("NEG: missing source -> -1 (no fabricated signal)" as *u8, nf, tot)
50
51 gw("\nrows pass=" as *u8); gn(tot[0]); gw(" fail=" as *u8); gn(tot[1]); gw("\n" as *u8)
52 if tot[1] == 0 { gw("VERDICT=GREEN -- researcher grew a real analysis stage (corpus signal-scan), grounded in live June-2026 facts\n" as *u8); return 0 }
53 gw("VERDICT=RED\n" as *u8)
54 return 1
55}