code wiki / (root) / nx_debt_cockpit.nx

nx_debt_cockpit.nx

buildroot/runtime/nx_debt_cockpit.nx

6645 B96 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic debt
docsdependenciesstructsconstsfunctions

about

nx_debt_cockpit.nx -- THE CODE-DEBT COCKPIT (nx_engineer doctrine applied to code-quality debt): ONE command, sub-10s, RED/GREEN board of the debt so a fix is a 1-step tight loop (fix source -> re-run -> GREEN). (Name note: `nx_debt` is the FINANCIAL amortization organ; this is the CODE-debt cockpit.) Composes the fast evaluators only: (1) code-review CENSUS (14 axes present + live scan discriminates) -- is the review plane itself healthy? (2) the pre-commit GATE on a WATCHLIST of organs we keep debt-free -- PASS iff no blocking finding (incomplete-work / non-sovereign 3rd-party-exec / mmap-leak). Prints per-item CLEAN/DEBT + ms, then a board + a fix-speed clock (<10000ms = GREEN, the doctrine's bar). The SLOW checks (audit tree-sweep, nishisafety compile, parallelism census) are deliberately NOT here -- they are periodic, not per-fix. Sovereign (fork+exec, no shell). Run from nxc2 root. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_debt_cockpit.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 db_puts sys_write db_ms sys_mmap sys_clock_gettime_mono sys_mmap ↻ db_check db_ms ↻ db_run sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve sys_exit sys_wait4 db_puts ↻ db_putn sys_write ↻ sys_mmap ↻ db_putn ↻ sys_exit ↻

structs

none

consts

12const DEBT_MAGIC_1000000: i64 = 1000000
14const DEBT_BUDGET_MS: i64 = 10000 // doctrine bar: the whole loop must fit under 10 seconds

functions

16func db_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: db_checkmain calls 1: sys_write
17func db_putn(v: i64) -> i64
called by 2: db_checkmain calls 2: sys_writesys_mmap
25func db_ms() -> i64 { let ts: *i64 = sys_mmap(16) as *i64; sys_clock_gettime_mono(ts); return ts[0] * 1000 + ts[1] / DEBT_MAGIC_1000000 }
28func db_run(a1: *u8, a2: *u8) -> i64
50func db_check(name: *u8, a1: *u8, a2: *u8, acc: *i64) -> i64
called by 1: main calls 4: db_msdb_rundb_putsdb_putn
61func main() -> i64