code wiki / (root) / nx_backend_audit_test.nx

nx_backend_audit_test.nx

buildroot/runtime/nx_backend_audit_test.nx

7265 B179 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_backend_audit.nx -- self-host substrate audit, written IN NishiLang. Per user 2026-05-20: "we arent building lints off of nishi we are nishi from bits up". The substrate audits itself using its own file I/O + byte-search primitives. No bash, no grep, no awk -- the lint runs as a NishiLang program compiled by the same compiler it audits. Three substrate-honest audits in one program: A. Sub-word load zero-extend audit (was bash). Scans backend ctx files for `_emit_load_(byte|word|dword)_signed`. B. Syscall translation table audit (was bash). Asserts every SYS_X used in nx_syscalls.nx has a corresponding `if num ==` entry in the x86_64 translation table. C. Call-arity overflow audit (was bash). Asserts parser parse_primary_call has a die path for n_args overflow. Each audit emits one line to stderr: name + PASS/FAIL. Exit code = sum of (1 per failure). Exit 0 == all PASS. license_tier: ORIGINAL lineage_id: nishi_backend_audit_q10

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_backend_audit_test.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main _audit_say _audit_write sys_write _audit_strlen sys_mmap _audit_a_subword sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close _audit_say ↻ _audit_contains _audit_find _audit_strlen ↻ _audit_b_syscall_translati sys_mmap ↻ sys_read_file ↻ _audit_say ↻ _audit_contains ↻ _audit_c_call_arity sys_mmap ↻ sys_read_file ↻ _audit_say ↻ _audit_contains ↻

structs

none

consts

none

functions

27func _audit_write(s: *u8, n: i64) -> i64
called by 1: _audit_say calls 1: sys_write
31func _audit_strlen(s: *u8) -> i64
37func _audit_say(s: *u8) -> i64
43func _audit_find(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: _audit_contains calls 1: _audit_strlen
62func _audit_contains(buf: *u8, n: i64, needle: *u8) -> i64
69func _audit_a_subword(failures: *i64) -> i64
101func _audit_b_syscall_translation(failures: *i64) -> i64
133func _audit_c_call_arity(failures: *i64) -> i64
166func main() -> i64