code wiki / _hdl_build / nx_neverbrick_genesis.nx

nx_neverbrick_genesis.nx

buildroot/runtime/_hdl_build/nx_neverbrick_genesis.nx

11419 B128 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_neverbrick_genesis.nx -- GATE: the NEVER-BRICK GENESIS GATE (cardinal 26's NAMED enforcement mechanism: "the genesis gate flags any firmware-axis node lacking a never-brick guarantee -> VERDICT RED, never asserted as a promise"). Composes the existing certify() principle (nx_eng_repro_neverbrick_gate) into a REAL registry scan over every hardware-write-axis capability the ecosystem has built, and REFUSES the whole genesis if ANY hw node lacks a never-brick guarantee. This is the mechanical proof that no Nishi capability can brick the electronics. A node is SAFE iff: it does NOT write hardware (hw=0), OR it carries a never-brick GUARANTEE that is one of {READ-ONLY, REVERSIBLE, FAIL-SAFE-BY-CONSTRUCTION}. Firmware-axis nodes (MMU/GPU/boot/exec) must carry the STRONGEST guarantee (FAIL-SAFE by construction), matching cardinal 26's "BY CONSTRUCTION" bar. T1 the genesis scan over the REAL registry -> every hw node carries a never-brick guarantee -> VERDICT GREEN. T2 the certify() principle: hw+proven -> certified; hw+unproven -> REJECTED; software -> certified regardless. T3 teeth: INJECT a firmware-write node with guarantee=NONE -> the gate flags it -> VERDICT RED (real filter). T4 every registered hw node's guarantee is non-NONE (enumerate -- no rubber stamp). T5 firmware-axis nodes (MMU/GPU-driver/GPU-ring/boot/exec-format) ALL carry FAIL-SAFE-BY-CONSTRUCTION. expect_exit: 0 Sovereign: nx_syscalls. NEVER-BRICK: pure verdict computation, writes 0 firmware.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_g_puts_lib.nx nx_neverbrick_genesis.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_g_puts_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_puts sys_write sys_mmap genesis_verdict node_safe g_pn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap ck g_puts ↻ certify sys_openat_append sys_write ↻ sys_close sys_exit

structs

none

consts

28const G_NONE: i64 = 0
29const G_READONLY: i64 = 1
30const G_REVERSIBLE: i64 = 2
31const G_FAILSAFE: i64 = 3 // fail-safe / model-only / refused-by-construction = the strongest, cardinal-26 bar
33const AX_SOFTWARE: i64 = 0
34const AX_FIRMWARE: i64 = 1 // firmware/MMU/GPU/boot/exec -- the brick-critical axis (must be FAIL-SAFE)

functions

24func g_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
25func ck(name: *u8, c: i64) -> i64 { if c==1 { g_puts(" PASS " as *u8) } else { g_puts(" FAIL " as *u8) } g_puts(name); g_puts("\n" as *u8); return c }
called by 1: main calls 1: g_puts
36func g_name(g: i64) -> *u8 { if g==0 { return "NONE" as *u8 } if g==1 { return "READ-ONLY" as *u8 } if g==2 { return "REVERSIBLE" as *u8 } return "FAIL-SAFE-BY-CONSTRUCTION" as *u8 }
39func certify(hw: i64, proven: i64, quality_ok: i64) -> i64 { if hw == 1 { if proven == 0 { return 0 } } return quality_ok }
called by 1: main
42func node_safe(hw: i64, guar: i64) -> i64 { if hw==0 { return 1 } if guar != G_NONE { return 1 } return 0 }
called by 1: genesis_verdict
44func genesis_verdict(hw: *i64, guar: *i64, n: i64, bad: *i64) -> i64
called by 1: main calls 1: node_safe
51func main() -> i64