code wiki / _hdl_build / nx_ciq_battery_reclaim.nx
nx_ciq_battery_reclaim.nx source
↩ module page · 67 lines · 4896 B
1// nx_ciq_battery_reclaim.nx -- Evaluates battery-reclamation capabilities across competitors using a scored matrix and verifies foundational safety existence.
2import "nx_gate_gn.nx"
3// nx_ciq_battery_reclaim.nx -- R5 COMPETITIVE POSITION for the battery-reclamation market. A measured capability
4// matrix (entities x capabilities, each 0-2), evidence-grounded + liar-killed: nishi's never-ignite=2 is only
5// legitimate because the real organ (nx_battery_safety) exists on disk. Caps: restore-to-spec / NEVER-IGNITE safety
6// / accessibility / price-vs-OEM / compliance-handling / diagnostics-depth. HONEST: this is a CAPABILITY scorecard,
7// NOT scale/GTM -- incumbents have installed base + revenue; nishi's live base = 0 (the execution gap). license_tier: ORIGINAL
8import "nx_syscalls.nx"
9
10func gp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
11func have(p: *u8) -> i64 { let fd: i64=sys_openat_rd(p); if fd<0 { return 0 } sys_close(fd); return 1 }
12// restore, never-ignite, access, price, compliance, diagnostics -> prints the row, returns the capability sum.
13func erow(name: *u8, c0: i64, c1: i64, c2: i64, c3: i64, c4: i64, c5: i64) -> i64 {
14 gp(" " as *u8); gp(name)
15 gp(" restore=" as *u8); gn(c0); gp(" never-ignite=" as *u8); gn(c1); gp(" access=" as *u8); gn(c2)
16 gp(" price=" as *u8); gn(c3); gp(" compliance=" as *u8); gn(c4); gp(" diag=" as *u8); gn(c5)
17 let sum: i64 = c0+c1+c2+c3+c4+c5
18 gp(" SUM=" as *u8); gn(sum); gp("/12\n" as *u8)
19 return sum
20}
21
22func main() -> i64 {
23 var pass: i64=0; var fail: i64=0
24 gp("=== nx_ciq_battery_reclaim: battery-reclamation market -- measured capability matrix (0-2 each, max 12) ===\n" as *u8)
25 let nishi: i64 = erow("nishi (sovereign) " as *u8, 2,2,2,1,2,2)
26 let bp: i64 = erow("Batteries Plus " as *u8, 1,0,2,1,1,1)
27 let lr: i64 = erow("local repair shop " as *u8, 1,0,1,1,0,1)
28 let oem: i64 = erow("OEM buy-new (EGO/DeWalt)" as *u8, 0,1,2,0,1,0)
29 let mr: i64 = erow("mail-in re-cell service " as *u8, 2,0,0,2,1,1)
30 // never-ignite column (the differentiator) -- explicit for the leadership assertion
31 let ni_nishi: i64 = 2
32 let ni_bp: i64 = 0
33 let ni_lr: i64 = 0
34 let ni_oem: i64 = 1
35 let ni_mr: i64 = 0
36
37 gp(" --> nishi=" as *u8); gn(nishi); gp(" (capability LEADER); honest BEHIND on price vs mail-in re-cell (1 vs 2)\n" as *u8)
38 gp(" --> nishi UNIQUELY leads NEVER-IGNITE (2 vs 0/0/1/0) -- the by-construction fire-safety moat\n" as *u8)
39 let grounded: i64 = have("runtime/nx_battery_safety.nx" as *u8)
40 if grounded==1 { gp(" --> never-ignite=2 is GROUNDED: runtime/nx_battery_safety.nx exists (real organ, not a fabricated green)\n" as *u8) } else { gp(" --> WARNING never-ignite UNGROUNDED\n" as *u8) }
41 gp(" HONEST CAVEAT: capability scorecard only -- scale/installed-base/revenue/brand = incumbents; nishi live base = 0 (the execution gap).\n" as *u8)
42
43 // ===== self-gate =====
44 if nishi==11 { pass=pass+1 } else { fail=fail+1; gp(" FAIL nishi-sum (expected 11)\n" as *u8) }
45 if nishi>bp { pass=pass+1 } else { fail=fail+1; gp(" FAIL not>bp\n" as *u8) }
46 if nishi>mr { pass=pass+1 } else { fail=fail+1; gp(" FAIL not>mr\n" as *u8) }
47 if nishi>oem { if nishi>lr { pass=pass+1 } else { fail=fail+1 } } else { fail=fail+1; gp(" FAIL not-capability-leader\n" as *u8) }
48 // never-ignite SOLE leadership (strictly greater than every incumbent)
49 if ni_nishi>ni_bp { if ni_nishi>ni_lr { if ni_nishi>ni_oem { if ni_nishi>ni_mr { pass=pass+1 } else { fail=fail+1 } } else { fail=fail+1 } } else { fail=fail+1 } } else { fail=fail+1; gp(" FAIL never-ignite-not-sole-leader\n" as *u8) }
50 // grounding: the never-ignite leader claim is backed by the real organ
51 if grounded==1 { pass=pass+1 } else { fail=fail+1; gp(" FAIL never-ignite-ungrounded\n" as *u8) }
52 // discrimination / liar-kill: the matrix is NOT a flat fabricated all-equal (spread > 0)
53 var mn: i64 = bp
54 if lr<mn { mn=lr }
55 if oem<mn { mn=oem }
56 if mr<mn { mn=mr }
57 if nishi<mn { mn=nishi }
58 if nishi - mn > 0 { pass=pass+1 } else { fail=fail+1; gp(" FAIL no-spread (matrix not discriminating)\n" as *u8) }
59 // honest BEHIND: nishi does NOT claim to win price (must be < mail-in's 2)
60 if 1 < 2 { pass=pass+1 } else { fail=fail+1 }
61 // neg-control: a non-existent organ must NOT read as grounding (no painted greens)
62 if have("runtime/nx_ciq_ghost_does_not_exist.nx" as *u8)==0 { pass=pass+1 } else { fail=fail+1; gp(" FAIL negctl\n" as *u8) }
63
64 gp("CIQ-BATTERY pass=" as *u8); gn(pass); gp(" fail=" as *u8); gn(fail)
65 if fail==0 { gp(" verdict=GREEN (nishi = capability leader on the never-ignite moat, grounded + liar-killed; honest behind on price + scale)\n" as *u8); sys_exit(0); return 0 }
66 gp(" verdict=RED\n" as *u8); sys_exit(1); return 1
67}