code wiki / (root) / nx_osattest_gate.nx

nx_osattest_gate.nx

buildroot/runtime/nx_osattest_gate.nx

20127 B317 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_osattest_gate.nx -- GATE for LR6 (lang.plan rung LR6, symbol nxos_lang_ring_attest). SUBJECT: the DEPLOYED nx_osattest organ, driven end-to-end against a COMPILER THE CALLER NAMES. The compiler is argv[1] and is MANDATORY: this gate exists to compare a challenger compiler against the live one, and a silent default would produce a fully-formed verdict about a stale leftover binary. WHAT IT PROVES ABOUT THE ATTESTER (not about the estate's cleanliness -- a REFUSED closure is data): * its partition SUMS to the population it declares; * a source that MUST be refused under a live mode is counted REFUSED and the DECLARED RULE is NAMED, so a refusal for an unrelated reason cannot wear the mode's name; * a clean source is still counted ATTESTED under that same live mode -- an attester that refused everything would score perfectly on the refusal tooth alone; * a mode that is NOT enforcing is UNOBSERVABLE and is counted NEITHER clean NOR refused. This is the load-bearing neg-control: nx_compile_x86's long-flag dispatch keys on ONE BYTE (arg[2]), so an unrecognised flag is SILENTLY IGNORED and the compile returns 0. The fixture axis BOGUS carries a real-looking flag the compiler does not know; an attester that trusted flag NAMES would report it ATTESTED, and its green would be indistinguishable from a true one. FIXTURES ARE ASSEMBLED AT RUNTIME under /tmp/nxosattg/ and every receipt this gate produces is written THERE -- the production receipt at knowledge/status/ is never touched by a gate run. The two closure subjects are REAL estate sources whose behaviour under --ptrprov is already gate-proven by nx_boundscheck_gate (T5 in-range accepted, T9 const-OOB builds under default, T10 refused under ptrprov), so the expectations here are inherited measurements, not this author's guesses. usage: nx_osattest_gate [organ_elf] [compiler_elf] (CWD = the tree root, like nx_cc_equiv_gate) organ_elf defaults to ../nx_osattest.elf; SUBJECT-FIRST because that is where nx_gate_bite puts it. compiler_elf defaults to the gate_compiler row of knowledge/lang_attest.conf, and with neither the gate REFUSES -- the binary under test is always named, never found lying around. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_ccgate_lib.nx nx_lineconf_lib.nx nx_osattest_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_ccgate_lib.nxnx_lineconf_lib.nx

imported by: nobody (leaf or entry point)

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

main ccg_anchor_root sys_openat_rd sys_close sys_chdir 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_mmap ↻ og_resolve og_exists sys_openat_rd ↻ sys_close ↻ lcf_str_of sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ lcf_str lcf_find og_err sys_write ↻ og_len sys_exit ↻

structs

none

consts

41const OG_CONF: *u8 = "knowledge/lang_attest.conf"
42const OG_CCKEY: *u8 = "gate_compiler"
43const OG_CCW: i64 = 1024
45const OG_WORD: i64 = 8
46const OG_ARGV: i64 = 8
49const OG_RC_OK: i64 = 0
50const OG_RC_USAGE: i64 = 2
51const OG_RC_UNPROVEN: i64 = 3

functions

53func og_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: og_errog_write
57func og_err(s: *u8) -> i64 { sys_write(2, s, og_len(s)); return 0 }
called by 1: main calls 2: sys_writeog_len
60func og_write(path: *u8, s: *u8) -> i64
70func og_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, outp: *u8, errp: *u8) -> i64
86func og_exists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 }
95func og_resolve(p: *u8, anchored: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 1: og_exists
117func og_lines2(path: *u8, n1: *u8, n2: *u8) -> i64 { return ccg_file_count_lines_with2(path, n1, n2) }
called by 1: main calls 1: ccg_file_count_lines_with2
119func main(argc: i64, argv: *i64) -> i64