code wiki / (root) / nx_field_of_struct_gate.nx

nx_field_of_struct_gate.nx

buildroot/runtime/nx_field_of_struct_gate.nx

6792 B116 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic field
docsdependenciesstructsconstsfunctions

about

nx_field_of_struct_gate.nx -- LN29 (lang.plan, 2026-09-02): A FIELD NAME MUST BELONG TO THE STRUCT IT IS READ FROM. End-to-end over the PROMOTED compiler: two fixtures are assembled at runtime in /tmp/<gate>/ (never a file a source census could mistake for an organ), the compiler is forked on each with stderr captured to a file, and the teeth read the captured bytes: fx_bad reads p.c on a struct declaring a and b -> MUST be refused, naming the struct, the field and the fields it really declares (the teaching voice: where, caret, why, fix) fx_ok reads p.a and p.b on the same struct -> MUST compile with no error line (the positive control) The refusal is the LN29 contract; the control is what keeps the gate from passing on a compiler that refuses everything. The "corpus builds unchanged" half of the done-rule is nx_cc_equiv_gate's job (10 rows + self-host), deliberately not duplicated here (one ruler per question). nx_field_of_struct_gate -- verdict in the exit code (gv_verdict) license_tier: ORIGINAL layer: lang module: nishi-core.lang.field_of_struct_gate

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_field_of_struct_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_mkdir fg_pick_cc sys_openat_rd sys_close fg_w sys_write ↻ fg_slen fg_write_file sys_openat_wr fg_slen ↻ sys_write ↻ sys_close ↻ gv_check gv_puts sys_write ↻ fg_compile sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap ↻ sys_execve sys_exit ↻ sys_wait4

structs

none

consts

16const FG_DIR: *u8 = "/tmp/nx_field_of_struct_gate\x00" as *u8
17const FG_BAD: *u8 = "/tmp/nx_field_of_struct_gate/fx_bad.nx\x00" as *u8
18const FG_OK: *u8 = "/tmp/nx_field_of_struct_gate/fx_ok.nx\x00" as *u8
19const FG_BAD_ERR: *u8 = "/tmp/nx_field_of_struct_gate/fx_bad.err\x00" as *u8
20const FG_OK_ERR: *u8 = "/tmp/nx_field_of_struct_gate/fx_ok.err\x00" as *u8
21const FG_DEVNULL: *u8 = "/dev/null\x00" as *u8
22const FG_CC_NAS: *u8 = "buildroot/_offc/nx_cc_sovereign.elf\x00" as *u8 // NAS gate CWD = nishihost root
23const FG_CC_LAP: *u8 = "_offc/nx_cc_sovereign.elf\x00" as *u8 // laptop CWD = nxc2 root
24const FG_CAP: i64 = 65536
25const FG_MODE: i64 = 420

functions

27func fg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
28func fg_w(s: *u8) -> i64 { sys_write(1, s, fg_slen(s)); return 0 }
called by 1: main calls 2: sys_writefg_slen
29func fg_find(b: *u8, n: i64, pat: *u8) -> i64
called by 1: main calls 1: fg_slen
41func fg_write_file(path: *u8, body: *u8) -> i64
50func fg_compile(cc: *u8, src: *u8, errpath: *u8) -> i64
68func fg_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
80func fg_pick_cc() -> *u8
called by 1: main calls 2: sys_openat_rdsys_close
86func main() -> i64