code wiki / _hdl_build / nx_janitor_scratch.nx
nx_janitor_scratch.nx
buildroot/runtime/_hdl_build/nx_janitor_scratch.nx
about
nx_janitor_scratch.nx -- the "scratch-accumulation" part of the janitor's X-JAN-002 sprawl half (the third
and last part: "dead-organ" = nx_janitor_sprawl, "dup" = nx_janitor_dupname, "scratch-accumulation" = HERE).
Build/test scratch piles up unbounded -- every nx_sov_build_run leaves /tmp/*.s + /tmp/*.elf, test organs
leave /tmp/*.txt, and _scratch/ / _quarantine/ accumulate -- and nothing measures it, so it silently grows.
This MEASURES scratch accumulation across the known scratch zones (a count per zone + a total) so the operator
can SEE the footprint. READ-ONLY (never-brick): it counts + reports; reaping (delete) needs unlink the janitor
deliberately does not have, so reaping stays a separate operator-gated step. Sovereign. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_janitor_scratch_gate.nxnx_sovereignty_scorecard.nx
structs
| none |
consts
| 9 | const K_MAGIC_131072: i64 = 131072 |
functions
| 11 | func jsc_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: jsc_ends |
| 12 | func jsc_starts(name: *u8, pfx: *u8) -> i64 { if pfx[0]==(0 as u8) { return 1 } var i: i64=0; while pfx[i]!=(0 as u8){ if name[i]!=pfx[i] { return 0 } i=i+1 } return 1 } called by 1: jsc_count |
| 13 | func jsc_ends(name: *u8, sfx: *u8) -> i64 { let sl: i64=jsc_slen(sfx); if sl==0 { return 1 } let nl: i64=jsc_slen(name); if sl>nl { return 0 } var i: i64=0; while i<sl { if name[nl-sl+i]!=sfx[i] { return 0 } i=i+1 } return 1 } |
| 14 | func jsc_is_dot(name: *u8) -> i64 { if name[0]==(46 as u8) { if name[1]==(0 as u8) { return 1 } if name[1]==(46 as u8) { if name[2]==(0 as u8) { return 1 } } } return 0 } called by 1: jsc_count |
| 18 | func jsc_count(dir: *u8, pfx: *u8, sfx: *u8) -> i64 called by 2: jsc_totalmain calls 10: sys_openat_rdsys_mmapsys_getdents64dirent_reclendirent_namedirent_type+4 |
| 45 | func jsc_total() -> i64 |