code wiki / _hdl_build / nx_janitor_scratch.nx

nx_janitor_scratch.nx

buildroot/runtime/_hdl_build/nx_janitor_scratch.nx

3256 B52 linesdepth 2pulls 2 transitivereach 5 importersview sourcekind librarytopic janitor
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_janitor_scratch.nx nx_janitor_scratch_gate.nx nx_sovereignty_scorecard.nx

imports: nx_syscalls.nx

imported by: nx_janitor_scratch_gate.nxnx_sovereignty_scorecard.nx

structs

none

consts

9const K_MAGIC_131072: i64 = 131072

functions

11func 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
12func 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
13func 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 }
called by 1: jsc_count calls 1: jsc_slen
14func 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
18func jsc_count(dir: *u8, pfx: *u8, sfx: *u8) -> i64
45func jsc_total() -> i64
called by 2: mainssc_scratch calls 1: jsc_count