code wiki / _hdl_build / nx_build_autoroot_gate.nx

nx_build_autoroot_gate.nx

buildroot/runtime/_hdl_build/nx_build_autoroot_gate.nx

7785 B149 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic build
docsdependenciesstructsconstsfunctions

about

nx_build_autoroot_gate.nx -- AUTO-ROOT THE WHOLE STACK via the import-DAG (operator: "rooted from god so we can rebuild anything ... no floating mystery kids"). Insight: an organ declares its OWN ancestors in its `import` lines, so we can root EVERY organ automatically -- no manual anchor. An organ is IMPORT-ROOTED (rebuildable) iff every import it declares RESOLVES to a real file (which itself bottoms at nx_syscalls -> toolchain -> god). A dangling import = a TRUE orphan (broken lineage, cannot rebuild). This collapses the coarse "floating" count (organs lacking a registry anchor) into the PRECISE set of truly-unrootable organs. Scans ALL nx_*.nx in runtime/_hdl_build. GATE w/ neg-control: GREEN iff the scan completes + a bogus import is unresolvable + a real leaf resolves; it REPORTS import-rooted vs broken (the precise orphan worklist). Sovereign: imports only nx_syscalls. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_build_autoroot_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main ap sys_write sys_openat_rd sys_exit sys_mmap agetdents a_isorgan alen ajoin a_dangling sys_mmap ↻ aread sys_openat_rd ↻ sys_read sys_close afind alen ↻ aresolve sys_mmap ↻ ajoin ↻ aexists sys_openat_rd ↻ sys_close ↻ sys_close ↻ apn sys_mmap ↻ sys_write ↻ aresolve ↻

structs

none

consts

12const ODIR: *u8 = "runtime/_hdl_build"
13const FB: i64 = 262144
14const SLOT: i64 = 160

functions

16func ap(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 1: main calls 1: sys_write
17func alen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: afinda_isorgan
18func apn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
27func aread(path: *u8, buf: *u8, cap: i64) -> i64
33func aexists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: aresolve calls 2: sys_openat_rdsys_close
34func ajoin(pfx: *u8, name: *u8, out: *u8) -> i64
called by 2: aresolvemain
41func aresolve(name: *u8) -> i64
called by 2: a_danglingmain calls 3: sys_mmapajoinaexists
49func afind(buf: *u8, from: i64, to: i64, pat: *u8) -> i64
called by 1: a_dangling calls 1: alen
55func agetdents(fd: i64, buf: *u8, count: i64) -> i64 { return __syscall(217, fd, buf, count, 0, 0, 0) }
called by 1: main
56func a_isorgan(name: *u8) -> i64
called by 1: main calls 1: alen
68func a_dangling(path: *u8) -> i64
called by 1: main calls 4: sys_mmapareadafindaresolve
100func main() -> i64