code wiki / (root) / nx_libindex_gate.nx

nx_libindex_gate.nx

buildroot/runtime/nx_libindex_gate.nx

8697 B142 linesdepth 6pulls 11 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_libindex_gate.nx -- GATE for the library discovery index (PG1, procgen.plan, 2026-08-24). Composes nx_libindex_lib IN-PROCESS. There is no deployed binary to fork, so the mutation-tester defect where the harness rebuilds the TEST but not the SUBJECT cannot arise here by construction. FIXTURES LIVE IN /tmp/<gate>/, created by sys_mkdir at SETUP -- including the FIXTURE PLANE the build seeds, so the gate never touches the production plane at knowledge/store/libindex-. Estate law, paid for twice: a gate sharing scratch with a production plane reports on the FIXTURE rather than the code, and a teardown does not run when a run crashes, so setup must be the thing that guarantees the clean state. THE LOAD-BEARING TOOTH is finds-a-symbol-that-only-a-library-declares. Everything else here could pass on a broken index; that one is the capability claim itself -- a symbol nx_capsearch was structurally unable to return must be returnable from this plane, or this organ has not closed the gap it was built to close. TWO NEG-CONTROLS AND AN ANTI-VACUITY TOOTH, because an index that swallowed every .nx file would satisfy every positive assertion above while being exactly the wrong artifact.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_libindex_lib.nx nx_libindex_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_libindex_lib.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 ↻ sys_mkdir vlg_dir sys_mmap ↻ li_cen sys_mmap ↻ li_build_to li_out li_w sys_write ↻ li_scan_dir sys_mmap ↻ li_ends_nx cl_cat3 cl_is_lib sys_mmap ↻ cl_slurp cl_open_estate sys_mmap ↻ sys_openat_rd cl_estate_path

structs

none

consts

22const VLG_SCRATCH: i64 = 0x1ff // mkdir mode 0777, masked by umask -- matches nx_fs.fs_mkdir
23const VLG_TERMS: i64 = 8

functions

25func vlg_dir() -> *u8 { return "/tmp/nx_libindex_gate" as *u8 }
called by 1: main
26func vlg_scratch() -> *u8 { return "/tmp/nx_libindex_gate/walk.scratch" as *u8 }
called by 1: main
27func vlg_plane() -> *u8 { return "/tmp/nx_libindex_gate/libindex-" as *u8 }
called by 1: main
28func vlg_one_scratch() -> *u8 { return "/tmp/nx_libindex_gate/oneroot.scratch" as *u8 }
called by 1: main
29func vlg_missing() -> *u8 { return "/tmp/nx_libindex_gate/no-such-plane-" as *u8 }
called by 1: main
32func vlg_term1(slot: *i64, s: *u8) -> i64 { slot[0] = s as i64; return 1 }
called by 1: main
34func main() -> i64