code wiki / _hdl_build / nx_debt_audit.nx
nx_debt_audit.nx
buildroot/runtime/_hdl_build/nx_debt_audit.nx
about
nx_debt_audit.nx -- the ANTI-SILENT-DEBT auditor (operator: audit from the hardware
layer up as part of security/racing/triage -- catch hacking, working-around, silent
technical debt; S-class-exceed discipline everywhere). SOVEREIGN organ replacing the
borrowed bench/nx_debt_audit.sh (the audit retires its OWN shell debt = dogfood).
Two mechanical checks, hardware-up:
1. LEDGER DISCIPLINE: every QUAL/QUANT row in NISHI_DEBT_LEDGER.tsv must carry a
tracked plan (a non-empty later column) -- a debt row with no plan = SILENT debt.
2. MARKER SCAN: scan a source for the silent-debt signal words (HACK, WORKAROUND,
FIXME, XXX, "for now", TODO without a row ref) -- a marker is fine IF the file is
named in the ledger (tracked) -- an UNTRACKED marker = a workaround nobody logged.
A workaround is ALLOWED (landmines exist) -- a workaround that is NOT TRACKED is the
violation. Durable: DEBTAUDIT rows + verdict -> knowledge/status/debt_audit.log.
Exit 0 = no silent debt. argv[1]=ledger override argv[2]=source-to-scan (optional).
license_tier: ORIGINAL
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
| 16 | const K_MAGIC_1048576: i64 = 1048576 |
| 17 | const K_MAGIC_1048560: i64 = 1048560 |
| 18 | const K_MAGIC_2097152: i64 = 2097152 |
| 19 | const K_MAGIC_2097136: i64 = 2097136 |
functions
| 20 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 21 | func _fp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 22 | func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 23 | func da_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: da_slice_has |
| 24 | func da_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 33 | func da_slice_has(hay: *u8, a: i64, b: i64, pat: *u8) -> i64 |
| 47 | func da_ledger(buf: *u8, n: i64, lfd: i64) -> i64 |
| 82 | func da_markers(buf: *u8, n: i64, name: *u8, lfd: i64) -> i64 |
| 102 | func main(argc: i64, argv: *i64) -> i64 |