nx_backend_audit_test.nx
buildroot/runtime/nx_backend_audit_test.nx
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
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
structs
| none |
consts
| none |
functions
| 27 | func _audit_write(s: *u8, n: i64) -> i64 |
| 31 | func _audit_strlen(s: *u8) -> i64 |
| 37 | func _audit_say(s: *u8) -> i64 called by 4: _audit_a_subword_audit_b_syscall_translation_audit_c_call_aritymain calls 2: _audit_write_audit_strlen |
| 43 | func _audit_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 62 | func _audit_contains(buf: *u8, n: i64, needle: *u8) -> i64 |
| 69 | func _audit_a_subword(failures: *i64) -> i64 |
| 101 | func _audit_b_syscall_translation(failures: *i64) -> i64 |
| 133 | func _audit_c_call_arity(failures: *i64) -> i64 |
| 166 | func main() -> i64 |