code wiki / _hdl_build / nx_build_rooted_gate.nx
nx_build_rooted_gate.nx
buildroot/runtime/_hdl_build/nx_build_rooted_gate.nx
about
nx_build_rooted_gate.nx -- ROBUST GENEALOGY: every organ ROOTED to god, NO floating mystery-kid orphans
(operator 2026-06-21: "rooted from god so we can rebuild anything = true S-class exceed"). The genesis
COMPLETENESS LAW (no orphans) from nx_genesis_trace, now enforced over EVERY built organ. Reads the REAL
genesis tree (knowledge/registry/genesis_lineage.tsv) + the build-registry (knowledge/registry/
build_registry.log) + the organ tree (runtime/_hdl_build). Two directions, both proven:
ANCESTORS (rebuild path): each registered organ's parent= anchor walks UP to ORIGIN(god); reaching
god = ROOTED; not reaching = ORPHAN (the chain IS the rebuild order: build god's caps first, up to the organ).
DESCENDANTS: organs anchored under a node (e.g. DESC-ORGANS) = its children.
FLOATING census: organs on disk NOT in the registry = mystery kids with no anchor = the worklist to root.
GATE w/ NEG-CONTROL: GREEN iff EVERY registered organ is rooted (0 registered-orphans) AND a bogus anchor
is detected as orphan (-1) AND DESC-ORGANS roots to god. (Floating = reported worklist, shrunk by the
R-LIVE-2 ratchet + coordinated migration -- not a hard fail since legacy migration is operator-paced.)
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
| 16 | const GEN: *u8 = "knowledge/registry/genesis_lineage.tsv" |
| 17 | const REG: *u8 = "knowledge/registry/build_registry.log" |
| 18 | const ODIR: *u8 = "runtime/_hdl_build" |
| 19 | const FB: i64 = 262144 |
| 20 | const MAXO: i64 = 8192 |
| 21 | const SLOT: i64 = 160 |
functions
| 23 | func rp(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 24 | func rlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 25 | func rpn(v: i64) -> i64 |
| 34 | func rstreq(a: *u8, b: *u8) -> i64 |
| 40 | func rcpy(dst: *u8, src: *u8) -> i64 { var i: i64 = 0; while src[i] != (0 as u8) { dst[i] = src[i]; i = i + 1 } dst[i] = 0 as u8; return 0 } called by 1: gen_hops |
| 41 | func rread(path: *u8, buf: *u8, cap: i64) -> i64 |
| 50 | func rgetdents(fd: i64, buf: *u8, count: i64) -> i64 { return __syscall(217, fd, buf, count, 0, 0, 0) } called by 1: main |
| 51 | func r_isorgan(name: *u8) -> i64 |
| 63 | func g_field(buf: *u8, ls: i64, le: i64, idx: i64, out: *u8) -> i64 called by 1: gen_parent |
| 70 | func kv_find(buf: *u8, from: i64, to: i64, pat: *u8) -> i64 |
| 76 | func kv_extract(buf: *u8, ls: i64, le: i64, key: *u8, out: *u8) -> i64 |
| 83 | func gen_parent(buf: *u8, n: i64, node: *u8, parent_out: *u8) -> i64 |
| 94 | func gen_hops(buf: *u8, n: i64, node: *u8) -> i64 |
| 106 | func in_set(name: *u8, names: *i64, cnt: i64) -> i64 |
| 112 | func main() -> i64 |