nx_debt_cockpit.nx
buildroot/runtime/nx_debt_cockpit.nx
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
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
| 12 | const DEBT_MAGIC_1000000: i64 = 1000000 |
| 14 | const DEBT_BUDGET_MS: i64 = 10000 // doctrine bar: the whole loop must fit under 10 seconds |
functions
| 16 | func 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 } |
| 17 | func db_putn(v: i64) -> i64 |
| 25 | func 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 } |
| 28 | func db_run(a1: *u8, a2: *u8) -> i64 |
| 50 | func db_check(name: *u8, a1: *u8, a2: *u8, acc: *i64) -> i64 |
| 61 | func main() -> i64 |