code wiki / _hdl_build / nx_build_autoroot_gate.nx
nx_build_autoroot_gate.nx
buildroot/runtime/_hdl_build/nx_build_autoroot_gate.nx
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
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
structs
| none |
consts
| 12 | const ODIR: *u8 = "runtime/_hdl_build" |
| 13 | const FB: i64 = 262144 |
| 14 | const SLOT: i64 = 160 |
functions
| 16 | func ap(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 17 | func alen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 18 | func apn(v: i64) -> i64 |
| 27 | func aread(path: *u8, buf: *u8, cap: i64) -> i64 |
| 33 | func aexists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 34 | func ajoin(pfx: *u8, name: *u8, out: *u8) -> i64 |
| 41 | func aresolve(name: *u8) -> i64 |
| 49 | func afind(buf: *u8, from: i64, to: i64, pat: *u8) -> i64 |
| 55 | func agetdents(fd: i64, buf: *u8, count: i64) -> i64 { return __syscall(217, fd, buf, count, 0, 0, 0) } called by 1: main |
| 56 | func a_isorgan(name: *u8) -> i64 |
| 68 | func a_dangling(path: *u8) -> i64 |
| 100 | func main() -> i64 |