code wiki / (root) / nx_store_janitor_gate.nx

nx_store_janitor_gate.nx

buildroot/runtime/nx_store_janitor_gate.nx

12792 B239 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic store
docsdependenciesstructsconstsfunctions

about

nx_store_janitor_gate.nx -- THE JANITOR GATE: the seg-store's most destructive standing beat (it moves files nobody can reach, on every plane, every beat) had NO gate. Born 2026-08-18 from two live incidents in two days: nx_store_janitor swept a segment being BORN (files land before the manifest line, id above the manifest max), then its race repair restored only the .docs -- comparewatch-seg-1786828803 (08-16/17) and debt-seg-1787064612 (08-18) both read as "lossy load"/SHORTFALL to every reader, and one seat's debt row was overwritten during the hand repair. Subject: ./nx_store_janitor.elf (argv[1] overrides the path so a STAGED build can be bitten before promote). Fixture assembled at RUNTIME under /tmp/janitor_gate/ (a detector that scans source would find its own fixture) and rebuilt from scratch on every run (idempotent by construction). Teeth, each printed with its values: superseded segment moved (the sweep still sweeps -- the anti-vacuity tooth), birth in flight left alone, live segment untouched, heal restores EVERY sidecar, heal never clobbers a live file, empty manifest REFUSES and touches nothing. RED against the pre-08-18 binary by construction (it moves the birth and knows no heal verb); GREEN only when both fixes are in the forked binary. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_tool_run.nx nx_store_janitor_gate.nx

imports: nx_gate_verdict.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ gv_puts ↻ gv_need gv_puts ↻ jg_exists jg_size gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_puts ↻ gv_num ↻ gv_journal sys_openat_append

structs

none

consts

17const JG_OUT: i64 = 65536
18const JG_PATH: i64 = 512
19const JG_STAT: i64 = 256
20const JG_STAT_SIZE_OFF: i64 = 48
21const JG_AV: i64 = 64
22const JG_I64: i64 = 8
23const JG_EXIT_REFUSED: i64 = 3 // nx_store_janitor's own REFUSED exit code (its header contract)

functions

27func jg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: jg_wjg_has
28func jg_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } return p }
called by 2: jg_livejg_retired
30func jg_size(path: *u8) -> i64
called by 2: jg_existsmain
38func jg_exists(path: *u8) -> i64 { if jg_size(path) >= 0 { return 1 } return 0 }
called by 2: jg_count4main calls 1: jg_size
39func jg_w(path: *u8, content: *u8) -> i64
called by 2: jg_make4main calls 1: jg_slen
47func jg_has(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: main calls 1: jg_slen
61func jg_live(dst: *u8, pfx: *u8, id: *u8, ext: *u8) -> i64
69func jg_retired(dst: *u8, ret: *u8, id: *u8, ext: *u8) -> i64
78func jg_count4(pfx: *u8, ret: *u8, id: *u8, loc: i64) -> i64
called by 1: main calls 3: jg_livejg_retiredjg_exists
96func jg_clear(pfx: *u8, ret: *u8, id: *u8) -> i64
called by 1: main calls 2: jg_livejg_retired
113func jg_make4(pfx: *u8, ret: *u8, id: *u8, loc: i64, body: *u8) -> i64
called by 1: main calls 3: jg_livejg_retiredjg_w
130func jg_run(elf: *u8, pfx: *u8, verb: *u8, out: *u8, olen: *i64) -> i64
called by 1: main calls 1: tr_run_capture
142func main(argc: i64, argv: *i64) -> i64