code wiki / _hdl_build / nx_build_imports_gate.nx
nx_build_imports_gate.nx
buildroot/runtime/_hdl_build/nx_build_imports_gate.nx
about
nx_build_imports_gate.nx -- SECOND genealogy LENS (operator: "multiple ways to look at ancestors and
descendants, fine with all ... rooted from god so we can rebuild anything"). Where nx_build_lineage_gate
gives the genesis-anchor view (organ -> DESC-ORGANS -> god), THIS gives the IMPORT-DEPENDENCY view = the
REAL rebuild DAG: an organ's true ancestors are the organs it `import`s, recursively, bottoming out at
nx_syscalls (the toolchain leaf, which roots to god via DESC-TOOLCHAIN). To REBUILD an organ you must
first build its imports -> the import graph IS the rebuild order. A dangling import (names a file that
does not exist) = a broken-lineage orphan = forbidden.
BOTH directions: ANCESTORS(organ) = its imports; DESCENDANTS(lib) = who imports it.
GATE w/ NEG-CONTROL: GREEN iff EVERY registered organ's imports all RESOLVE (0 dangling) AND a bogus
import name is detected as unresolvable. Self-contained. 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
| 13 | const REG: *u8 = "knowledge/registry/build_registry.log" |
| 14 | const FB: i64 = 262144 |
| 15 | const MAXO: i64 = 8192 |
| 16 | const SLOT: i64 = 160 |
functions
| 18 | func ip(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 19 | func ilen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: ifind |
| 20 | func ipn(v: i64) -> i64 |
| 29 | func istreq(a: *u8, b: *u8) -> i64 |
| 35 | func iread(path: *u8, buf: *u8, cap: i64) -> i64 |
| 41 | func iexists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 42 | func ijoin(pfx: *u8, name: *u8, out: *u8) -> i64 |
| 49 | func iresolve(name: *u8) -> i64 |
| 56 | func iorgan_path(name: *u8, out: *u8) -> i64 |
| 61 | func ifind(buf: *u8, from: i64, to: i64, pat: *u8) -> i64 |
| 68 | func imp_scan(buf: *u8, n: i64, out: *i64, cap: i64) -> i64 |
| 88 | func imports_target(organ: *u8, target: *u8) -> i64 |
| 100 | func main() -> i64 |