code wiki / _hdl_build / nx_janitor_sprawl_gate.nx

nx_janitor_sprawl_gate.nx

buildroot/runtime/_hdl_build/nx_janitor_sprawl_gate.nx

8110 B134 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic janitor
docsdependenciesstructsconstsfunctions

about

nx_janitor_sprawl_gate.nx -- proves the JANITOR sprawl/junk-cleanup organ (nx_janitor_sprawl): an orphaned-registry-.tsv detector + REVERSIBLE quarantiner, with the cardinal NO-FALSE-POSITIVE law. Builds a hermetic /tmp fixture (a scan tree + a registry of 6 .tsv files) and calls js_run directly, so the gate never touches the real registry. The fixture is designed to DISCRIMINATE: - 3 PROTECTED tsvs: one referenced by a real path const, one named as a substring of a referenced longer name (boundary-protected), one mentioned ONLY in a // comment (over-protect law). - 3 ORPHAN tsvs: two plain unreferenced, plus bcensus.tsv -- which is a SUBSTRING of the referenced fix_bcensus.tsv and MUST STILL be quarantined (the left word-boundary must reject that shielding). NEGATIVE CONTROLS (load-bearing): the referenced/comment/boundary-protected files MUST stay put -- a false positive (quarantining a used file) flips the gate RED; the boundary orphan MUST move -- an over-broad substring-protect flips it RED. Plus idempotency (a second run moves nothing new). GREEN iff all 11 checks hold. Reversible: the action is rename(2) into quarantine, never delete. Sovereign: imports nx_janitor_sprawl + nx_syscalls (nx_cc->nxasm, no gcc). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_janitor_sprawl.nx nx_syscalls.nx nx_janitor_sprawl_gate.nx

imports: nx_janitor_sprawl.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main jg_puts sys_write sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ jg_cat jg_catn sys_mmap ↻ jg_join jg_cat ↻ jg_mkdir sys_mkdir jg_write sys_openat_wr sys_write ↻ sys_close

structs

none

consts

none

functions

19func jg_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: jg_assertmain calls 1: sys_write
20func jg_putn(v: i64) -> i64
29func jg_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != 0 as u8 { dst[off + i] = s[i]; i = i + 1 } return off + i }
called by 2: jg_joinmain
30func jg_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
38func jg_join(out: *u8, a: *u8, b: *u8) -> i64 { var o: i64 = jg_cat(out, 0, a); o = jg_cat(out, o, b); out[o] = 0 as u8; return o }
called by 3: jg_write_regjg_exists_inmain calls 1: jg_cat
39func jg_mkdir(path: *u8) -> i64 { return sys_mkdir(path, 0x1ed) }
called by 1: main calls 1: sys_mkdir
40func jg_write(path: *u8, content: *u8) -> i64
46func jg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: jg_exists_in calls 2: sys_openat_rdsys_close
48func jg_write_reg(dir: *u8, leaf: *u8, content: *u8) -> i64
52func jg_exists_in(dir: *u8, leaf: *u8) -> i64
55func jg_assert(label: *u8, cond: i64) -> i64
calls 1: jg_puts
60func main() -> i64