nx_field_of_struct_gate.nx
buildroot/runtime/nx_field_of_struct_gate.nx
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
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
structs
| none |
consts
| 16 | const FG_DIR: *u8 = "/tmp/nx_field_of_struct_gate\x00" as *u8 |
| 17 | const FG_BAD: *u8 = "/tmp/nx_field_of_struct_gate/fx_bad.nx\x00" as *u8 |
| 18 | const FG_OK: *u8 = "/tmp/nx_field_of_struct_gate/fx_ok.nx\x00" as *u8 |
| 19 | const FG_BAD_ERR: *u8 = "/tmp/nx_field_of_struct_gate/fx_bad.err\x00" as *u8 |
| 20 | const FG_OK_ERR: *u8 = "/tmp/nx_field_of_struct_gate/fx_ok.err\x00" as *u8 |
| 21 | const FG_DEVNULL: *u8 = "/dev/null\x00" as *u8 |
| 22 | const FG_CC_NAS: *u8 = "buildroot/_offc/nx_cc_sovereign.elf\x00" as *u8 // NAS gate CWD = nishihost root |
| 23 | const FG_CC_LAP: *u8 = "_offc/nx_cc_sovereign.elf\x00" as *u8 // laptop CWD = nxc2 root |
| 24 | const FG_CAP: i64 = 65536 |
| 25 | const FG_MODE: i64 = 420 |
functions
| 27 | func fg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 28 | func fg_w(s: *u8) -> i64 { sys_write(1, s, fg_slen(s)); return 0 } |
| 29 | func fg_find(b: *u8, n: i64, pat: *u8) -> i64 |
| 41 | func fg_write_file(path: *u8, body: *u8) -> i64 |
| 50 | func fg_compile(cc: *u8, src: *u8, errpath: *u8) -> i64 |
| 68 | func fg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 80 | func fg_pick_cc() -> *u8 |
| 86 | func main() -> i64 |