code wiki / _hdl_build / nx_janitor.nx
nx_janitor.nx
buildroot/runtime/_hdl_build/nx_janitor.nx
about
nx_janitor.nx -- the CARETAKER/JANITOR's FRESHNESS evaluator (operator 2026-06-12:
freshness + sprawl evaluator, janitorial quality to S-class). Is the system ALIVE
and are its derived surfaces FRESH? Reads the latest beat + key derived-surface
epochs, compares to now -- STALE = the daemon stopped or a surface stopped
regenerating (the silent-death signal a janitor catches). Freshness half here;
sprawl half (dup/dead-organ/scratch-accumulation) = X-JAN-002 (getdents walk).
Durable: JANITOR row -> knowledge/status/janitor.log. Exit 0 = fresh.
argv override: none (live surfaces). 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
| 10 | const K_MAGIC_1048576: i64 = 1048576 |
| 11 | const K_MAGIC_1048560: i64 = 1048560 |
| 12 | const K_MAGIC_4000: i64 = 4000 |
| 13 | const K_MAGIC_8000: i64 = 8000 |
functions
| 14 | 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 } |
| 15 | 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 } |
| 16 | func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(fd,"-" as *u8,1)}; 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 } |
| 17 | func jn_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 27 | func jn_last_epoch(buf: *u8, n: i64, key: *u8) -> i64 called by 1: jn_surface |
| 48 | func jn_surface(lfd: i64, name: *u8, path: *u8, key: *u8, now: i64, limit: i64, stale: *i64) -> i64 |
| 63 | func main() -> i64 |